Documentation
¶
Index ¶
- func GetCLIVersionFromHeader(ctx context.Context) string
- func GetOrganizationNameFromHeader(ctx context.Context) (string, error)
- func GetRawToken(ctx context.Context) (string, error)
- func WithCurrentAPIToken(ctx context.Context, token *APIToken) context.Context
- func WithCurrentOrg(ctx context.Context, org *Org) context.Context
- func WithCurrentUser(ctx context.Context, user *User) context.Context
- func WithMembership(ctx context.Context, m *Membership) context.Context
- type APIToken
- type Membership
- type Org
- type ResourceMembership
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCLIVersionFromHeader ¶ added in v1.95.2
GetCLIVersionFromHeader returns the CLI version advertised by the caller in the Chainloop-Cli-Version request header. The value format is "<version>-<edition>", e.g. "v1.94.2-oss". Returns an empty string when the header is absent or there is no transport in the context.
func GetOrganizationNameFromHeader ¶ added in v0.165.0
func GetRawToken ¶ added in v0.165.0
GetRawToken takes whatever Bearer token is in the request
func WithCurrentAPIToken ¶
func WithMembership ¶ added in v1.11.0
func WithMembership(ctx context.Context, m *Membership) context.Context
Types ¶
type APIToken ¶
type APIToken struct {
ID string
// Token Name
Name string
CreatedAt *time.Time
Token string
ProjectID *uuid.UUID
ProjectName *string
// ACL policies for this token. Used for authorization checks.
Policies []*authz.Policy
Scope string
}
func CurrentAPIToken ¶
type Membership ¶ added in v1.11.0
type Membership struct {
UserID uuid.UUID
Resources []*ResourceMembership
}
func CurrentMembership ¶ added in v1.11.0
func CurrentMembership(ctx context.Context) *Membership
type Org ¶
func CurrentOrg ¶
type ResourceMembership ¶ added in v1.11.0
Click to show internal directories.
Click to hide internal directories.