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

DXCDT-499: Add abstractions to fetch client resource data in tf cmd #794

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Aug 8, 2023

🔧 Changes

This PR adds the ability to fetch the Auth0 Client import data for the auth0 terraform generate command.

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@sergiught sergiught marked this pull request as ready for review August 8, 2023 11:16
@sergiught sergiught requested a review from a team as a code owner August 8, 2023 11:16
Base automatically changed from feature/DXCDT-498-terraform to main August 8, 2023 11:44
@sergiught sergiught force-pushed the feature/DXCDT-499-client-data-fetcher branch from 9574462 to 409cd11 Compare August 8, 2023 11:45
sanitizedName := re.ReplaceAllString(name, "")

// Regular expression pattern to remove leading digits or dashes.
namePattern = "^[0-9-]+"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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 👍🏻

@sergiught sergiught merged commit 66853bf into main Aug 8, 2023
6 checks passed
@sergiught sergiught deleted the feature/DXCDT-499-client-data-fetcher branch August 8, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants