improvement(agent-proxy): optional basic auth password + docs link on proxied service sheet - #7296
Conversation
… proxied service sheet
|
💬 Discussion in Slack: #pr-review-infisical-7296-improvement-agent-proxy-optional-basic-auth-password-do Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| backend/src/ee/services/proxied-service/proxied-service-schemas.ts | Relaxes basic-auth credential validation: replaces the symmetric username/password count check with a one-directional guard (password without username is rejected; username without password is now allowed). Logic is correct and narrowly scoped. |
| backend/src/ee/services/proxied-service/proxied-service-schemas.test.ts | Adds four focused tests for the relaxed basic-auth validation: username-only (accept), username+password (accept), password-only (reject with "requires a username"), and two usernames (reject with "at most one"). Good coverage of the changed condition. |
| frontend/src/components/proxied-services/forms/schema.ts | Makes passwordSecretKey optional in basicAuthSchema and removes the superRefine check that previously rejected a missing password. The empty-string fallback in toServiceDefaults and the truthy-guard in toCredentials both handle the "" / undefined edge case correctly. |
| frontend/src/components/proxied-services/forms/ProxiedServiceForm.tsx | Adds "(optional)" label to the Password field using text-muted Tailwind class. The toCredentials truthy-check already handled the empty-password case and remains correct. |
| frontend/src/components/proxied-services/CreateProxiedServiceModal.tsx | Adds a DocumentationLinkBadge linking to the agent-proxy quickstart. QUICKSTART_DOCS_URL is duplicated here and in EditProxiedServiceModal.tsx rather than shared. |
| frontend/src/components/proxied-services/EditProxiedServiceModal.tsx | Same DocumentationLinkBadge addition as Create modal. Shares the same duplicated QUICKSTART_DOCS_URL constant. |
| docs/documentation/platform/agent-proxy/proxied-services.mdx | Updates the basic-auth table row and adds a clarifying sentence that the password is optional and that omitting it yields base64(username:). Accurate and consistent with the code change. |
Reviews (1): Last reviewed commit: "improvement(agent-proxy): optional basic..." | Re-trigger Greptile
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Context
Feedback from trying out the agent proxy: Basic Auth on a proxied service was forcing both a username and a password, but plenty of APIs authenticate with just a username and an empty password (Ashby, and the common "API key as username" pattern), producing
Authorization: Basic base64(username:). Agent Vault already allows this, so this closes a parity gap. Also adds a documentation link to the create/edit proxied service sheet, which previously had no pointer to the docs anywhere.Backend: credential validation required the username and password counts to match (
Basic auth requires both a username and a password credential). Now the password is optional and only a lone password with no username is rejected. The "at most one of each" and "can't combine basic auth with other header rewrites" rules are unchanged.Frontend: the Password field on the Basic Auth tab is marked
(optional)and is no longer required by the form schema (passwordSecretKeyis now optional on the object schema, not just skipped in the refine, so a username-only create doesn't silently fail Zod validation). Added aDocumentationbadge next to the title on both the create and edit sheets, linking to the agent proxy quickstart.Docs: the basic auth row on the proxied services page notes the password is optional and that omitting it yields
base64(username:).CLI: no code change needed. The proxy already emits
base64(username:)when the password credential is absent; added a test there to lock it in. Companion PR: Infisical/cli#316Screenshots
Steps to verify the change
Created a proxied service with only a Username credential (no password) pointing at a local echo server, connected an agent through the proxy, and confirmed the injected header was
Authorization: Basic base64("<secret>:")(empty password segment). Before this change the create call was rejected with "Basic auth requires both a username and a password credential".Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).