You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support glob patterns for OIDC allowed users (#77)
* feat(auth/oidc): add glob pattern support for allowed users
- 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).
* build: promote github.com/gobwas/glob to direct dependency
Also tidy OIDC glob pattern test formatting.
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,8 @@
8
8
9
9
-**Drop-in OAuth 2.1/OIDC gateway for MCP servers — put it in front, no code changes.**
10
10
-**Your IdP, your choice**: Google, GitHub, or any OIDC provider — e.g. Okta, Auth0, Azure AD, Keycloak — plus optional password.
11
-
-**Publish local MCP servers safely**: Supports all stdio, SSE, and HTTP transports. For stdio, traffic is converted to `/mcp`. For SSE/HTTP, it’s proxied as-is. Of course, with authentication.
11
+
-**Flexible user matching**: Support exact matching and glob patterns for user authorization (e.g., `*@company.com`)
12
+
-**Publish local MCP servers safely**: Supports all stdio, SSE, and HTTP transports. For stdio, traffic is converted to `/mcp`. For SSE/HTTP, it's proxied as-is. Of course, with authentication.
12
13
-**Verified across major MCP clients**: Claude, Claude Code, ChatGPT, GitHub Copilot, Cursor, etc. — the proxy smooths client-specific quirks for consistent auth.
rootCmd.Flags().StringVar(&oidcUserIDField, "oidc-user-id-field", getEnvWithDefault("OIDC_USER_ID_FIELD", "/email"), "JSON pointer to user ID field in userinfo endpoint response")
191
237
rootCmd.Flags().StringVar(&oidcProviderName, "oidc-provider-name", getEnvWithDefault("OIDC_PROVIDER_NAME", "OIDC"), "Display name for OIDC provider")
192
238
rootCmd.Flags().StringVar(&oidcAllowedUsers, "oidc-allowed-users", getEnvWithDefault("OIDC_ALLOWED_USERS", ""), "Comma-separated list of allowed OIDC users")
239
+
rootCmd.Flags().StringVar(&oidcAllowedUsersGlob, "oidc-allowed-users-glob", getEnvWithDefault("OIDC_ALLOWED_USERS_GLOB", ""), "Comma-separated list of glob patterns for allowed OIDC users")
193
240
194
241
// Password authentication
195
242
rootCmd.Flags().StringVar(&password, "password", getEnvWithDefault("PASSWORD", ""), "Plain text password for authentication (will be hashed with bcrypt)")
0 commit comments