Skip to content

Commit 10cf56b

Browse files
authored
Merge pull request #103 from mslw/credentials-example
DOC: Add an example of adding a user_password credential
2 parents 62803bd + 01feee5 commit 10cf56b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### 📝 Documentation
2+
3+
- Add an example of adding a `user_password`-type credentials, with a
4+
given `user` property, to the examples in the `credentials`
5+
command. https://github.com/datalad/datalad-next/pull/103 (by @mslw)

datalad_next/credentials.py

+4
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ class Credentials(Interface):
220220
dict(text="Upgrade a legacy credential by annotating it with a 'type' property",
221221
code_py="credentials('set', name='legacycred', spec={'type': 'user_password')",
222222
code_cmd="datalad credentials set legacycred type=user_password"),
223+
dict(text="Set a new credential of type user_password, with a given user property, "
224+
"and input its secret interactively",
225+
code_py="credentials('set', name='mycred', spec={'type': 'user_password', 'user': '<username>'})",
226+
code_cmd="datalad credentials set mycred type=user_password user=<username>"),
223227
dict(text="Obtain a (possibly yet undefined) credential with a minimum set of "
224228
"properties. All missing properties and secret will be "
225229
"prompted for, no information will be stored! "

0 commit comments

Comments
 (0)