Documentation
¶
Overview ¶
Package api provides the configuration and implementation for exchanging a delegated auth proof for an API key
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIKey ¶
func GetAPIKey(cfg pkgconfigmodel.Reader, delegatedAuthProof string, targetSite string) (*string, error)
GetAPIKey performs the cloud auth exchange and returns an API key. The delegatedAuthProof contains the signed AWS request which includes the org id.
targetSite, if non-empty, is the site/domain to exchange the proof against (e.g. an `additional_endpoints` domain for a dual-shipping DELA(...) instance targeting a different site than the agent's primary `dd_url`/`site`). If empty, falls back to the agent's configured primary site - the original, single-org behavior.
Types ¶
type TokenAttributes ¶
type TokenAttributes struct {
APIKey string `json:"api_key"`
}
TokenAttributes represents the attributes field containing the API key
type TokenData ¶
type TokenData struct {
Attributes TokenAttributes `json:"attributes"`
}
TokenData represents the data field in the token response
type TokenResponse ¶
type TokenResponse struct {
Data TokenData `json:"data"`
}
TokenResponse represents the response from the intake-key endpoint