[v2] Add --apn-id global arg for PRM user-agent attribution#10478
Open
elliotsegler wants to merge 1 commit into
Open
[v2] Add --apn-id global arg for PRM user-agent attribution#10478elliotsegler wants to merge 1 commit into
elliotsegler wants to merge 1 commit into
Conversation
Add a new --apn-id global CLI argument that appends an AWS Partner Network identifier to the User-Agent header in the format APN_1.1/<value>$ as required by the PRM onboarding guide. The user provides the full identifier including the type prefix (e.g. pc_PRODUCTCODE for product codes, ra_PARTNERID for referral agents) to support current and future APN ID types. The value is resolved from (highest precedence first): 1. --apn-id CLI flag 2. AWS_APN_ID environment variable 3. apn_id setting in the shared config file profile The handler is registered on the session-initialized event rather than top-level-args-parsed to ensure the profile has been applied to the session before reading config file values. Validation uses a simple character set check (no regex) to avoid any ReDoS concerns: 1-255 ASCII alphanumeric chars plus _ and -. Fixes: aws#10476
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.
Issue #, if available:
Fixes #10476
Description of changes:
Add a new --apn-id global CLI argument that appends an AWS Partner Network identifier to the User-Agent header in the format APN_1.1/$ as required by the PRM onboarding guide (ref: https://docs.aws.amazon.com/PRM/latest/aws-prm-onboarding-guide/user-agent-string.html).
The user provides the full identifier including the type prefix (e.g. pc_PRODUCTCODE for product codes, ra_PARTNERID for referral agents) to support current and future APN ID types.
The value is resolved from (highest precedence first):
The handler is registered on the session-initialized event rather than top-level-args-parsed to ensure the profile has been applied to the session before reading config file values.
Validation uses a simple character set check (no regex) to avoid any ReDoS concerns: 1-255 ASCII alphanumeric chars plus _ and -.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.