Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultProtectedResourceMetadataURI = "/.well-known/oauth-protected-resource"
)
Variables ¶
View Source
var ( Audience = "systemd-mcp-server" ScopesSupported = []string{"mcp:read", "mcp:write"} // mcp-user )
Functions ¶
func GetJwksURI ¶
getJwksUri gets the jwks_uri from the OpenID Provider configuration information. See https://openid.net/specs/openid-connect-discovery-1_0.html
Types ¶
type Oauth2Auth ¶
type Oauth2Auth struct {
KeyFunc keyfunc.Keyfunc // Check oauth2 token func
JwksUri string
// contains filtered or unexported fields
}
func NewOutah2Auth ¶
func NewOutah2Auth() Oauth2Auth
func (*Oauth2Auth) IsReadAuthorized ¶
func (a *Oauth2Auth) IsReadAuthorized(ctx context.Context) (bool, error)
check if read is authorized via mcp:read
func (*Oauth2Auth) IsWriteAuthorized ¶
func (a *Oauth2Auth) IsWriteAuthorized(ctx context.Context) (bool, error)
check if write is authorized via mcp:write and mcp-admin role
Click to show internal directories.
Click to hide internal directories.