[python] honor API key prefix aliases#24307
Open
tamird wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@wing328 @cbornet @tomplus @krjakbrjak @fa0311 Could you take a look? This is a small Python generator fix for x-auth-id-alias prefix lookup. |
46652ad to
55690d1
Compare
x-auth-id-alias lets a generated auth setting use one public key while looking up configuration under an alternate identifier. The Python generator already falls back to the alias for api_key, but not for api_key_prefix. A caller that sets only the aliased prefix therefore sends an unprefixed credential. Make prefix lookup use the same identifier-first alias fallback as key lookup. Cover the existing x-auth-id-alias fixture so later template changes preserve both lookups and the generated alias.
55690d1 to
2edfca1
Compare
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.
x-auth-id-alias lets a generated auth setting use one public key while
looking up configuration under an alternate identifier. The Python
generator already falls back to the alias for api_key, but not for
api_key_prefix. A caller that sets only the aliased prefix therefore
sends an unprefixed credential.
Make prefix lookup use the same identifier-first, alias-fallback order
as key lookup. Regenerate the checked-in Python clients so the existing
sample-golden checks cover the template output.