Documentation
¶
Index ¶
- Constants
- Variables
- type CLILoginHandler
- func (h *CLILoginHandler) Decide(c echo.Context) error
- func (h *CLILoginHandler) Exchange(c echo.Context) error
- func (h *CLILoginHandler) Inspect(c echo.Context) error
- func (h *CLILoginHandler) Logout(c echo.Context) error
- func (h *CLILoginHandler) Register(api *echo.Group, jwt echo.MiddlewareFunc)
- func (h *CLILoginHandler) Session(c echo.Context) error
- func (h *CLILoginHandler) Start(c echo.Context) error
- type CreateRequest
- type GrantRequest
- type GrantResponse
- type Handler
- func (h *Handler) Create(c echo.Context) error
- func (h *Handler) Get(c echo.Context) error
- func (h *Handler) List(c echo.Context) error
- func (h *Handler) Register(api *echo.Group, jwtMiddleware echo.MiddlewareFunc)
- func (h *Handler) Revoke(c echo.Context) error
- func (h *Handler) Update(c echo.Context) error
- type IntrospectionHandler
- type IntrospectionRequest
- type IntrospectionResponse
- type ListOptions
- type ListResponse
- type Service
- func (s *Service) Create(ctx context.Context, userID uuid.UUID, req *CreateRequest) (*TokenResponse, error)
- func (s *Service) Get(ctx context.Context, userID, tokenID uuid.UUID) (*TokenResponse, error)
- func (s *Service) Introspect(ctx context.Context, plaintext string) IntrospectionResponse
- func (s *Service) List(ctx context.Context, userID uuid.UUID, opts ListOptions) (*ListResponse, error)
- func (s *Service) Revoke(ctx context.Context, userID, tokenID uuid.UUID) error
- func (s *Service) Update(ctx context.Context, userID, tokenID uuid.UUID, req *UpdateRequest) (*TokenResponse, error)
- func (s *Service) Verify(ctx context.Context, plaintext string) (uuid.UUID, []string, error)
- func (s *Service) VerifyPrincipal(ctx context.Context, plaintext string) (*auth.AuthPrincipal, error)
- type TokenResponse
- type UpdateRequest
Constants ¶
View Source
const InternalTokenHeader = "X-OpenLinker-Internal-Token"
Variables ¶
View Source
var ErrInvalidToken = errors.New("invalid user token")
Functions ¶
This section is empty.
Types ¶
type CLILoginHandler ¶ added in v0.1.62
type CLILoginHandler struct {
// contains filtered or unexported fields
}
CLILoginHandler owns platform client authorization only. The browser approves a narrow User Token; it never hands its JWT or a Runtime credential to the CLI.
func NewCLILoginHandler ¶ added in v0.1.62
func NewCLILoginHandler(svc *Service, frontend string, trustedProxies ...*net.IPNet) *CLILoginHandler
func (*CLILoginHandler) Decide ¶ added in v0.1.62
func (h *CLILoginHandler) Decide(c echo.Context) error
func (*CLILoginHandler) Exchange ¶ added in v0.1.62
func (h *CLILoginHandler) Exchange(c echo.Context) error
func (*CLILoginHandler) Inspect ¶ added in v0.1.62
func (h *CLILoginHandler) Inspect(c echo.Context) error
func (*CLILoginHandler) Logout ¶ added in v0.1.62
func (h *CLILoginHandler) Logout(c echo.Context) error
func (*CLILoginHandler) Register ¶ added in v0.1.62
func (h *CLILoginHandler) Register(api *echo.Group, jwt echo.MiddlewareFunc)
type CreateRequest ¶
type CreateRequest struct {
Name string `json:"name"`
Grants []GrantRequest `json:"grants"`
Scopes []string `json:"scopes,omitempty"`
ExpiresAt *time.Time `json:"expires_at"`
}
type GrantRequest ¶
type GrantResponse ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(svc tokenService) *Handler
type IntrospectionHandler ¶
type IntrospectionHandler struct {
// contains filtered or unexported fields
}
func NewIntrospectionHandler ¶
func NewIntrospectionHandler(svc interface {
Introspect(context.Context, string) IntrospectionResponse
}, internalSecret string) *IntrospectionHandler
func (*IntrospectionHandler) Introspect ¶
func (h *IntrospectionHandler) Introspect(c echo.Context) error
func (*IntrospectionHandler) Register ¶
func (h *IntrospectionHandler) Register(e *echo.Echo)
type IntrospectionRequest ¶
type IntrospectionRequest struct {
Token string `json:"token"`
}
type IntrospectionResponse ¶
type IntrospectionResponse struct {
Active bool `json:"active"`
IssuerInstanceID string `json:"issuer_instance_id,omitempty"`
TokenID string `json:"token_id,omitempty"`
UserID string `json:"user_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Grants []GrantResponse `json:"grants,omitempty"`
ExpiresAt *string `json:"expires_at,omitempty"`
}
type ListOptions ¶
type ListResponse ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, userID uuid.UUID, req *CreateRequest) (*TokenResponse, error)
func (*Service) Introspect ¶
func (s *Service) Introspect(ctx context.Context, plaintext string) IntrospectionResponse
func (*Service) List ¶
func (s *Service) List(ctx context.Context, userID uuid.UUID, opts ListOptions) (*ListResponse, error)
func (*Service) Update ¶
func (s *Service) Update(ctx context.Context, userID, tokenID uuid.UUID, req *UpdateRequest) (*TokenResponse, error)
func (*Service) Verify ¶
Verify keeps the one-release verifier interface compatible while all new authorization reads the structured principal from VerifyPrincipal.
func (*Service) VerifyPrincipal ¶
type TokenResponse ¶
type TokenResponse struct {
ID string `json:"id"`
UserID string `json:"user_id"`
IssuerInstanceID string `json:"issuer_instance_id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
Grants []GrantResponse `json:"grants"`
Scopes []string `json:"scopes"`
ExpiresAt *string `json:"expires_at"`
LastUsedAt *string `json:"last_used_at"`
RevokedAt *string `json:"revoked_at"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
PlaintextToken string `json:"plaintext_token,omitempty"`
}
type UpdateRequest ¶
type UpdateRequest struct {
Name *string `json:"name,omitempty"`
Grants *[]GrantRequest `json:"grants,omitempty"`
Scopes *[]string `json:"scopes,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.