newOIDCMCPTokenSource returns nil when no OIDC provider is configured. mcpclient treats a nil source the same as "no token available" and omits the Authorization header.
(db database.Store, config promoauth.OAuth2Config, logger slog.Logger)
| 46 | // configured. mcpclient treats a nil source the same as "no token |
| 47 | // available" and omits the Authorization header. |
| 48 | func newOIDCMCPTokenSource(db database.Store, config promoauth.OAuth2Config, logger slog.Logger) mcpclient.UserOIDCTokenSource { |
| 49 | if config == nil { |
| 50 | return nil |
| 51 | } |
| 52 | return &oidcMCPTokenSource{ |
| 53 | db: db, |
| 54 | config: config, |
| 55 | logger: logger, |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // OIDCAccessToken implements mcpclient.UserOIDCTokenSource. It |
| 60 | // refreshes expired tokens and persists the refreshed token back |
no outgoing calls