entities

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrganizationNameFromHeader added in v0.165.0

func GetOrganizationNameFromHeader(ctx context.Context) (string, error)

func GetRawToken added in v0.165.0

func GetRawToken(ctx context.Context) (string, error)

GetRawToken takes whatever Bearer token is in the request

func WithCurrentAPIToken

func WithCurrentAPIToken(ctx context.Context, token *APIToken) context.Context

func WithCurrentOrg

func WithCurrentOrg(ctx context.Context, org *Org) context.Context

func WithCurrentUser

func WithCurrentUser(ctx context.Context, user *User) context.Context

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
}

func CurrentAPIToken

func CurrentAPIToken(ctx context.Context) *APIToken

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

type Org struct {
	ID, Name  string
	CreatedAt *time.Time
}

func CurrentOrg

func CurrentOrg(ctx context.Context) *Org

type ResourceMembership added in v1.11.0

type ResourceMembership struct {
	MembershipID uuid.UUID
	Role         authz.Role
	ResourceType authz.ResourceType
	ResourceID   uuid.UUID
}

type User

type User struct {
	Email, ID, FirstName, LastName string
	CreatedAt                      *time.Time
}

Utils to get and set information from context

func CurrentUser

func CurrentUser(ctx context.Context) *User

CurrentUser retrieves the user from the context

Jump to

Keyboard shortcuts

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