Skip to main content

Mercurial extension for storing passwords securely

Project description

This is an extension for Mercurial 5.6 or later, allowing you to store HTTP passwords securely. The extension itself does not offer any commands, you simply enable it, and get an extra prompt:

$ hg pull
pulling from https://example.com/private/repo
http authorization required for https://example.com/private/repo
realm: Mercurial
user: me
password: <SECRET>
would you like to save this password? (Y/n)  y
searching for changes
no changes found

That would result an a new item named in your key chain or key ring:

Mercurial (me@example.com)

Once a password is saved, there’s nothing more to do. You’ll get a new prompt, should the password suddenly stop working. To manage or delete your passwords, use the Keychain Services application included with macOS, GNOME Keyring or something similar included in your desktop environment.

Requirements

  • Python 3.6 or later.

  • Mercurial 5.6 or later.

  • SecretStorage on platforms other than macOS.

Windows is not supported, yet.

Installation and usage

Install the extension and its dependencies with Pip:

$ pip install .

Then, add the following lines to your ~/.hgrc:

[extensions]
credentials =

To avoid entering passwords for each and every repository, use auth.schemes:

[auth]
example.prefix = example.com
example.username = me

This will cause all repositories on https://example.com to resolve to the same Keychain item. See hg help config.auth for details.

Alternatives

The most obvious alternative to this extension is the Mercurial Keyring extension. It supports older versions of Mercurial and more backends, but saves passwords in a less readable fashion.

Future plans

  • Consider whether it makes sense to implement a completely custom urllib2 password manager, so passwords aren’t stored in memory any longer than strictly necessary.

Acknowledgements

Thanks you to Octobus and Heptapod for hosting this project, and for making Mercurial development fun again!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hg-credentials-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distributions

hg_credentials-0.1.1-cp39-cp39-macosx_11_0_x86_64.whl (20.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

hg_credentials-0.1.1-cp38-cp38-macosx_11_0_x86_64.whl (20.8 kB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

hg_credentials-0.1.1-cp37-cp37m-macosx_11_0_x86_64.whl (20.8 kB view details)

Uploaded CPython 3.7m macOS 11.0+ x86-64

hg_credentials-0.1.1-cp36-cp36m-macosx_11_0_x86_64.whl (20.8 kB view details)

Uploaded CPython 3.6m macOS 11.0+ x86-64

File details

Details for the file hg-credentials-0.1.1.tar.gz.

File metadata

  • Download URL: hg-credentials-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for hg-credentials-0.1.1.tar.gz
Algorithm Hash digest
SHA256 679cffb181e7843e74708eb52cf7eadd8cc162f102df2f7d3a6b610fc08b031a
MD5 9009458035b089c16eb8f26c20c866f6
BLAKE2b-256 a35de9cc04f676f72a109fd2304e891ff6704408f34e55d631099b828b8e1be0

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.1-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: hg_credentials-0.1.1-cp39-cp39-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: CPython 3.9, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for hg_credentials-0.1.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6eea5b8a7cb0eb1ebe96538c2d534749001311ea3103d0d95d02354046dd7366
MD5 793b0330a4f9796e2f420d49a6c1d7d9
BLAKE2b-256 99dfca4427eb2c1a0690f8c373bff4678041a0edc5d052407e7d825ca5156a5b

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.1-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: hg_credentials-0.1.1-cp38-cp38-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: CPython 3.8, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for hg_credentials-0.1.1-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2914989d4c3e4e22097807a103149fc44f498ae82237d826ca0a8437913a069e
MD5 cb32880875a4c2618e8a147f8ab41ebd
BLAKE2b-256 7768971e3c27a19eddc9d5ec1d1483104a66f57b6909b27bbcd0f0f9f6021516

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.1-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: hg_credentials-0.1.1-cp37-cp37m-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: CPython 3.7m, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for hg_credentials-0.1.1-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c1047d2749edd64ffa87a0d70d90e6558daecccf57656dec3adf6170c5dba8b5
MD5 780e4d4438aa7ee4f1c660d50676e71b
BLAKE2b-256 356da28ecba7e8a3e5d1cb8ae9dbb2b8ff9ec5a6a0db7507901d0fe8c7a8cf79

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.1-cp36-cp36m-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: hg_credentials-0.1.1-cp36-cp36m-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: CPython 3.6m, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for hg_credentials-0.1.1-cp36-cp36m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2072742880ff841efdb5addbb0d2d6b65f405dc943024f0d3ceef03ba6d706ba
MD5 03625b0bccef73f5dbbb4e1ae991b023
BLAKE2b-256 6a179db61e910ddc49ac7f0ed7850fa06ddd9da14d18b2c3aca6fdf33f36770a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page