service

package
v0.0.0-...-94d0466 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 14 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) *Controller

func ProvideController

func ProvideController(principalUIDCheck check.PrincipalUID, authorizer authz.Authorizer,
	principalStore store.PrincipalStore) *Controller

func (*Controller) Create

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

Create creates a new service.

func (*Controller) CreateNoAuth

func (c *Controller) CreateNoAuth(ctx context.Context, in *CreateInput, admin bool) (*types.Service, error)

* CreateNoAuth creates a new service without auth checks. * WARNING: Never call as part of user flow. * * Note: take admin separately to avoid potential vulnerabilities for user calls.

func (*Controller) Delete

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

* Delete deletes a service.

func (*Controller) Find

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

Find tries to find the provided service.

func (*Controller) FindNoAuth

func (c *Controller) FindNoAuth(ctx context.Context, serviceUID string) (*types.Service, error)

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

func (*Controller) List

func (c *Controller) List(ctx context.Context, session *auth.Session) (int64, []*types.Service, error)

List lists all services of the system.

func (*Controller) Update

func (c *Controller) Update(ctx context.Context, session *auth.Session,
	serviceUID string, in *UpdateInput) (*types.Service, error)

Update updates the provided service.

func (*Controller) UpdateAdmin

func (c *Controller) UpdateAdmin(ctx context.Context, session *auth.Session,
	serviceUID string, admin bool) (*types.Service, error)

UpdateAdmin updates the admin state of a service.

type CreateInput

type CreateInput struct {
	UID         string `json:"uid"`
	Email       string `json:"email"`
	DisplayName string `json:"display_name"`
}

CreateInput is the input used for create operations.

type UpdateInput

type UpdateInput struct {
	Email       *string `json:"email"`
	DisplayName *string `json:"display_name"`
}

UpdateInput store infos to update an existing service.

Jump to

Keyboard shortcuts

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