Documentation ¶
Index ¶
Constants ¶
const Root = "/oauth2"
Root is the root of all OAuth-related routes.
Variables ¶
var AuthZProvider authz.AuthZProviderType[OauthAuthZ]
AuthZProvider is the authz registry for experiments.
Functions ¶
func RegisterAPIHandler ¶
func RegisterAPIHandler(e *echo.Echo, s *Service)
RegisterAPIHandler registers endpoints used by OAuth.
Types ¶
type OauthAuthZ ¶
type OauthAuthZ interface { // CanAdministrateOauth returns an error if the user is not authorized to manage oauth. CanAdministrateOauth(ctx context.Context, curUser model.User) error }
OauthAuthZ describes authz methods for experiments.
type OauthAuthZBasic ¶
type OauthAuthZBasic struct{}
OauthAuthZBasic is basic OSS controls.
func (*OauthAuthZBasic) CanAdministrateOauth ¶
CanAdministrateOauth returns an error if the current user is not an admin.
type OauthAuthZPermissive ¶
type OauthAuthZPermissive struct{}
OauthAuthZPermissive is the permission implementation.
func (*OauthAuthZPermissive) CanAdministrateOauth ¶
func (a *OauthAuthZPermissive) CanAdministrateOauth(ctx context.Context, curUser model.User, ) error
CanAdministrateOauth calls RBAC authz but enforces basic authz.
type OauthAuthZRBAC ¶
type OauthAuthZRBAC struct{}
OauthAuthZRBAC is the RBAC implementation of the OauthAuthZ interface.
func (*OauthAuthZRBAC) CanAdministrateOauth ¶
func (a *OauthAuthZRBAC) CanAdministrateOauth( ctx context.Context, curUser model.User, ) (err error)
CanAdministrateOauth checks if the user has permission to view and modify oauth clients and settings.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is an OAuth service capable of handling the OAuth 2.0 authorization code flow and managing clients and tokens.
func (*Service) ValidateRequest ¶
ValidateRequest checks whether the given request contains valid OAuth credentials.