-
Notifications
You must be signed in to change notification settings - Fork 55
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
DXCDT-499: Add abstractions to fetch client resource data in tf cmd #794
Conversation
9574462
to
409cd11
Compare
sanitizedName := re.ReplaceAllString(name, "") | ||
|
||
// Regular expression pattern to remove leading digits or dashes. | ||
namePattern = "^[0-9-]+" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be preferable to match any leading character that is not a letter or underscore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How the sanitize works is that it matches invalid characters and removes them, so it's doing the opposite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's only matching a subset of invalid characters, not all possible invalid characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're already removing all the other possible chars in the step above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is split in 2 through 2 regexes, the first one removes all invalid characters, and the second one removes digits or - from the start of the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. My bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, happy to clarify 👍🏻
🔧 Changes
This PR adds the ability to fetch the Auth0 Client import data for the
auth0 terraform generate
command.📚 References
🔬 Testing
📝 Checklist