auth

package
v1.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBearerTokenNotConfigured = errors.New("cloud bearer token is not configured")
View Source
var ErrInvalidDashboardSessionToken = errors.New("invalid dashboard session token")
View Source
var ErrProjectNotAllowed = errors.New("project is not allowed for this token")
View Source
var ErrSecretTooShort = errors.New("jwt secret must be at least 32 bytes")

Functions

This section is empty.

Types

type ProjectScopeAuthorizer added in v1.13.0

type ProjectScopeAuthorizer struct {
	// contains filtered or unexported fields
}

func NewProjectScopeAuthorizer added in v1.13.0

func NewProjectScopeAuthorizer(projects []string) *ProjectScopeAuthorizer

func (*ProjectScopeAuthorizer) AuthorizeProject added in v1.13.0

func (a *ProjectScopeAuthorizer) AuthorizeProject(project string) error

func (*ProjectScopeAuthorizer) EnrolledProjects added in v1.13.0

func (a *ProjectScopeAuthorizer) EnrolledProjects() []string

EnrolledProjects returns the sorted list of projects this authorizer allows. Matches the cloudserver.EnrolledProjectsProvider contract so mutation pull can filter server-side by the caller's enrolled projects (REQ-202) rather than fail-closing to an empty result set.

func (*ProjectScopeAuthorizer) SetAllowedProjects added in v1.13.0

func (a *ProjectScopeAuthorizer) SetAllowedProjects(projects []string)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(store *cloudstore.CloudStore, jwtSecret string) (*Service, error)

func (*Service) Authorize added in v1.13.0

func (s *Service) Authorize(r *http.Request) error

func (*Service) AuthorizeProject added in v1.13.0

func (s *Service) AuthorizeProject(project string) error

func (*Service) EnrolledProjects added in v1.13.0

func (s *Service) EnrolledProjects() []string

EnrolledProjects returns the sorted list of projects that this Service is authorized to serve. Used by cloudserver's mutation pull to filter mutations to the caller's enrolled projects (REQ-202).

The interface is cloudserver.EnrolledProjectsProvider; this method makes *Service satisfy it without importing cloudserver (structural assertion).

func (*Service) MintDashboardSession added in v1.13.0

func (s *Service) MintDashboardSession(bearerToken string) (string, error)

MintDashboardSession returns a signed dashboard session token. The token is opaque to clients and validated by ParseDashboardSession.

func (*Service) ParseDashboardSession added in v1.13.0

func (s *Service) ParseDashboardSession(sessionToken string) (string, error)

ParseDashboardSession verifies and decodes a signed dashboard session token.

func (*Service) SetAllowedProjects added in v1.13.0

func (s *Service) SetAllowedProjects(projects []string)

func (*Service) SetBearerToken added in v1.13.0

func (s *Service) SetBearerToken(token string)

func (*Service) SetDashboardSessionTokens added in v1.13.0

func (s *Service) SetDashboardSessionTokens(tokens []string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL