Conversation
dbutils.secretsdbutils.secrets
dbutils.secretsdbutils.secrets
tanmay-db
commented
Aug 14, 2023
| // < "error_code" : "BAD_REQUEST", | ||
| // < "message" : "This operation is not allowed outside databricks notebooks." | ||
| // < } | ||
| // ================= Uncomment once enabled ================== |
mgyucht
reviewed
Aug 14, 2023
Contributor
mgyucht
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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
mgyucht
added a commit
that referenced
this pull request
Aug 18, 2023
* 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
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 18, 2023
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add support for dbutils.secrets. New open api spec has been created to support secrets/get
TODO:
Tests
Unit and Integration tests