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.2.tar.gz (16.7 kB view details)

Uploaded Source

Built Distributions

hg_credentials-0.1.2-cp312-cp312-macosx_12_0_x86_64.whl (22.1 kB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

hg_credentials-0.1.2-cp311-cp311-macosx_12_0_x86_64.whl (22.1 kB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

hg_credentials-0.1.2-cp310-cp310-macosx_12_0_x86_64.whl (22.1 kB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

hg_credentials-0.1.2-cp39-cp39-macosx_12_0_x86_64.whl (22.1 kB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

hg_credentials-0.1.2-cp38-cp38-macosx_12_0_x86_64.whl (22.1 kB view details)

Uploaded CPython 3.8 macOS 12.0+ x86-64

File details

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

File metadata

  • Download URL: hg-credentials-0.1.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for hg-credentials-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ff77d95ec9899a51c48723b21e8b3919c92ac21d54e33472c060073fdd4073e6
MD5 33b058593b4c6b3295d0982ffc5d2337
BLAKE2b-256 c6956c0905f3849a9881f10b344b67b15d8c9427879057f0c1f8e5b570e482a9

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.2-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hg_credentials-0.1.2-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 c0907038effa63a27b360dc07d9ee65412c6b7d822e0e1a7035bfbb4116b11c9
MD5 7a6e19e0605547345a27a707405af596
BLAKE2b-256 348dbf752dc20e561d7f9bdf5e40245a5f1b3818ff8da67172ff79fb99abf3d8

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.2-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hg_credentials-0.1.2-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 f8647a5322109654d7c4fbe2f242e4995827444c7b128ed9e8991d70ff1d63f0
MD5 fc28ede1b92441949b0686a0933ec6bf
BLAKE2b-256 5067097808045c2d4442c172ed9ed1fde7a58568c23b7b3324bbbf8b886de226

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.2-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hg_credentials-0.1.2-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 14b3b21fcd07c0e8ffd6722cfb80b674f2fa6bfdd4846fe9f1e6797038023c31
MD5 d81733598214bf7d58bf2e40ae9249a8
BLAKE2b-256 1d16320a937e7c26345a7bce17378ac2567684a4c1328f6d796f83edc7d1eebf

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.2-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hg_credentials-0.1.2-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 3a675fa81497e6296611b733eeca4ffca7a1bcee0250c5693287c52e6a1bb2ad
MD5 997af36e567300d0d79619c89b1491c2
BLAKE2b-256 3eaabfc3e93d3141b50da3da1d1a93bfd616fa5fbbdbdf8bce81765866be2f2c

See more details on using hashes here.

File details

Details for the file hg_credentials-0.1.2-cp38-cp38-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hg_credentials-0.1.2-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 cad9932cdb0ebb3117e00b0c70310ed9608b53582f22bec670e0284238376160
MD5 7995c69b8c5083ec9b305228bd3fcd16
BLAKE2b-256 be0f3ce268c17243662136c4b532ab1a10f96c27bbcfa1b141a98fd1d3d6a024

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