mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-01 16:01:26 +02:00
mcp: add global runtime flag (#5604)
## Summary Adds global runtime flag to enable/disable MCP support. (off by default). ```yaml runtime_flags: mcp: true ``` ## Related issues Fix: https://linear.app/pomerium/issue/ENG-2367/place-mcp-support-behind-a-runtime-flag ## User Explanation <!-- How would you explain this change to the user? If this change doesn't create any user-facing changes, you can leave this blank. If filled out, add the `docs` label --> ## Checklist - [x] reference any related issues - [ ] updated unit tests - [ ] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [ ] ready for review
This commit is contained in:
parent
d1559eaa86
commit
1a19ccabd8
10 changed files with 100 additions and 31 deletions
|
@ -123,13 +123,15 @@ func (a *Authorize) maybeGetSessionFromRequest(
|
|||
hreq *http.Request,
|
||||
policy *config.Policy,
|
||||
) (*session.Session, error) {
|
||||
if policy.IsMCPServer() {
|
||||
s, err := a.getMCPSession(ctx, hreq)
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Error().Err(err).Msg("error getting mcp session")
|
||||
return nil, err
|
||||
if a.currentConfig.Load().Options.IsRuntimeFlagSet(config.RuntimeFlagMCP) {
|
||||
if policy.IsMCPServer() {
|
||||
s, err := a.getMCPSession(ctx, hreq)
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Error().Err(err).Msg("error getting mcp session")
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// attempt to create a session from an incoming idp token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue