Documentation ¶
Index ¶
Constants ¶
const LegacyTokenDescription = "Legacy data collector token ported from A1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConflictError ¶
type ConflictError struct{}
ConflictError is the error returned when the token creation request specifies an ID that has already been used
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type NotFoundError ¶
type NotFoundError struct{}
NotFoundError is the error returned when the token wasn't found, to discern this from other errors -- failures to reach the backend services, etc.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type ProjectValidator ¶
type ProjectValidator interface {
ValidateProjectAssignment(context.Context, *authz.ValidateProjectAssignmentReq, ...grpc.CallOption) (*authz.ValidateProjectAssignmentResp, error)
}
ProjectValidator is a more limited interface for authz-service
type Resetter ¶
Resetter allows resetting the adapter to factory settings (e.g. deletes all data) -- use with caution
type Storage ¶
type Storage interface { CreateToken(ctx context.Context, id, name string, active bool, projects []string) (*Token, error) CreateTokenWithValue(ctx context.Context, id, value, name string, active bool, projects []string) (*Token, error) CreateLegacyTokenWithValue(ctx context.Context, value string) (*Token, error) DeleteToken(context.Context, string) error UpdateToken(ctx context.Context, id, name string, active bool, projects []string) (*Token, error) GetToken(context.Context, string) (*Token, error) GetTokenIDWithValue(ctx context.Context, value string) (string, error) GetTokens(context.Context) ([]*Token, error) PurgeProject(context.Context, string) error }
Storage is the interface for various adapters
type Token ¶
type Token struct { ID string Name string Value string Active bool Created time.Time Updated time.Time Projects []string }
Token represents a token we are able to use to authenticate: the ID is arbitrary, the Token will be checked for in incoming requests.
type TokenConfig ¶
type TokenConfig interface {
Open(*certs.ServiceCerts, *zap.Logger, ProjectValidator) (Storage, error)
}
TokenConfig is a configuration that can open a storage adapter