Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
git-credential-ejson
Advanced tools
Readme
Git credential helper that keeps its data store in an encrypted JSON using id_rsa or similar certificate.
npm install git-credential-ejson
git config credential.helper ejson
Or:
git config credential.helper 'ejson [options]'
Where [options]
are:
-k cert
— a certificate file. If not specified, defaults to ~/.ssh/id_rsa
.-f name
— a store file. If not specified, defaults to ~/.credentials.json.enc
.This utility is installed with the git credential helper. It helps to deal with the store.
ejson [-k cert] -e|-d|-l [name]
Details:
-e
— encrypt a store.-d
— decrypt a store.-l
— print an encrypted file in clear text.-k cert
— use this file as a key, defaults to ~/.ssh/id_rsa
.name
is not specified then defaults to:
~/.credentials.json
is used for encoding~/.credentials.json.enc
is used for decoding and printing.Important notes:
git-credential-ejson
does NOT work with an unencrypted file.ejson
does not print an unencrypted file.The credential file can be editied manually. For that it can be converted back and forth with ejson
utility. Important: always make sure that it is a valid JSON!
Example of such file:
{
"example1.com": {
"username": "qpublic",
"password": "s0meRand0m$h!t"
},
"example2.com": {
"username": "qprivate",
"password": "yesssir!"
},
"example3.com:8080": {
"username": "qwerty",
"password": "yep-no-pass!"
},
"example3.com:8081": {
"username": "qwerty",
"password": "nope-no-pass!"
},
"https://user@example.com": {
"password": "$uperDuper$ec4re$+4ff"
},
"user@example.com": {
"password": "k!11b!11"
},
"http://example.com": {
"username": "SecretOfLife42",
"password": "weirdstuff"
},
"example.com": {
"username": "catch22",
"password": "tl;dr"
}
}
It is a simple dictionary, with keys are pseudo-URI in different states of specificity. They are always tried from the most specific to the less specific using available information.
Values are a dictionary of simple strings, which are used to override credential information, usually username
and password
.
In the example above all requests for example1.com
will be served with user name qpublic
and password s0meRand0m$h!t
. A port value is considered to be a part of host, as can be seen for values example3.com:8080
and example3.com:8081
.
The last four values listed in the order of a decreasing specificity (an order is not important) — that's how the helper will look for them. For example, if a git repository URL is http://user@example.com
, the following sequence of searches will be performed:
http://user@example.com
: fails.user@example.com
: succeeds, password k!11b!11
will be returned, potentially overwriting any other password, e.g., supplied in the URL itself.Another example: if a git repository URL is https://example.com
, the following sequence of searches will be performed:
https://example.com
: fails.example.com
: succeeds, user name catch22
and password tl;dr
will be returned, potentially overwriting any other user name and password.Yet another example: if a git repository URL is https://barry:white@example.com
, the following sequence of searches will be performed:
https://barry@example.com
: fails.barry@example.com
: fails.https://example.com
: fails.example.com
: succeeds, user name catch22
and password tl;dr
will be returned overwriting barry
and white
.While the helper can update its store automatically, it is possible to craft keys and values so they can cover different situations.
The helper tries following keys in the given order:
A port, if specified, is considered to be a part of host. If a URL part is unknown, a key that depends on it is not generated. For example, if we don't know a user name, we skip keys that include it.
Every values is an object with properties that will replace/augment an existing information we have. Usually we specify username
and password
, but it can be host
, protocol
, and path
. See the documentation of git credential.
New BSD.
FAQs
Git credential helper that keeps its data store in an encrypted JSON using id_rsa or similar certificate.
The npm package git-credential-ejson receives a total of 2 weekly downloads. As such, git-credential-ejson popularity was classified as not popular.
We found that git-credential-ejson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.