Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
40a737d0
Commit
40a737d0
authored
8 years ago
by
Chandrasekhar Ramakrishnan
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-3554: Implemented storage and reading of credentials from file.
parent
b8f086cc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/pybis/pybis.py
+3
-1
3 additions, 1 deletion
src/python/pybis/pybis.py
src/python/pybis/pybis_test.py
+2
-1
2 additions, 1 deletion
src/python/pybis/pybis_test.py
with
5 additions
and
2 deletions
src/python/pybis/pybis.py
+
3
−
1
View file @
40a737d0
...
...
@@ -59,7 +59,9 @@ class OpenbisCredentialStore:
"""
if
not
os
.
path
.
exists
(
self
.
store_path
):
return
OpenbisCredentials
()
# TODO Implement reading a credentials file
with
open
(
self
.
store_path
,
"
r
"
)
as
f
:
token
=
f
.
read
()
return
OpenbisCredentials
(
token
)
def
write
(
self
,
credentials
):
"""
Write a credentials object to the store, overwriting any previous information.
...
...
This diff is collapsed.
Click to expand it.
src/python/pybis/pybis_test.py
+
2
−
1
View file @
40a737d0
...
...
@@ -18,4 +18,5 @@ def test_credentials_store(tmpdir):
store
=
OpenbisCredentialStore
(
str
(
tmpdir
))
store
.
write
(
credentials
)
disk_credentials
=
store
.
read
()
assert
credentials
.
token
==
disk_credentials
.
token
\ No newline at end of file
assert
credentials
.
token
==
disk_credentials
.
token
assert
not
disk_credentials
.
has_username_and_password
()
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