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

op cli + 1password connect 141 vault limit on create token #74

Open
hortonew opened this issue Oct 3, 2023 · 1 comment
Open

op cli + 1password connect 141 vault limit on create token #74

hortonew opened this issue Oct 3, 2023 · 1 comment

Comments

@hortonew
Copy link

hortonew commented Oct 3, 2023

Works:
op connect token create "token_with_141_vaults" --server "your_server_id" --expires-in 1h --vault vault1 --vault vault2 ... --vault vault141

Doesn't work:
op connect token create "token_with_142_vaults" --server "your_server_id" --expires-in 1h --vault vault1 --vault vault2 ... --vault vault142

Error

[ERROR] 2023/10/03 10:58:37 failed to RegisterToken: "Validation: (400) (Bad Request), The structure of request was invalid.

Tested on versions of op cli from v2.6.0 through the latest v2.21.0 and it's been a problem consistently for the past year.

@edif2008
Copy link
Member

edif2008 commented Feb 1, 2024

Hey @hortonew,

What you're encountering here is that your request would generate a Connect token that is over the allowed maximum size. In general a Connect token can have permissions up to 100 vaults. This limit is in place to ensure that the size of the token isn't too large, specifically 8KB. This is based on the recommended size of JWT tokens:

Note that if you send JWT tokens through HTTP headers, you should try to prevent them from getting too big. Some servers don't accept more than 8 KB in headers.

With 141 vaults or more, your Connect token would be over 8KB, which you would no longer be able to use when interacting with Connect due to it being too large.

An alternative solution to this is to create separate tokens that access subsets of the vaults the Connect server can access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants