-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
When using the SageMaker SDK with the CreatePresignedDomainUrlCommand, case sensitivity is not respected in the UserProfileName parameter. This causes the command to fail when the username is not entirely lowercase.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
"@aws-sdk/client-sagemaker": "3.658.0"
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
node -v v18.19.1
Reproduction Steps
Given a SageMaker domain with domainId d-12345
and a user named PowerUser
, execute the following:
const client = new SageMakerClient();
const input: CreatePresignedDomainUrlCommandInput = {
DomainId: "d-12345",
UserProfileName: "PowerUser",
SessionExpirationDurationInSeconds: 28800,
};
const command = new CreatePresignedDomainUrlCommand(input);
const response = await client.send(command);
Observed Behavior
Due to my client's security posture and usage of permission's boundaries, the error I receive is the following:
<guid> ERROR Invoke Error {"errorType":"AccessDeniedException","errorMessage":"User: <myRoleWithCorrectPermissions> is not authorized to perform: sagemaker:CreatePresignedDomainUrl on resource: arn:aws:sagemaker:us-east-1:ACCOUNT_NUMBER:user-profile/d-12345/poweruser because no permissions boundary allows the sagemaker:CreatePresignedDomainUrl action","name":"AccessDeniedException","$fault":"client","$metadata":{"httpStatusCode":400,"requestId":"foo","attempts":1,"totalRetryDelay":0},"__type":"AccessDeniedException"
This is the same error as the user not being found, looking further at the resource ARN of:
arn:aws:sagemaker:us-east-1:ACCOUNT_NUMBER:user-profile/d-12345/poweruser
We can see the PascalCase userProfileName in the parameters is changed to lowercase, causing the resource to be invalid.
I repeated this with a new username of test
, all lowercase and the exact same code in the generation was successful.
Expected Behavior
A presigned URL is returned for the user PowerUser
Possible Solution
UserProfileName parameter is not respecting the case of the input
Additional Information/Context
No response