This document covers configuration for the CAVE IDP proxy endpoints (/v0/cave*) and Idp::Client.
Authenticated vets-api routes exposed for CAVE are:
POST /v0/cave: submit a base64-encoded PDF and filename for intake.GET /v0/cave/:id/status: retrieve the current processing state for a submitted document.GET /v0/cave/:id/output: retrieve extracted output for a processed document.type=formis supported; omittedtypedefaults toartifact.GET /v0/cave/:id/download?kvpid=...: download the JSON payload for a specific extracted KVP record.POST /v0/cave/:id/update?kvpid=...: replace the JSON payload for a specific extracted KVP record.POST /v0/cave/diff: compare two JSON objects locally and return field-level differences. This route is handled invets-apiand is not proxied upstream.
API reference docs:
- Swagger 2.0 route reference:
GET /v0/apidocs - OpenAPI 3.0 route reference:
GET /v0/openapiwhen the generatedpublic/openapi.jsonartifact is present
IDP settings live under cave.idp:
cave:
idp:
base_url: ~
connect_url: ~
timeout: ~
mock: true
hmac:
key_id: ~
secret: ~base_url: Logical base URL for the IDP API. This remains the request URL and provides the host used forHost, TLS SNI, and certificate validation.connect_url: Optional alternate network destination used when the client must reach IDP through a different hostname, such as a VPCE endpoint. Only the hostname is used for the TCP connection override; the request path still comes frombase_url.timeout: Request timeout in seconds.mock: Whentrue,Idp.clientusesIdp::MockClient(outside production).hmac.key_id: Optional key identifier sent asX-IDP-Key-Id.hmac.secret: Shared secret used to sign outbound IDP requests.
Idp::Client and Idp.client use the following env vars:
bio__IDP_API_BASE_URL: Logical IDP API base URL.bio__IDP_API_CONNECT_URL: Optional network connect URL for VPCE/private API access.bio__IDP_API_TIMEOUT: Timeout in seconds.IDP_USE_LIVE: If present, forces live client outside production.bio__IDP_HMAC_KEY_ID: Optional HMAC key identifier for outbound signed requests.bio__IDP_HMAC_SECRET: HMAC shared secret for outbound signed requests.
For Idp::Client config:
- Constructor args (
base_url,connect_url,timeout,hmac_key_id,hmac_secret) Settings.cave.idp.base_url/Settings.cave.idp.connect_url/Settings.cave.idp.timeout/Settings.cave.idp.hmac.*bio__IDP_API_BASE_URL/bio__IDP_API_CONNECT_URL/bio__IDP_API_TIMEOUT/bio__IDP_HMAC_*- Default timeout of
15
Outbound identity/signature behavior:
Idp::Clientalways forwardsX-IDP-User-Idfrom the authenticatedcurrent_user.- When
connect_urlis configured,Idp::Clientkeeps the logicalbase_urlfor the request URL and resolves theconnect_urlhost to an alternate TCP destination, similar tocurl --connect-to. - When
bio__IDP_HMAC_SECRET(orcave.idp.hmac.secret) is configured, requests are signed and include:X-IDP-TimestampX-IDP-Key-Id(when configured)X-IDP-Signature(HMAC SHA-256)
For client type (Idp.client):
- Production: always live (
Idp::Client) IDP_USE_LIVEpresent: liveSettings.cave.idp.mock
true=>Idp::MockClientfalse=>Idp::Client
Use config/settings.local.yml to override local behavior, for example:
cave:
idp:
base_url: https://logical-api.execute-api.us-gov-west-1.amazonaws.com/stg/api/v1/doc
connect_url: https://vpce-connect.execute-api.us-gov-west-1.vpce.amazonaws.com/stg/api/v1/doc
timeout: 15
mock: true
hmac:
key_id: idp-hmac-v1
secret: your-shared-secretTo test the live client in development/test, either set mock: false or set IDP_USE_LIVE=true.
Set environment-specific values in deployment config and parameter store/secrets.
- Vets API deployment config location (private repo):
devops/ansible/deployment/config/vets-api/- Environment templates include
dev,staging, andprodsettings files.
- Add or update these env vars per environment:
bio__IDP_API_BASE_URLbio__IDP_API_CONNECT_URLbio__IDP_API_TIMEOUTbio__IDP_HMAC_KEY_IDbio__IDP_HMAC_SECRET
- Keep production/staging
mock: falseand do not setIDP_USE_LIVEunless intentionally overriding behavior.
- Add/update
bio__IDP_API_BASE_URL,bio__IDP_API_CONNECT_URL,bio__IDP_API_TIMEOUT,bio__IDP_HMAC_KEY_ID, andbio__IDP_HMAC_SECRETin production deployment config. - Confirm runtime settings resolve to the expected values in production pods.
- Verify
/v0/cave*requests can reach the IDP API and time out as expected. - Verify IDP receives
X-IDP-User-Idand HMAC headers on all five routes (intake,status,output,download,update).