fix: only allow alphanumeric OIDC client names to keep environment variables valid - #1131
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe OIDC client creation command now accepts only non-empty alphanumeric client names. It uses ChangesOIDC client name validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The PR enforces the intended alphanumeric client-name constraint without an identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // Only alphanumeric since the name will be turned into environment variable names | ||
| if !regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString(clientName) { | ||
| return errors.New("client name can only contain alphanumeric characters") | ||
| } |
There was a problem hiding this comment.
Change the regex match method as well: MatchString(pattern string, s string) only returns an error if the pattern parsing failed. With MustCompile() and MatchString(s string), this check is moved to compile time.
See #1130
Summary by CodeRabbit