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

CognitoIDP[UserPoolClient]: UserPoolClient name has unexpected validation errors when contains uppercase / non word characters #828

Closed
thekaleidoscope opened this issue Aug 14, 2023 · 3 comments · Fixed by #1021
Labels
bug Something isn't working is:triaged Indicates that an issue has been reviewed.

Comments

@thekaleidoscope
Copy link
Contributor

What happened?

As a side effect of 762, the UserPoolClient name now throws a validation error when the name contains any special characters like - or .. Client Name doesn't have such restrictions according to AWS Docs

The validation rules of Client ID [\w+]+, now applies on top of validation rules of Client Name.

How can we reproduce it?

Create a user pool client with nameorg-name, This will error out with:

observe failed: cannot run refresh: refresh failed: reading Amazon
        Cognito IDP (Identity Provider) User Pool Client (org-name):
        InvalidParameterException: 1 validation error detected: Value
        'org-name` at 'clientId' failed to satisfy constraint: Member must
        satisfy regular expression pattern: [\w+]+

What environment did it happen in?

  • Crossplane Version: v1.10.4
  • Provider Version: v0.38.0
  • Kubernetes Version: v1.23.17
  • Kubernetes Distribution: EKS
@thekaleidoscope thekaleidoscope added bug Something isn't working needs:triage labels Aug 14, 2023
@thekaleidoscope
Copy link
Contributor Author

thekaleidoscope commented Aug 14, 2023

As mentioned in 762, I think a viable solution could be making a MD5 of the name as its of regex [0-9a-f]{32} satisfies both the requirements, I'll be happy to make the PR if this makes sense

@turkenf
Copy link
Collaborator

turkenf commented Aug 28, 2023

Hi @thekaleidoscope,

Thank you for raising this issue, it can be reproduced with provider-aws v0.39.0. I also faced the same issue while working on this issue.

@turkenf turkenf added is:triaged Indicates that an issue has been reviewed. and removed needs:triage labels Aug 28, 2023
@mbbush
Copy link
Collaborator

mbbush commented Dec 13, 2023

When generating an invalid name to use as the initial terraform id, that will just be overwritten later, is there any reason why we can't just use a static value? That seems simpler and no less "wrong" than other solutions like using the name or hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working is:triaged Indicates that an issue has been reviewed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants