Skip to content

Conversation

@hrntknr
Copy link
Member

@hrntknr hrntknr commented Aug 25, 2025

This PR adds glob pattern support for OIDC allowed users.\n\n- Supports patterns like @example.com and alice\n- Preserves existing exact-match behavior for backwards compatibility\n\nPlease let me know if you prefer a different title or wording.

Copilot AI review requested due to automatic review settings August 25, 2025 15:21
@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 73.68421% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
main.go 71.05% 10 Missing and 1 partial ⚠️
pkg/auth/oidc.go 83.33% 2 Missing and 1 partial ⚠️
pkg/mcp-proxy/main.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds glob pattern support for OIDC allowed users, enabling more flexible user authorization patterns like *@example.com while maintaining backward compatibility with exact matching.

  • Adds new --oidc-allowed-users-glob configuration option that accepts glob patterns
  • Implements custom string splitting with escape sequences to handle commas in patterns
  • Updates OIDC provider to check both exact matches and glob patterns during authorization

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/auth/oidc.go Core implementation of glob pattern matching in OIDC provider
pkg/auth/oidc_test.go Test coverage for glob pattern functionality
pkg/mcp-proxy/main.go Function signature update to pass glob patterns parameter
main.go CLI argument parsing and string splitting utility for glob patterns
main_test.go Test coverage for new utility functions
go.mod Addition of gobwas/glob dependency
docs/ Documentation updates explaining glob pattern usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Add OIDC_ALLOWED_USERS_GLOB flag/env to allow user authorization via glob patterns
- Compile and evaluate patterns with github.com/gobwas/glob
- Preserve exact match checks (OIDC_ALLOWED_USERS) and fall back to globs
- Introduce splitWithEscapes to parse comma-separated values with escaped delimiters
- Wire through CLI flags and pkg/mcp-proxy
- Add tests for glob matching and helper parsing
- Update README and docs to document new option

Backward compatible: when no exact or glob rules are set, all users are allowed (as before).
Also tidy OIDC glob pattern test formatting.
@hrntknr hrntknr force-pushed the feat/oidc-allowed-users-glob branch from 2a19adf to 0e02a3b Compare August 25, 2025 15:52
@hrntknr hrntknr merged commit fe65156 into sigbit:main Aug 25, 2025
7 checks passed
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.

1 participant