Skip to content

SageMaker CreatePresignedDomainUrlCommandInput doesn't respect case sensitive UserProfileName parameterΒ #6514

@ericpapaluca

Description

@ericpapaluca

Checkboxes for prior research

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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions