external-secrets / bitwarden-sdk-server

This repository contains a simple REST wrapper for the Bitwarden Rust SDK
https://external-secrets.io
Apache License 2.0
7 stars 1 forks source link

feat: use `GetByIDS` for secret fetching #17

Closed tangowithfoxtrot closed 3 weeks ago

tangowithfoxtrot commented 3 weeks ago

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, using Secrets().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