Review request: Namespace dynamic secret, Agent Vault TLS services, and CLI HTTP/2 (#9828, #9829, cli#519)

Hi Infisical Team,

I’d like to request a review of three related PRs.

  1. Infisical/infisical#9828: Namespace dynamic secret. Each lease issues a short-lived Namespace client certificate, signed in with the organization’s OIDC issuer (or a provisioner token as a fallback). It stands on its own and can merge first.
  2. Infisical/infisical#9829: Agent Vault TLS services, with a client certificate stored on the service or leased from a dynamic secret. It builds on #9828, so until that merges, it also shows the Namespace commit.
  3. Infisical/cli #519: the proxy side, with opt-in HTTP/2 for listed hosts and TLS services through agent-vault connect. It depends on #9829’s tls service type.

Suggested order: #9828, then #9829, then cli#519.

Testing:

  1. Unit tests, tsc, oxlint, and oxfmt pass on each commit.
  2. The migrations ran up, down, and up again on Postgres 14.
  3. The full API e2e suite (make test-api-e2e) passed on the TLS branch before the rebase onto current main.
  4. Each PR has a short video.

Greptile’s findings are addressed, apart from these on #9829, which need changes outside these PRs:

  1. The dynamic secret picker uses the existing list endpoint, which needs Read Root Credentials, while saving a reference needs only Lease. No list endpoint that needs only Lease exists today.
  2. Deleting the Secrets Management project that owns a dynamic secret doesn’t revoke its leases for any provider. Agent Vault leases still expire at their TTL.
  3. A lease being created while an admin switches a dynamic secret’s auth method can be closed without revoking it. Closing that race needs a lock in the shared dynamic secret update path.
  4. Revoking a just-created lease is delayed by 60 seconds, because the shared lease queue worker reads from the replica.

I’m happy to change any of these if you’d prefer a different approach.

Thanks, Anshul

@Sheen_Capadngan @saif

Adding one more to this: feat(dynamic-secrets): add Cloudflare Access service token dynamic secret by anshulnoori · Pull Request #9837 · Infisical/infisical · GitHub

It’s a Cloudflare Access dynamic secret. Each lease gets a service token that expires with it, tagged so a single Access policy covers all of them.