Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user guide for secret store #16

Closed
ckunki opened this issue Oct 26, 2023 · 0 comments · Fixed by #18
Closed

Add user guide for secret store #16

ckunki opened this issue Oct 26, 2023 · 0 comments · Fixed by #18
Assignees
Labels
documentation User guides, tutorials, specifications

Comments

@ckunki
Copy link
Collaborator

ckunki commented Oct 26, 2023

Until we have a user guide, please see the unit tests.

Usage sample

from exasol.secret_store import Secrets

file = "password_db.sqlite"
secrets = Secrets(file, "my secret password")
key = "my key"
secrets.save(key, "my value").close()
value = secrets.get(key) 

Constraints and special situations

  • If file does not exist then SecretStore will create it.
  • If password is wrong then SecretStore will throw an exception.
  • If file contains key from a session in the past then method secrets.save() will overwrite the value for this key.
  • If key is not contained in file then SecretStore return None

Additional tasks

Besides maybe we should add a test trying to get the value of a non-existing key to verify behavior.

This test already did exist:

def test_database_file_created(secrets):
    assert secrets.get("any_key") is None
    assert secrets.db_file.exists()
@ckunki ckunki added the documentation User guides, tutorials, specifications label Oct 26, 2023
@ckunki ckunki self-assigned this Oct 31, 2023
ckunki added a commit that referenced this issue Oct 31, 2023
* Updated README.md.

* Added usage instructions for secret store

* Fixed review findings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation User guides, tutorials, specifications
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant