Skip to content
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

Resolving secrets doesn't support field metadata attributes #87

Open
sgarner opened this issue Sep 2, 2024 · 1 comment
Open

Resolving secrets doesn't support field metadata attributes #87

sgarner opened this issue Sep 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sgarner
Copy link

sgarner commented Sep 2, 2024

Scenario & Reproduction Steps

According to the Secret Reference Syntax, parameters can be used to obtain specific attributes of a secret. This is necessary for resolving an OTP field to an OTP code.

In the SDK, this format is not supported. Adding ?attribute=otp to a secret reference produces an error when calling client.secrets.resolve().

Actual Behavior

This error occurs:

error resolving secret reference: secret reference has invalid format - must be "op://<vault>/<item>/[section/]field"

The error goes away when ?attribute=otp is removed from the end of the secret reference.

But then the OTP field resolves to another reference URL like otpauth://totp/<email>?secret=<secret>&issuer=<issuer>, which is not useful.

Expected Behavior

Secret references with attributes, like op://<vault>/<item>/[section/]field?attribute=<attribute>, should work the same way as they do in the 1Password CLI commands op read and op run.

SDK version

0.1.1

Additional information

No response

@sgarner sgarner added the bug Something isn't working label Sep 2, 2024
@AndyTitu
Copy link
Contributor

AndyTitu commented Sep 2, 2024

Hey @sgarner, thanks for opening this issue! We are aware of this limitation/inconsistency. We are working on improving this!

@Marton6 Marton6 added enhancement New feature or request and removed bug Something isn't working labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants