(bedrockagentcore): ApiKeyCredentialLocation.header cannot omit the credential prefix
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design, cloud
Research direction
Start at ApiKeyCredentialLocation.header() and the GatewayCredentialProvider.fromApiKeyIdentityArn() usage shown in the reproduction. Check the generated CloudFormation template for an empty credentialPrefix; the issue says the property should be omitted so a custom header can send a bare token. Confirm the resulting template no longer includes CredentialPrefix.
Written by the indexing model from the issue text.
Description
Describe the bug
ApiKeyCredentialLocation.header() cannot send an API key without a prefix. An omitted credentialPrefix falls back to 'Bearer ', and '' is rendered as-is, which CloudFormation rejects (CredentialPrefix has minLength: 1).
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
A way to send a bare token in a custom header (for example PRIVATE-TOKEN: <token>), with CredentialPrefix omitted from the template.
Current Behavior
Either a Bearer prefix is always sent, or the deployment fails on the empty string.
Reproduction Steps
agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
providerArn,
secretArn,
credentialLocation: agentcore.ApiKeyCredentialLocation.header({
credentialParameterName: 'PRIVATE-TOKEN',
credentialPrefix: '',
}),
});
Possible Solution
Treat '' as "no prefix" and omit the property. Workaround today: addPropertyDeletionOverride on the target.
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.276.0
AWS CDK CLI version
n/a
Node.js Version
24
OS
n/a
Language
TypeScript
Language Version
No response
Other information
No response
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 4.7k
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 98
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-cdk
-
@aws-cdk/aws-iam needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
aws-cdk-lib needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
(stepfunctions-tasks): EmrCreateCluster rejects JsonPath values for ebsRootVolumeSize, ebsRootVolumeIops, ebsRootVolumeThroughput and releaseLabelPossibly taken @haeganm claimed this 7 days ago. Open@aws-cdk/aws-stepfunctions-tasks bug effort/medium p2 potential-regression
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
aws/aws-cdk#39646 · 1 comment ·
Maintainers usually reply within 1 day
-
RDS: Add missing instance-engine versionPossibly taken @daanvzijl claimed this 7 days ago. Open@aws-cdk/aws-rds feature-request p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws/aws-cdk#39639 · 1 comment ·
Maintainers usually reply within 1 day
-
(synthetics): auto delete underlying resources handler returns a misspelled PhysicalResourceId on CreatePossibly taken @blacksoxx claimed this 7 days ago. Open@aws-cdk/aws-synthetics bug effort/small p2
Difficulty 1/5 Under an hour Newbie friendliness 87/100
aws/aws-cdk#39629 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
grep and find tools search inside VCS directories (.git, .svn, .hg, .jj)Possibly taken @acmerfight claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
earendil-works/pi#12084 ·
Maintainers usually reply within 1 day
-
comp/desktop P3 type/feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#154285 ·
Maintainers usually reply within 1 day
-
agent-reported bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nightly-labs/openbot#8154 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jdx/mise-action#730 ·
Maintainers usually reply within 1 day
-
area:cards enhancement hand-tail ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
fil-donadoni/tolaria#9275 ·
Maintainers usually reply within 1 day