fix: correct destination auth config and add --include-destination-auth flag #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
auth_methodkey, but the API expectsauth_type(string) andauth(credentials map) as separate fields insidedestination.config. This affected all auth types (OAuth2, AWS Signature, GCP Service Account).--include-destination-authflag toconnection get: The connections API does not supportinclude=config.auth, so this flag fetches the destination directly viaGET /destinations/{id}?include=config.authand merges the enriched config back into the connection response.connection get --include-destination-authafter creation, asserting specific credential values for all four auth types.Details
Auth config fix (
buildDestinationConfig)The
buildDestinationConfig()function was wrapping all auth fields underconfig.auth_method, but the API expects:config.auth_type— the auth type string (e.g.AWS_SIGNATURE)config.auth— a map of the credential values--include-destination-authflagThe
include=config.authquery parameter is only supported onGET /destinations/{id}andGET /sources/{id}(confirmed via OpenAPI spec). It is not supported on any/connectionsendpoint. The CLI works around this by making a supplementaryGET /destinations/{id}?include=config.authcall when the flag is set.Note: POST /connections response redaction
When creating a connection with inline destination auth,
POST /connectionscorrectly stores the credentials but redacts them in the response (returnsauth: {}). A standalonePOST /destinationsreturns them in full. This is a separate API inconsistency — a repro script (test/repro-connection-auth-bug.sh, not committed) was used to verify this.Test plan
go test ./pkg/...)TestConnectionOAuth2AWSAuthentication): OAuth2 Client Credentials, OAuth2 Authorization Code, AWS Signature, GCP Service Accountauth_typein the create response, then doesconnection get --include-destination-authto verify credentials were storedhookdeck connection get <id> --include-destination-auth --output jsonreturns full auth credentialsMade with Cursor