tokens

package
v0.0.0-...-e080771 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Session(actor, emulator string) (Session, error)
}

Client is client for token service

func New

New creates a new cacao api token microservice client

type Session

type Session interface {
	// Tokens
	GetToken(id common.ID) (service.TokenModel, error)
	ListTokens() ([]service.TokenModel, error)
	ValidateCreateTokenRequest(model service.TokenCreateModel) error
	CreateToken(model service.TokenCreateModel) (common.TokenID, error)
	ValidateTokenDeleteRequest(id common.ID) error
	UpdateTokenFields(id common.ID, updateRequest service.TokenModel, updateFields []string) (common.ID, error)
	ValidateTokenUpdateFieldsRequest(id common.ID, updateRequest service.TokenModel, updateFields []string) error
	DeleteToken(id common.ID) (common.ID, error)
	RevokeToken(id common.ID) (common.ID, error)
	// Token Types
	ListTypes() ([]service.TokenType, error)
}

Session is an interface for interacting with the token microservice on behalf of a user. The purpose of having a session is to consolidate parameters that are common in all or most requests, but are not known at configuration time.

Jump to

Keyboard shortcuts

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