Skip to content

Commit

Permalink
Remove secret reference validation
Browse files Browse the repository at this point in the history
  • Loading branch information
hculea committed Oct 9, 2024
1 parent 8ff073f commit dddefbd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
11 changes: 0 additions & 11 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func main() {
item := createAndGetItem(client)
getAndUpdateItem(client, item.VaultID, item.ID)
listVaultsAndItems(client, item.VaultID)
validateSecretReference(item.VaultID, item.ID, "username")
resolveSecretReference(client, item.VaultID, item.ID, "username")
resolveTOTPSecretReference(client, item.VaultID, item.ID, "TOTP_onetimepassword")
deleteItem(client, item.VaultID, item.ID)
Expand Down Expand Up @@ -124,16 +123,6 @@ func resolveTOTPSecretReference(client *onepassword.Client, vaultID, itemID, fie
// [developer-docs.sdk.go.resolve-totp-code]-end
}

func validateSecretReference(vaultID, itemID, fieldID string) {
// [developer-docs.sdk.go.validate-secret-reference]-start
// Validate your secret reference
err := onepassword.ValidateSecretReference(context.Background(), fmt.Sprintf("op://%s/%s/%s", vaultID, itemID, fieldID))
if err != nil {
panic(err)
}
// [developer-docs.sdk.go.validate-secret-reference]-end
}

func createAndGetItem(client *onepassword.Client) onepassword.Item {
// [developer-docs.sdk.go.create-item]-start
sectionID := "extraDetails"
Expand Down
1 change: 0 additions & 1 deletion internal/release/RELEASE-NOTES
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
The v0.1.2 release of the Go SDK brings:
* Support for item tags. You can now create, get, and edit tags within your 1Password items using item CRUD functions.
* Support for fetching one-time password codes using secret references. You can now fetch your TOTP code with the `Secrets.Resolve` function, using a secret reference for the TOTP field in your item. For example: "op://vault/item/field?=attribute=totp"
* Support for validating secret references. You can now check that a secret reference is formatted correctly without having to resolve it or even authenticate, using the 'ValidateSecretReference' function.
19 changes: 0 additions & 19 deletions secrets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dddefbd

Please sign in to comment.