apikey

package
v0.0.0-...-8540621 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAPIKeyNotFound is used when the specified API key cannot be located.
	ErrAPIKeyNotFound = errors.New("invalid API key")
)

Functions

This section is empty.

Types

type Service

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

Service is used to provision and manage API keys.

func New

func New(db *sqlx.DB, dbKey string) *Service

New creates a new Service.

func (*Service) Create

Create a key with the org/user as an owner.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *uuidpb.UUID) (*types.Empty, error)

Delete will remove the key.

func (*Service) FetchOrgUserIDUsingAPIKey

func (s *Service) FetchOrgUserIDUsingAPIKey(ctx context.Context, key string) (uuid.UUID, uuid.UUID, error)

FetchOrgUserIDUsingAPIKey gets the org and user ID based on the API key.

func (*Service) Get

Get returns a specific key if it's owned by the org.

func (*Service) List

List returns all the keys belonging to an org.

func (*Service) LookupAPIKey

LookupAPIKey gets the complete API key information using just the Key.

Jump to

Keyboard shortcuts

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