feat: use GetByIDS
for secret fetching
#17
Merged
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.
Problem Statement
Using the
Secrets().Get()
method makes individual requests to the Bitwarden API for each secret. This increases load on the server and makes it more likely that rate-limiting occurs.Related Issue
Fixes #...
Proposed Changes
Use the
Secrets.GetByIDS()
method, which accepts multiple secret IDs and can return the secret data for multiple secrets with a single API request, and therefore reduce the potential for rate-limiting for the Bitwarden server.This implementation adds a
secrets-by-ids
endpoint to avoid introducing any breaking changes to the operator. Ideally, usingSecrets().GetByIDS()
could become the default for the/rest/api/1/secrets
or/rest/api/1/secret
endpoint, but this would likely break the current usage of the operator.Checklist
git commit --signoff
make test
make reviewable