Skip to content

feat(ai-proxy*): support resolving secrets from environment variables and secret vaults#13143

Open
mikyll wants to merge 6 commits intoapache:masterfrom
mikyll:issue_13132
Open

feat(ai-proxy*): support resolving secrets from environment variables and secret vaults#13143
mikyll wants to merge 6 commits intoapache:masterfrom
mikyll:issue_13132

Conversation

@mikyll
Copy link
Copy Markdown
Contributor

@mikyll mikyll commented Apr 1, 2026

Description

This PR introduces the possibility to reference a secret in ai-proxy and ai-proxy-multi plugins, from a ENV variable or a Secret Manager service, as documented in APISIX Docs | Terminology | Secret.

This change makes it possible to avoid hard-coding the API keys in ai-proxy* plugin configuration 🙂

The changes include:

  • Calling fetch_secret() in ai-proxy/base.lua to resolve secrets.
  • 2 new test cases
  • documentation updates

Which issue(s) this PR fixes:

Fixes #13132

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first).

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 1, 2026
Copy link
Copy Markdown
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a test case for auth.header + $ENV://.

@Baoyuantop
Copy link
Copy Markdown
Contributor

Hi @mikyll, we've just fixed some CI issues. You can merge the main branch and then run CI again.

Merge master to issue_13132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: As a user, I want to reference a secret in ai-proxy plugin, so that I don't have to write the apikey in plain text in plugin configuration

2 participants