Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAuthorizationToken returns token is too long error #6580

Open
3 of 4 tasks
wujohns opened this issue Oct 21, 2024 · 1 comment
Open
3 of 4 tasks

getAuthorizationToken returns token is too long error #6580

wujohns opened this issue Oct 21, 2024 · 1 comment
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@wujohns
Copy link

wujohns commented Oct 21, 2024

Checkboxes for prior research

Describe the bug

When using the getAuthorizationToken command to obtain a token, the length of the obtained token reached 2368, which is far beyond the length obtained by executing aws ecr get-login-password with aws cli. This excessively long token is an extremely poor feature because most automation frameworks only support a maximum password length of 2048 for Docker, making it impossible for AWS's Docker registry to work with these automation frameworks.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

Node.js v18.18.2

Reproduction Steps

const { ECRClient, GetAuthorizationTokenCommand } = require('@aws-sdk/client-ecr')
const awsKey = 'xxx'
const awsSecret = 'xxx'

const client = new ECRClient({
  region: 'us-east-1',
  credentials: {
    accessKeyId: awsKey
    secretAccessKey: awsSecret 
  }
})

const run = async () => {
  const command = new GetAuthorizationTokenCommand({})
  const response = await client.send(command)
  console.log(response.authorizationData, response.authorizationData[0].authorizationToken.length)
}
run().then(() => process.exit(0))

The length will be 2368(too long)

Observed Behavior

response.authorizationData[0].authorizationToken.length is 2368, the token is too long for most framework

Expected Behavior

return shorter length token(less than 2000)

Possible Solution

No response

Additional Information/Context

No response

@wujohns wujohns added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 21, 2024
@aBurmeseDev aBurmeseDev changed the title TITLE FOR BUG REPORT getAuthorizationToken returns token is too long error Oct 21, 2024
@zshzbh zshzbh added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2024
@zshzbh zshzbh self-assigned this Oct 28, 2024
@zshzbh
Copy link
Contributor

zshzbh commented Oct 28, 2024

Hey @wujohns ,

Thanks for the feedback! The token comes from service team(ECR), I will open a ticket on the service team. I will keep you updated!

Thanks!
Maggie

@zshzbh zshzbh added the service-api This issue is due to a problem in a service API, not the SDK implementation. label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants