Documentation
¶
Overview ¶
Command authorization is the deployable Lambda entrypoint for the htsget-rs authorization callout interface of the Authorization Service.
It is wiring only: it reads configuration from the environment, constructs a DynamoDB client from the Lambda execution role, and delegates to the existing auth.CalloutHandler in internal/auth. No business logic lives here; the handler logic has exactly one implementation, shared with the CLI's tests.
Environment variables (read once at cold start):
SHARE_RECORDS_TABLE_NAME (required) DynamoDB table holding share records.
CACHE_TTL_CEILING (optional) max-age ceiling as a Go duration, e.g. "1h".
Default 1h. Caps the allow Cache-Control.
CACHE_DENY_TTL (optional) negative-cache max-age as a Go duration,
e.g. "60s". Default 60s.
The source VPC ARN of the requester arrives as the "Htsget-Context-SourceVpcArn" request header. htsget-rs issues the authorization callout as a bare GET with headers only — it never appends a query string — so the header is the real transport. The "sourceVpcArn" query string parameter is still accepted as a fallback so that out-of-band probes (the CLI's validate command) and manual curl testing keep working.
The handler emits a Cache-Control header computed from the matched shares' remaining lifetimes; that value is copied onto the proxy response.