-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#14340 & #13849 - Clean secret ID and improve encrypt/decrypt exception management #14356
Conversation
openmetadata-service/src/main/java/org/openmetadata/service/secrets/SecretsManager.java
Outdated
Show resolved
Hide resolved
openmetadata-service/src/main/java/org/openmetadata/service/secrets/SecretsManager.java
Show resolved
Hide resolved
openmetadata-service/src/main/java/org/openmetadata/service/secrets/SecretsManager.java
Outdated
Show resolved
Hide resolved
*/ | ||
secretsManager = NoopSecretsManager.getInstance(clusterName, secretsManagerProvider); | ||
secretsManager = NoopSecretsManager.getInstance(secretsManagerProvider, secretsConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we avoid the switch case, instead use something similar to ENTITY_REPOSITORY_MAP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmhh when trying it out it gets a bit ugly actually. We are not initializing all the secret managers just the one being requested by the config, and it would require some further changes on the parent class to allow getting the instances just right.
if it's ok, I'll keep the switch for now
...e/src/test/java/org/openmetadata/service/resources/services/PipelineServiceResourceTest.java
Show resolved
Hide resolved
@@ -18,13 +18,14 @@ | |||
public class NoopSecretsManager extends SecretsManager { | |||
private static NoopSecretsManager instance; | |||
|
|||
private NoopSecretsManager(String clusterPrefix, SecretsManagerProvider secretsManagerProvider) { | |||
super(secretsManagerProvider, clusterPrefix); | |||
private NoopSecretsManager(SecretsManagerProvider secretsManagerProvider, SecretsConfig secretsConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling this as NoopSecretsManager, lets call it as DBSecretsManager and use the fernet key to encrypt/decrypt the passwords.
We also needs to have config of key/value pairs thats optional and can be passed as part of the config
toEncryptObject, | ||
Fernet.isTokenized(newFieldValue) | ||
? newFieldValue | ||
: store ? fernet.encrypt(newFieldValue) : newFieldValue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to remove fernet.encrypt from here and make it into DBSecretesManager and except that logic to live inside of these secret managers
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
openmetadata-ui/src/main/resources/ui/src/mocks/IngestionListTable.mock.ts
Outdated
Show resolved
Hide resolved
Quality Gate passed for 'open-metadata-ui'Kudos, no new issues were introduced! 0 New issues |
Quality Gate passed for 'open-metadata-ingestion'Kudos, no new issues were introduced! 0 New issues |
@@ -140,7 +140,7 @@ services: | |||
FERNET_KEY: ${FERNET_KEY:-jJ/9sz0g0OHxsfxOoSfdFdmk3ysNmPRnH3TUAbz3IHA=} | |||
|
|||
#secretsManagerConfiguration | |||
SECRET_MANAGER: ${SECRET_MANAGER:-noop} | |||
SECRET_MANAGER: ${SECRET_MANAGER:-db} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone exported SECRET_MANAGER as noop they will run into issues, worth noting this as backward incompatible change and capture it in our upgrade notes
Describe your changes:
Fixes #14340
Fixes #13849
Also takes care of this Collate's issue https://github.com/open-metadata/openmetadata-collate/issues/227
prefix
andtags
when creating the secret in AWSI'll do the docs in a followup PR
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>