serviceaccount

package
v1.0.4-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WireSet = wire.NewSet(
	NewController,
)

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(principalUIDCheck check.PrincipalUID, authorizer authz.Authorizer,
	principalStore store.PrincipalStore, spaceStore store.SpaceStore, repoStore store.RepoStore,
	tokenStore store.TokenStore) *Controller

func ProvideController

func ProvideController(principalUIDCheck check.PrincipalUID, authorizer authz.Authorizer,
	principalStore store.PrincipalStore, spaceStore store.SpaceStore, repoStore store.RepoStore,
	tokenStore store.TokenStore) *Controller

func (*Controller) Create

func (c *Controller) Create(ctx context.Context, session *auth.Session,
	in *CreateInput) (*types.ServiceAccount, error)

Create creates a new service account.

func (*Controller) CreateNoAuth

func (c *Controller) CreateNoAuth(ctx context.Context,
	in *CreateInput, uid string) (*types.ServiceAccount, error)

* CreateNoAuth creates a new service account without auth checks. * WARNING: Never call as part of user flow. * * Note: take uid separately to allow internally created non-random uids.

func (*Controller) CreateToken

func (c *Controller) CreateToken(
	ctx context.Context,
	session *auth.Session,
	saUID string,
	in *CreateTokenInput,
) (*types.TokenResponse, error)

CreateToken creates a new service account access token.

func (*Controller) Delete

func (c *Controller) Delete(ctx context.Context, session *auth.Session,
	saUID string) error

Delete deletes a service account.

func (*Controller) DeleteToken

func (c *Controller) DeleteToken(
	ctx context.Context,
	session *auth.Session,
	saUID string,
	identifier string,
) error

DeleteToken deletes a token of a service account.

func (*Controller) Find

func (c *Controller) Find(ctx context.Context, session *auth.Session,
	saUID string) (*types.ServiceAccount, error)

Find tries to find the provided service account.

func (*Controller) FindNoAuth

func (c *Controller) FindNoAuth(ctx context.Context, saUID string) (*types.ServiceAccount, error)

* FindNoAuth finds a service account without auth checks. * WARNING: Never call as part of user flow.

func (*Controller) ListTokens

func (c *Controller) ListTokens(ctx context.Context, session *auth.Session,
	saUID string) ([]*types.Token, error)

ListTokens lists all tokens of a service account.

type CreateInput

type CreateInput struct {
	Email       string                  `json:"email"`
	DisplayName string                  `json:"display_name"`
	ParentType  enum.ParentResourceType `json:"parent_type"`
	ParentID    int64                   `json:"parent_id"`
}

type CreateTokenInput

type CreateTokenInput struct {
	// TODO [CODE-1363]: remove after identifier migration.
	UID        string         `json:"uid" deprecated:"true"`
	Identifier string         `json:"identifier"`
	Lifetime   *time.Duration `json:"lifetime"`
}

Jump to

Keyboard shortcuts

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