feat(catalog): add 13 service templates and fix four incorrect ones - #361
Conversation
|
💬 Discussion in Slack: #pr-review-agent-vault-361-feat-catalog-add-14-service-templates-and-fix-four-inc Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| internal/catalog/catalog.go | Adds the new templates and catalog fields, including custom PagerDuty headers and substitution-based Telegram and Google Workspace authentication. |
| internal/catalog/catalog_test.go | Validates template conversion, identifiers, substitution keys, and representative request-rewrite and host-precedence behavior. |
| web/src/pages/vault/ServicesTab.tsx | Seeds custom headers and substitutions from selected presets while resetting prior form state before each selection. |
Reviews (1): Last reviewed commit: "Add 14 service templates and fix four in..." | Re-trigger Greptile
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
Adds cohere, deepseek, discord, fireworks, gemini, gitlab, groq, mistral, openrouter, perplexity, telegram, together and xai. Every host and auth header was checked against the vendor's current docs. Fixes four existing templates that could not have worked. linear, supabase and pagerduty were all bearer, but none of those services accept "Authorization: Bearer <key>": linear wants the bare token, supabase an apikey header, and pagerduty "Authorization: Token token=<key>", which an api-key prefix cannot express because Resolve concatenates it verbatim. stripe's suggested key becomes STRIPE_SECRET_KEY. Template gains Headers to seed custom auth and Substitutions to seed the substitution editor, so a preset can broker a credential that does not travel in a constructed header. telegram is the only such template: its token is a URL path segment, so it pairs passthrough auth with a path substitution. Selecting a custom preset now also produces a submittable form, where before applyPreset set the auth type but left the header rows blank. The catalog CLI table now renders "passthrough + substitution" so telegram does not read as injecting nothing. google-workspace is deliberately left out. It spans several googleapis.com host and path pairs and a Service carries a single host, so the only expressible form is the *.googleapis.com wildcard, which allowlists egress to every googleapis subdomain while the name promises Gmail, Calendar, Sheets and Drive.
8f4e559 to
932093a
Compare
Summary
Brings the built-in service catalog closer to Infisical's proxied-service templates. Four files:
internal/catalog/catalog.go,internal/catalog/catalog_test.go(new),cmd/catalog.go,web/src/pages/vault/ServicesTab.tsx.New templates (13)
Every host and auth header checked against the vendor's current docs.
cohereapi.cohere.comdeepseekapi.deepseek.comdiscorddiscord.com/api/*Authorization: Botfireworksapi.fireworks.aigeminigenerativelanguage.googleapis.comx-goog-api-keygitlabgitlab.com/api/*PRIVATE-TOKENgroqapi.groq.commistralapi.mistral.aiopenrouteropenrouter.aiperplexityapi.perplexity.aitelegramapi.telegram.orgpathsubstitutiontogetherapi.together.aixaiapi.x.aiFixed templates (4)
The first three were
bearer, but none of those services acceptAuthorization: Bearer <key>.linearbearerAuthorization, no prefix (Linear wants the bare token)supabasebearerapikeypagerdutybearerToken token={{ PAGERDUTY_TOKEN }}stripeSTRIPE_KEYSTRIPE_SECRET_KEYpagerdutyneedscustombecause an api-key prefix cannot produceToken token=<key>:Auth.Resolveconcatenates the prefix verbatim, with no room for the trailing=.Heads up on
stripe: a vault already holding aSTRIPE_KEYcredential will stop getting the "unused credential, add Stripe as a service?" suggestion, since that matches onsuggested_credential_key.catalog.Templategains two fieldsHeadersseeds custom auth,Substitutionsseeds the substitution editor independent of auth type. This lets a preset broker a credential that does not travel in a constructed header.telegramis the only such template: its token is a URL path segment (/bot<token>/sendMessage).Side effect worth noting: selecting a
custompreset now produces a submittable form. PreviouslyapplyPresetset the auth type but left the header rows blank, socanSubmitalways failed.agent-vault catalogoutputRenders
passthrough + substitutionwhen a template carries one. Without it,telegramshowed as barepassthrough, which reads as "no credential involved" and would lead someone configuring by hand to omit the substitution and get no injection.Type of change
Test plan
New
catalog_test.goruns every template through the same mappingapplyPresetuses and validates the result, so a preset that would produce an unsubmittable form or a rejected proposal fails the build. One test covers Telegram's<id>:<token>surviving path escaping.Manually verified against a local instance:
All 35 templates accepted by the real HTTP ingest via
vault service add --fileReal proxy traffic against a loopback echo server confirmed what upstreams receive:
Token token=...,Bot <token>, bareAuthorization: lin_api_...,apikey: ...,PRIVATE-TOKEN: ..., and Telegram's rewritten pathBrowser click-through of every changed preset, plus the credential-suggestion deep link (
?preset=openrouter)Existing tests pass (
make test)Added/updated tests for new behavior
Manual testing (describe below)
Security checklist