##// END OF EJS Templates
Proper HISTORY file
Marcin Kasperski -
r155:335c0c13 0.7.0 default
parent child Browse files
Show More
@@ -0,0 +1,198 b''
1 0.7.0
2 ~~~~~~~~~~~~~~~~~~~
3
4 Delaying keyring module import until passwords are really needed. It
5 can noticeably improve Mercurial (non pull/push) performance in some
6 cases (no longer slow hg status because D-Bus is busy an keyring tries
7 to activate KDE Wallet through it…).
8
9 0.6.7
10 ~~~~~~~~~~~~~~~~~
11
12 #46 Fixed syntax of smtp.tls configuration setting (current Mercurials
13 doesn't handle "true" anymore, TortoiseHG crashed with mercurial
14 keyring enabled while currently recommended starttls/smtps/none values
15 were in use).
16
17 0.6.6
18 ~~~~~~~~~~~~~~~~~
19
20 #44 Handling some more mercurial versions in demandimport-detection
21 logic.
22
23 0.6.5
24 ~~~~~~~~~~~~~~~~~
25
26 #36 Shutting up warning about no logging handlers.
27
28 0.6.4
29 ~~~~~~~~~~~~~~~~~
30
31 #44 Pre-2.9.1 Mercurials compatibility (probing for active
32 demandimport differently).
33
34 0.6.3
35 ~~~~~~~~~~~~~~~~~
36
37 #41 Fix for incorrect demandimport activity check logic, which could
38 cause various problems with imports after mercurial_keyring is
39 imported.
40
41 0.6.2
42 ~~~~~~~~~~~~~~~~~
43
44 #33 Fix for UnicodeDecodeErrors happening on some backends (especially
45 Vault) when passwords with non-ascii characters are in use and native
46 locale is not utf-8. Passwords are no longer saved to keyring backends
47 as-entered, they are now decoded from local encoding (whichever is
48 detected by Mercurial), then encoded to unicode.
49
50 0.6.1
51 ~~~~~~~~~~~~~~~~~
52
53 #30 Yet another demandimport conflict fixed.
54
55 0.6.0
56 ~~~~~~~~~~~~~~~~~
57
58 #28 Disable demandimport completely during keyring import. Mayhaps it
59 will resolve (most) demandimport conflict errors.
60
61 0.5.7
62 ~~~~~~~~~~~~~~~~~
63
64 #27 Some more demandimport ignores.
65
66 0.5.6
67 ~~~~~~~~~~~~~~~~~
68
69 #24, #25 Demandimport fixes (import failures in specific cases).
70
71 Better way of demandimport-ignoring modules. In particular, we append
72 more of them if gobject happens to be on the list.
73
74 0.5.5
75 ~~~~~~~~~~~~~~~~~
76
77 Fix for gnome keyring import problems.
78
79 0.5.4
80 ~~~~~~~~~~~~~~~~~
81
82 #22 Some more demandimport ignores (fix import failures).
83
84 SMTP password was not cleared properly (after detecting that it is
85 invalid).
86
87 Clarified license to be modified BSD style license.
88
89 0.5.3
90 ~~~~~~~~~~~~~~~~~
91
92 Remove useless import which caused problems on Mercurial 2.3 when
93 demandimport was not enabled
94
95 0.5.1
96 ~~~~~~~~~~~~~~~~~
97
98 Add help text to output for hg help.
99
100 0.5.0
101 ~~~~~~~~~~~~~~~~~
102
103 Improved bad password detection. Internally: extension is now able to
104 properly differentiate between an authentication failure and a new
105 request to the same url.
106
107 Fixes in debug message
108
109 Further debug messages patching
110
111 Improving debug messages handling.
112
113 Mercurial Keyring debug messages are now prefixed with
114 [HgKeyring] to make distinguishing them easier
115
116 0.4.6
117 ~~~~~~~~~~~~~~~~~
118
119 More compatibility (changed signature of httpconnection.readauthforuri
120 , introduced post Mercurial 1.9 - since hg.0593e8f81c71)
121
122 Fix compatibility code which did not work due to demandimport issues
123 (attempts to catch ImportErrors on "from mercurial.url import
124 readauthforuri" were not working properly).
125
126 0.4.5
127 ~~~~~~~~~~~~~~~~~
128
129 Mercurial 1.9 compatibility (readauthforuri has been moved into new
130 httpconnection module).
131
132 0.4.4
133 ~~~~~~~~~~~~~~~~~
134
135 Mercurial 1.8 compatibility (passwordmgr.readauthtoken() has been
136 moved into mercurial.url.readauthforuri).
137
138 0.4.3
139 ~~~~~~~~~~~~~~~~~
140
141 Keyring fork no longer is needed as keyring releases are available
142 again.
143
144 Workaround for gnomekeyring mercurial.demandimport incompatibility:
145 mercurial.demandimport, which is enabled while in a mercurial
146 extensions, prevents the correct import of gobject._gobject and
147 consequently doesn't allow the loading of the gnomekeyring module,
148 which can be used by keyring. This just adds the proper module to
149 demandimport ignore list.
150
151 0.4.2
152 ~~~~~~~~~~~~~~~~~
153
154 No longer raising an error when username is specified both in ~/.hgrc
155 and <repo>/.hg/hgrc if it is the same in both places.
156
157 Docs recommend sborho keyring fork.
158
159 0.4.1
160 ~~~~~~~~~~~~~~~~~
161
162 Some tweaks and docs related to prefix handling.
163
164 Explicit information that keyring is not used due to lack of username.
165
166 0.4.0
167 ~~~~~~~~~~~~~~~~~
168
169 Store and lookup prefix from [auth] so that password is shared amongst
170 shared auth entries
171
172 0.3.3
173 ~~~~~~~~~~~~~~~~~
174
175 Better error message
176
177 0.3.2
178 ~~~~~~~~~~~~~~~~~
179
180 Doc tweaks
181
182 0.3.1
183 ~~~~~~~~~~~~~~~~~
184
185 Introduced and documented PyPi package, added setup.py
186
187 0.2.0
188 ~~~~~~~~~~~~~~~~~
189
190 Added handling of SMTP passwords (tested on patchbomb extension but
191 should work on anything what utilizes mercurial.mail)
192
193 Docstrings mention Debian keyring packages.
194
195 0.1.1
196 ~~~~~~~~~~~~~~~~~
197
198 Initial public release
@@ -1,199 +1,206 b''
1 .. -*- mode: rst -*-
1 .. -*- mode: rst -*-
2
2
3 =================
3 =================
4 mercurial_keyring
4 mercurial_keyring
5 =================
5 =================
6
6
7 ``mercurial_keyring`` is a Mercurial_ extension used to securely save
7 ``mercurial_keyring`` is a Mercurial_ extension used to securely save
8 HTTP and SMTP authentication passwords in password databases (Gnome
8 HTTP and SMTP authentication passwords in password databases (Gnome
9 Keyring, KDE KWallet, OSXKeyChain, specific solutions for Win32 and
9 Keyring, KDE KWallet, OSXKeyChain, specific solutions for Win32 and
10 command line). This extension uses and wraps services of the keyring_
10 command line). This extension uses and wraps services of the keyring_
11 library.
11 library.
12
12
13 .. _keyring: http://pypi.python.org/pypi/keyring
13 .. _keyring: http://pypi.python.org/pypi/keyring
14 .. _Mercurial: http://mercurial.selenic.com
14 .. _Mercurial: http://mercurial.selenic.com
15
15
16 How does it work
16 How does it work
17 ================
17 ================
18
18
19 The extension prompts for the password on the first pull/push (in case
19 The extension prompts for the password on the first pull/push (in case
20 of HTTP) or first email (in case of SMTP), just like it is done by
20 of HTTP) or first email (in case of SMTP), just like it is done by
21 default, but saves the password. On successive runs it checks for the
21 default, but saves the password. On successive runs it checks for the
22 username in ``.hg/hgrc``, then for suitable password in the password
22 username in ``.hg/hgrc``, then for suitable password in the password
23 database, and uses those credentials (if found).
23 database, and uses those credentials (if found).
24
24
25 In case password turns out to be incorrect (either because it was
25 In case password turns out to be incorrect (either because it was
26 invalid, or because it was changed on the server) or missing it just
26 invalid, or because it was changed on the server) or missing it just
27 prompts the user again.
27 prompts the user again.
28
28
29 Passwords are identified by the combination of username and remote
29 Passwords are identified by the combination of username and remote
30 address, so they can be reused between repositories if they access the
30 address, so they can be reused between repositories if they access the
31 same remote repository (or the same SMTP server).
31 same remote repository (or the same SMTP server).
32
32
33 Installation
33 Installation
34 ============
34 ============
35
35
36 Prerequisites
36 Prerequisites
37 -------------
37 -------------
38
38
39 Install the keyring_ library:
39 Install the keyring_ library:
40
40
41 ::
41 ::
42
42
43 easy_install keyring
43 easy_install keyring
44
44
45 (or ``pip keyring``). On Debian "Sid" the library can be also
45 (or ``pip keyring``). On Debian "Sid" the library can be also
46 installed from the official archive (packages ``python-keyring``
46 installed from the official archive (packages ``python-keyring``
47 and either ``python-keyring-gnome`` or ``python-keyring-kwallet``).
47 and either ``python-keyring-gnome`` or ``python-keyring-kwallet``).
48
48
49 Note: keyring >= 0.3 is strongly recommended, especially in case text
49 Note: keyring >= 0.3 is strongly recommended, especially in case text
50 backend is to be used.
50 backend is to be used.
51
51
52 .. _this keyring fork: https://bitbucket.org/sborho/python-keyring-lib
52 .. _this keyring fork: https://bitbucket.org/sborho/python-keyring-lib
53
53
54 Extension installation
54 Extension installation
55 ----------------------
55 ----------------------
56
56
57 There are two possible ways of installing the extension: using PyPi package,
57 There are two possible ways of installing the extension: using PyPi package,
58 or using individual file.
58 or using individual file.
59
59
60 To install as a package use ``easy_install``:
60 To install as a package use ``easy_install``:
61
61
62 ::
62 ::
63
63
64 easy_install mercurial_keyring
64 easy_install mercurial_keyring
65
65
66 and then enable it in ``~/.hgrc`` (or ``/etc/mercurial/hgrc``) using:
66 and then enable it in ``~/.hgrc`` (or ``/etc/mercurial/hgrc``) using:
67
67
68 ::
68 ::
69
69
70 [extensions]
70 [extensions]
71 mercurial_keyring =
71 mercurial_keyring =
72
72
73 To install using individual file, download the
73 To install using individual file, download the
74 `mercurial_keyring.py`_ file, save it anywhere you like, and
74 `mercurial_keyring.py`_ file, save it anywhere you like, and
75 put the following in ``~/.hgrc`` (or ``/etc/mercurial/hgrc``):
75 put the following in ``~/.hgrc`` (or ``/etc/mercurial/hgrc``):
76
76
77 ::
77 ::
78
78
79 [extensions]
79 [extensions]
80 hgext.mercurial_keyring = /path/to/mercurial_keyring.py
80 hgext.mercurial_keyring = /path/to/mercurial_keyring.py
81
81
82 .. _the code:
82 .. _the code:
83 .. _mercurial_keyring.py: http://bitbucket.org/Mekk/mercurial_keyring/src/tip/mercurial_keyring.py
83 .. _mercurial_keyring.py: http://bitbucket.org/Mekk/mercurial_keyring/src/tip/mercurial_keyring.py
84
84
85 Password backend configuration
85 Password backend configuration
86 ==============================
86 ==============================
87
87
88 The library should usually pick the most appropriate password backend
88 The library should usually pick the most appropriate password backend
89 without configuration. Still, if necessary, it can be configured using
89 without configuration. Still, if necessary, it can be configured using
90 ``~/keyringrc.cfg`` file (``keyringrc.cfg`` in the home directory of
90 ``~/keyringrc.cfg`` file (``keyringrc.cfg`` in the home directory of
91 the current user). Refer to keyring_ docs for more details.
91 the current user). Refer to keyring_ docs for more details.
92
92
93 *I considered handling similar options in hgrc, but decided that
93 *I considered handling similar options in hgrc, but decided that
94 single user may use more than one keyring-based script. Still, I am
94 single user may use more than one keyring-based script. Still, I am
95 open to suggestions.*
95 open to suggestions.*
96
96
97 Repository configuration (HTTP)
97 Repository configuration (HTTP)
98 ===============================
98 ===============================
99
99
100 Edit repository-local ``.hg/hgrc`` and save there the remote
100 Edit repository-local ``.hg/hgrc`` and save there the remote
101 repository path and the username, but do not save the password. For
101 repository path and the username, but do not save the password. For
102 example:
102 example:
103
103
104 ::
104 ::
105
105
106 [paths]
106 [paths]
107 myremote = https://my.server.com/hgrepo/someproject
107 myremote = https://my.server.com/hgrepo/someproject
108
108
109 [auth]
109 [auth]
110 myremote.schemes = http https
110 myremote.schemes = http https
111 myremote.prefix = my.server.com/hgrepo
111 myremote.prefix = my.server.com/hgrepo
112 myremote.username = mekk
112 myremote.username = mekk
113
113
114 Simpler form with url-embedded name can also be used:
114 Simpler form with url-embedded name can also be used:
115
115
116 ::
116 ::
117
117
118 [paths]
118 [paths]
119 bitbucket = https://User@bitbucket.org/User/project_name/
119 bitbucket = https://User@bitbucket.org/User/project_name/
120
120
121 If prefix is specified, it is used to identify the password (so all
121 If prefix is specified, it is used to identify the password (so all
122 repositories with the same prefix and the same username will share the
122 repositories with the same prefix and the same username will share the
123 same password). Otherwise full repository URL is used for this
123 same password). Otherwise full repository URL is used for this
124 purpose.
124 purpose.
125
125
126 Note: if both username and password are given in ``.hg/hgrc``,
126 Note: if both username and password are given in ``.hg/hgrc``,
127 extension will use them without using the password database. If
127 extension will use them without using the password database. If
128 username is not given, extension will prompt for credentials every
128 username is not given, extension will prompt for credentials every
129 time, also without saving the password.
129 time, also without saving the password.
130
130
131 Finally, if you are consistent about remote repository nicknames,
131 Finally, if you are consistent about remote repository nicknames,
132 you can configure the username in your `~/.hgrc` (`.hgrc` in your
132 you can configure the username in your `~/.hgrc` (`.hgrc` in your
133 home directory). For example, write there::
133 home directory). For example, write there::
134
134
135 [auth]
135 [auth]
136 acme.prefix = hg.acme.com/repositories
136 acme.prefix = hg.acme.com/repositories
137 acme.username = johnny
137 acme.username = johnny
138 acme.schemes = http https
138 acme.schemes = http https
139
139
140 and as long as you will be using alias `acme` for repositories like
140 and as long as you will be using alias `acme` for repositories like
141 `https://hg.acme.com/repositories/my_beautiful_app`, username
141 `https://hg.acme.com/repositories/my_beautiful_app`, username
142 `johnnny` will be used, and the same password reused.
142 `johnnny` will be used, and the same password reused.
143
143
144 The advantage of this method is that it works also for `clone`.
144 The advantage of this method is that it works also for `clone`.
145
145
146 Repository configuration (SMTP)
146 Repository configuration (SMTP)
147 ===============================
147 ===============================
148
148
149 Edit either repository-local ``.hg/hgrc``, or ``~/.hgrc`` and set
149 Edit either repository-local ``.hg/hgrc``, or ``~/.hgrc`` and set
150 there all standard email and smtp properties, including SMTP
150 there all standard email and smtp properties, including SMTP
151 username, but without SMTP password. For example:
151 username, but without SMTP password. For example:
152
152
153 ::
153 ::
154
154
155 [email]
155 [email]
156 method = smtp
156 method = smtp
157 from = Joe Doe <Joe.Doe@remote.com>
157 from = Joe Doe <Joe.Doe@remote.com>
158
158
159 [smtp]
159 [smtp]
160 host = smtp.gmail.com
160 host = smtp.gmail.com
161 port = 587
161 port = 587
162 username = JoeDoe@gmail.com
162 username = JoeDoe@gmail.com
163 tls = true
163 tls = true
164
164
165 Just as in case of HTTP, you *must* set username, but *must not* set
165 Just as in case of HTTP, you *must* set username, but *must not* set
166 password here to use the extension, in other cases it will revert to
166 password here to use the extension, in other cases it will revert to
167 the default behavior.
167 the default behavior.
168
168
169 Usage
169 Usage
170 =====
170 =====
171
171
172 Configure the repository as above, then just ``hg pull``, ``hg push``,
172 Configure the repository as above, then just ``hg pull``, ``hg push``,
173 etc. You should be asked for the password only once (per every
173 etc. You should be asked for the password only once (per every
174 username and remote repository prefix or url combination).
174 username and remote repository prefix or url combination).
175
175
176
176
177 Similarly, for email, configure as above and just ``hg email``.
177 Similarly, for email, configure as above and just ``hg email``.
178 Again, you will be asked for the password once (per every username and
178 Again, you will be asked for the password once (per every username and
179 email server address combination).
179 email server address combination).
180
180
181 Implementation details
181 Implementation details
182 ======================
182 ======================
183
183
184 The extension is monkey-patching the mercurial ``passwordmgr`` class
184 The extension is monkey-patching the mercurial ``passwordmgr`` class
185 to replace the find_user_password method. Detailed order of operations
185 to replace the find_user_password method. Detailed order of operations
186 is described in the comments inside `the code`_.
186 is described in the comments inside `the code`_.
187
187
188 History
189 ==========
190
191 See `HISTORY.txt`_.
192
188 Development
193 Development
189 ===========
194 ===========
190
195
191 Development is tracked on BitBucket, see
196 Development is tracked on BitBucket, see
192 http://bitbucket.org/Mekk/mercurial_keyring/
197 http://bitbucket.org/Mekk/mercurial_keyring/
193
198
194
199
195 Additional notes
200 Additional notes
196 ================
201 ================
197
202
198 Information about this extension is also available
203 Information about this extension is also available
199 on Mercurial Wiki: http://mercurial.selenic.com/wiki/KeyringExtension
204 on Mercurial Wiki: http://mercurial.selenic.com/wiki/KeyringExtension
205
206 .. _HISTORY.txt: http://bitbucket.org/Mekk/mercurial_keyring/src/HISTORY.txt
General Comments 0
You need to be logged in to leave comments. Login now