Documentation
¶
Overview ¶
Package oauth implements opsgate's built-in OAuth authorization server.
Index ¶
- func CreatePasskeyInvite(cfg config.BuiltinAuth, issuer, subject string, ttl time.Duration) (string, error)
- type Server
- func (s *Server) Access(subject string) (scopes, tools []string, ok bool)
- func (s *Server) Close() error
- func (s *Server) RequireUser(next func(http.ResponseWriter, *http.Request, string)) http.Handler
- func (s *Server) Routes(mux *http.ServeMux)
- func (s *Server) Verify(ctx context.Context, token string, r *http.Request) (*auth.TokenInfo, error)
- func (s *Server) VerifyWithTools(ctx context.Context, token string, r *http.Request) (*auth.TokenInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePasskeyInvite ¶
func CreatePasskeyInvite(cfg config.BuiltinAuth, issuer, subject string, ttl time.Duration) (string, error)
CreatePasskeyInvite writes a one-time registration invite for subject and returns its URL. subject must be a configured user and the upstream provider must be "passkey".
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the authorization server. It is safe for concurrent use.
func New ¶
func New(cfg config.BuiltinAuth, issuer, resource string) (*Server, error)
New returns a Server whose issuer is issuer (an https origin) and whose tokens are only valid for resource (the MCP endpoint URL).
func (*Server) RequireUser ¶
RequireUser runs next with an allowed upstream subject, starting a browser login when no live session is present. Login returns only to local paths.