-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added support for dbutils.secrets
#132
Conversation
dbutils.secrets
dbutils.secrets
dbutils.secrets
dbutils.secrets
// < "error_code" : "BAD_REQUEST", | ||
// < "message" : "This operation is not allowed outside databricks notebooks." | ||
// < } | ||
// ================= Uncomment once enabled ================== |
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.
cc: @mgyucht on this for visibility
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.
Couple comments, otherwise looking great!
databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GetSecretRequest.java
Show resolved
Hide resolved
@EnvContext("workspace") | ||
@ExtendWith(EnvTest.class) | ||
public class SecretsIT { | ||
// Most likely secrets/get isn't enabled |
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.
Let's leave the rest of the test uncommented. For example, we should be able to list the scope and see the newly created secret. We can simply comment out the parts from getSecret() onwards.
databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/SecretsExtTest.java
Outdated
Show resolved
Hide resolved
databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/SecretsExtTest.java
Outdated
Show resolved
Hide resolved
databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/SecretsExtTest.java
Outdated
Show resolved
Hide resolved
// String responseValue = secretsExt.get(scope, key); | ||
// assertEquals(value, responseValue); | ||
// } finally { | ||
// secretsExt.deleteSecret(scope, key); |
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.
Note: technically you need two nested try-finally blocks, as you can only delete the secret after it is created.
It is totally fine for this test to nest these. However, if you want to simplify this a bit, you can define new classes that extend Autocloseable
that call secretsExt.deleteSecret
or secretsExt.deleteScope
, respectively, in their close methods.
databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GetSecretResponse.java
Show resolved
Hide resolved
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.
LGTM
* Added support for `dbutils.secrets` ([#132](#132)). * Added retry in `w.clusters().ensureClusterIsRunning(id)` when cluster is simultaneously started by two different processes ([#134](#134)). * Set necessary headers when authenticating via Azure CLI ([#136](#136)). New Services: * Added `workspaceClient.artifactAllowlists()` service. * Added `workspaceClient.securableTags()` service. * Added `workspaceClient.subentityTags()` service. * Added `com.databricks.sdk.service.catalog.ArtifactAllowlistInfo` class. * Added `com.databricks.sdk.service.catalog.ArtifactMatcher` class. * Added `com.databricks.sdk.service.catalog.ArtifactType` class. * Added `com.databricks.sdk.service.catalog.GetArtifactAllowlistRequest` class. * Added `com.databricks.sdk.service.catalog.ListSecurableTagsRequest` class. * Added `com.databricks.sdk.service.catalog.ListSecurableType` class. * Added `com.databricks.sdk.service.catalog.ListSubentityTagsRequest` class. * Added `com.databricks.sdk.service.catalog.MatchType` class. * Added `com.databricks.sdk.service.catalog.SetArtifactAllowlist` class. * Added `com.databricks.sdk.service.catalog.TagChanges` class. * Added `com.databricks.sdk.service.catalog.TagKeyValuePair` class. * Added `com.databricks.sdk.service.catalog.TagSecurable` class. * Added `com.databricks.sdk.service.catalog.TagSecurableAssignment` class. * Added `com.databricks.sdk.service.catalog.TagSecurableAssignmentsList` class. * Added `com.databricks.sdk.service.catalog.TagSubentity` class. * Added `com.databricks.sdk.service.catalog.TagSubentityAssignmentsList` class. * Added `com.databricks.sdk.service.catalog.TagsSubentityAssignment` class. * Added `com.databricks.sdk.service.catalog.UpdateSecurableType` class. * Added `com.databricks.sdk.service.catalog.UpdateTags` class. New APIs: * Added `deleteRuns()` method for `workspaceClient.experiments()` service. * Added `restoreRuns()` method for `workspaceClient.experiments()` service. * Added `com.databricks.sdk.service.ml.DeleteRuns` class. * Added `com.databricks.sdk.service.ml.DeleteRunsResponse` class. * Added `com.databricks.sdk.service.ml.RestoreRuns` class. * Added `com.databricks.sdk.service.ml.RestoreRunsResponse` class. * Added `getSecret()` method for `workspaceClient.secrets()` service. * Added `com.databricks.sdk.service.workspace.GetSecretRequest` class. * Added `com.databricks.sdk.service.workspace.GetSecretResponse` class. API Renames: * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Renamed `com.databricks.sdk.service.catalog.EffectiveAutoMaintenanceFlag` class to `com.databricks.sdk.service.catalog.EffectivePredictiveOptimizationFlag` class. * Renamed `com.databricks.sdk.service.catalog.EffectiveAutoMaintenanceFlagInheritedFromType` class to `com.databricks.sdk.service.catalog.EffectivePredictiveOptimizationFlagInheritedFromType`. * Renamed `com.databricks.sdk.service.catalog.EnableAutoMaintenance` class to `com.databricks.sdk.service.catalog.EnablePredictiveOptimization`. * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.SchemaInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.SchemaInfo`. * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.TableInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.TableInfo`. OpenAPI SHA: beff621d7b3e1d59244e2e34fc53a496f310e130, Date: 2023-08-17
* Added support for `dbutils.secrets` ([#132](#132)). * Added retry in `w.clusters().ensureClusterIsRunning(id)` when cluster is simultaneously started by two different processes ([#134](#134)). * Set necessary headers when authenticating via Azure CLI ([#136](#136)). New Services: * Added `workspaceClient.artifactAllowlists()` service. * Added `workspaceClient.securableTags()` service. * Added `workspaceClient.subentityTags()` service. * Added `com.databricks.sdk.service.catalog.ArtifactAllowlistInfo` class. * Added `com.databricks.sdk.service.catalog.ArtifactMatcher` class. * Added `com.databricks.sdk.service.catalog.ArtifactType` class. * Added `com.databricks.sdk.service.catalog.GetArtifactAllowlistRequest` class. * Added `com.databricks.sdk.service.catalog.ListSecurableTagsRequest` class. * Added `com.databricks.sdk.service.catalog.ListSecurableType` class. * Added `com.databricks.sdk.service.catalog.ListSubentityTagsRequest` class. * Added `com.databricks.sdk.service.catalog.MatchType` class. * Added `com.databricks.sdk.service.catalog.SetArtifactAllowlist` class. * Added `com.databricks.sdk.service.catalog.TagChanges` class. * Added `com.databricks.sdk.service.catalog.TagKeyValuePair` class. * Added `com.databricks.sdk.service.catalog.TagSecurable` class. * Added `com.databricks.sdk.service.catalog.TagSecurableAssignment` class. * Added `com.databricks.sdk.service.catalog.TagSecurableAssignmentsList` class. * Added `com.databricks.sdk.service.catalog.TagSubentity` class. * Added `com.databricks.sdk.service.catalog.TagSubentityAssignmentsList` class. * Added `com.databricks.sdk.service.catalog.TagsSubentityAssignment` class. * Added `com.databricks.sdk.service.catalog.UpdateSecurableType` class. * Added `com.databricks.sdk.service.catalog.UpdateTags` class. New APIs: * Added `deleteRuns()` method for `workspaceClient.experiments()` service. * Added `restoreRuns()` method for `workspaceClient.experiments()` service. * Added `com.databricks.sdk.service.ml.DeleteRuns` class. * Added `com.databricks.sdk.service.ml.DeleteRunsResponse` class. * Added `com.databricks.sdk.service.ml.RestoreRuns` class. * Added `com.databricks.sdk.service.ml.RestoreRunsResponse` class. * Added `getSecret()` method for `workspaceClient.secrets()` service. * Added `com.databricks.sdk.service.workspace.GetSecretRequest` class. * Added `com.databricks.sdk.service.workspace.GetSecretResponse` class. API Renames: * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Renamed `com.databricks.sdk.service.catalog.EffectiveAutoMaintenanceFlag` class to `com.databricks.sdk.service.catalog.EffectivePredictiveOptimizationFlag` class. * Renamed `com.databricks.sdk.service.catalog.EffectiveAutoMaintenanceFlagInheritedFromType` class to `com.databricks.sdk.service.catalog.EffectivePredictiveOptimizationFlagInheritedFromType`. * Renamed `com.databricks.sdk.service.catalog.EnableAutoMaintenance` class to `com.databricks.sdk.service.catalog.EnablePredictiveOptimization`. * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.SchemaInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.SchemaInfo`. * Renamed `effectiveAutoMaintenanceFlag` field to `effectivePredictiveOptimizationFlag` field for `com.databricks.sdk.service.catalog.TableInfo`. * Renamed `enableAutoMaintenance` field to `enablePredictiveOptimization` field for `com.databricks.sdk.service.catalog.TableInfo`. OpenAPI SHA: beff621d7b3e1d59244e2e34fc53a496f310e130, Date: 2023-08-17
Changes
Add support for dbutils.secrets. New open api spec has been created to support secrets/get
TODO:
Tests
Unit and Integration tests