Support Creators API credential v3.x#51
Merged
Merged
Conversation
Contributor
Author
|
@spiegel-im-spiegel Adding default support for v3 generated credentials. This defaults to v3 with options for auth'ing with v2. Amazon changing things at a break-neck pace right now. |
Member
|
Thanks for the update and for moving quickly on the v3 credential support work. Merged now — really appreciate the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Extends the client so v3.1 / v3.2 / v3.3 credentials work end-to-end: correct Login with Amazon token URLs, HTTP Basic client authentication, scope
creatorsapi::default, and catalogAuthorization: Bearer <token>without aVersionsuffix. v2.1 / v2.2 / v2.3 (Cognito) behavior is unchanged and remains available viaWithCredentialVersionand the existing constants.Motivation
New Associates Central credential sets use the v3.x path. The library previously only mapped 2.x to Cognito; 3.x strings were rejected by
WithCredentialVersion, and defaults assumed Cognito, so v3 credentials failed token exchange or API auth.What changed
marketplace.go: AddedCredentialVersionNAv3(3.1),CredentialVersionEUv3(3.2),CredentialVersionFEv3(3.3).versionMapnow defaults each built-in locale to the matching v3 code (same NA/EU/FE grouping as before).server.go:authEndpointMapentries for LwA (api.amazon.com,api.amazon.co.uk,api.amazon.co.jp),isLWACredentialVersion, andCreateClientwireslwaFlowinto the token manager.auth.go:tokenManagerbranches: Cognito (formclient_id/client_secret, scopecreatorsapi/default) vs LwA (Basic auth, scopecreatorsapi::default).authorizationHeaderdrops, Version …for LwA.client.go: StoreslwaFlowand passes it intoauthorizationHeaderfor catalog requests.TestClientLegacyCognitoCredentialVersionpins 2.x Cognito +Versionbehavior.WithCredentialVersion("2.1"|…).Migration / breaking note
Default credential version per marketplace is now v3.x, matching typical new credentials. Integrations still on Cognito-only 2.x credentials must set e.g.
WithCredentialVersion(paapi5.CredentialVersionNA)(or"2.2"/"2.3") onCreateClient.How to verify
go test ./... golangci-lint run