Skip to content

Conversation

@falconlee236
Copy link

What

  • Validate robot_name_prefix as non-empty so and empty/whitespace-only prefix cannot be saved.

Why

  • With an empty prefix, the OIDC CLI middleware treats and every username as a robot account due to string.HasPrefix(username, prefix) always being true

How

Thanks to @stonezdj, I found clue how to handle this issue.

  • Change config metadata for robot_name_prefix from StringType to NonEmptyStringType`
  • Server-side validation already flows through metadata.NewCfgValue(...) -> ConfigureValue.Set(...) -> ItemType.Validate(...). so empty/space-only values now return ErrStringValueIsEmpty and are rejected during config update.

Issue being fixed

Fixes #22395

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Copy link
Contributor

@stonezdj stonezdj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.86%. Comparing base (c8c11b4) to head (c3ef1e1).
⚠️ Report is 594 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #22556       +/-   ##
===========================================
+ Coverage   45.36%   65.86%   +20.49%     
===========================================
  Files         244     1073      +829     
  Lines       13333   116095   +102762     
  Branches     2719     2931      +212     
===========================================
+ Hits         6049    76470    +70421     
- Misses       6983    35388    +28405     
- Partials      301     4237     +3936     
Flag Coverage Δ
unittests 65.86% <ø> (+20.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 987 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting robot_name_prefix to an empty string blocks OIDC users from logging in via client secret

5 participants