Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
d9f25c99
Commit
d9f25c99
authored
5 years ago
by
Daniel
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Better documentation of the `input` password method.
parent
8a2c243f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/pycaosdb.ini
+14
-3
14 additions, 3 deletions
examples/pycaosdb.ini
src/caosdb/connection/connection.py
+16
-2
16 additions, 2 deletions
src/caosdb/connection/connection.py
with
30 additions
and
5 deletions
examples/pycaosdb.ini
+
14
−
3
View file @
d9f25c99
...
...
@@ -6,17 +6,28 @@
[Connection]
cacert
=
/path/to/caosdb.ca.pem
url
=
https://localhost:10443/
## If this option is set, the SSL certtificate will be ignored. Use with care!
# ssl_insecure=1
username
=
admin
## optional: password in plain text
## The password input method can be chosen with the `password_method` setting,
## which by default is set to `plain`.
##
## DEFAULT: the password method is `plain`, now the password must be saved as
## plain text.
password_method
=
plain
password
=
caosdb
## OR: password using "pass" password manager
## OR: `input`: username is optional, password is entered by the user directly
# password_method=input
## OR: `pass`: password is retrieved from the "pass" password manager
# password_method=pass
# password_identifier=...
## OR: using the system keyring/wallet (macOS, GNOME, KDE, Windows)
## OR:
`keyring`:
using the system keyring/wallet (macOS, GNOME, KDE, Windows)
## requires installation of the keyring python package:
## pip install keyring
# password_method=keyring
This diff is collapsed.
Click to expand it.
src/caosdb/connection/connection.py
+
16
−
2
View file @
d9f25c99
...
...
@@ -167,7 +167,10 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
if
config
.
get
(
"
ssl_insecure
"
):
print
(
"
Relaxed SSL mode.
"
)
print
(
"
*** Warning! ***
\n
"
"
Insecure SSL mode, certificate will not be checked!
"
"
Please consider removing the `ssl_insecure` configuration option.
\n
"
"
****************
"
)
context
.
verify_mode
=
ssl
.
CERT_NONE
if
(
not
context
.
verify_mode
==
ssl
.
CERT_NONE
and
...
...
@@ -281,7 +284,7 @@ def _get_authenticator(**config):
def
configure_connection
(
**
kwargs
):
"""
Configures the caosdb connection and return the Connection object.
"""
Configures the caosdb connection and return
s
the Connection object.
The effective configuration is governed by the default values (see
'
Parameters
'
), the global configuration (see `caosdb.get_config()`) and the
...
...
@@ -296,12 +299,23 @@ def configure_connection(**kwargs):
implementation : CaosDBServerConnection
The class which implements the connection. (Default:
_DefaultCaosDBServerConnection)
password_method : str
The name of a submodule of caosdb.connection.authentication which
implements the AbstractAuthenticator interface. (Default:
'
plain
'
)
Possible values are, for example:
-
"
plain
"
Need username and password arguments.
-
"
input
"
Asks for the password.
-
"
pass
"
Uses the `pass` password manager.
-
"
keyring
"
Uses the `keyring` library.
timeout : int
A connection timeout in seconds. (Default: 210)
ssl_insecure : bool
Whether SSL certificate warnings should be ignored. Only use this for
development purposes! (Default: False)
Returns
-------
_Connection
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment