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

Implement dbutils.secrets.* equivalent #43

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Implement dbutils.secrets.* equivalent #43

merged 3 commits into from
Mar 23, 2023

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Mar 23, 2023

  • Implemented dbutils.secrets.get(), dbutils.secrets.list(), and dbutils.secrets.listScopes().

Experimental

  • Added a basic, best-effort, logging filter to redact secrets from accidental logging. sys.stdout, sys.stderr, and print() statements are not handled.

databricks-sdk-py_–_test_dbutils_py

 - Implemented `dbutils.secrets.get()`, `dbutils.secrets.list()`, and `dbutils.secrets.listScopes()`.
 - Added a basic, best-effort, logging filter to redact secrets from accidental logging. `sys.stdout`, `sys.stderr`, and `print()` statements are not handled.
@nfx nfx requested a review from a team March 23, 2023 13:27
@nfx nfx merged commit a140c45 into main Mar 23, 2023
@nfx nfx deleted the dbutils/secrets branch March 23, 2023 15:51
Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any testing on the redaction itself?

Comment on lines +24 to +33
class SecretScope(namedtuple('SecretScope', ['name'])):

def getName(self):
return self.name


class SecretMetadata(namedtuple('SecretMetadata', ['key'])):
pass


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated in _impl.py?

def test_proxy_secret_scopes(w, env_or_skip):
cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID")
os.environ['DATABRICKS_CLUSTER_ID'] = cluster_id
def test_secrets(w, random):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants