diff --git a/example/main.go b/example/main.go index 034a1c3..0ab84fc 100644 --- a/example/main.go +++ b/example/main.go @@ -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) @@ -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" diff --git a/internal/release/RELEASE-NOTES b/internal/release/RELEASE-NOTES index 0ead802..5fd1b75 100644 --- a/internal/release/RELEASE-NOTES +++ b/internal/release/RELEASE-NOTES @@ -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. diff --git a/secrets.go b/secrets.go index 6f6ae22..ab671c6 100644 --- a/secrets.go +++ b/secrets.go @@ -39,22 +39,3 @@ func (s SecretsSource) Resolve(ctx context.Context, secretReference string) (str } return result, nil } - -// Validate the secret reference to ensure there are no syntax errors. -func ValidateSecretReference(ctx context.Context, secretReference string) error { - core, err := internal.GetSharedCore() - if err != nil { - return err - } - - _, err = core.Invoke(ctx, internal.InvokeConfig{ - Invocation: internal.Invocation{ - Parameters: internal.Parameters{ - MethodName: "ValidateSecretReference", - SerializedParams: map[string]interface{}{"secret_reference": secretReference}, - }, - }, - }) - - return err -}