auth_apikey

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidApiKeyErr = errors.New("token is not a valid neosync api key")
	ApiKeyExpiredErr = nucleuserrors.NewUnauthenticated("token is expired")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(
	queries Queries,
	db db_queries.DBTX,
	allowedWorkerApiKeys []string,
	allowedWorkerProcedures []string,
) *Client

func (*Client) InjectTokenCtx

func (c *Client) InjectTokenCtx(ctx context.Context, header http.Header, spec connect.Spec) (context.Context, error)

type Queries

type Queries interface {
	GetAccountApiKeyByKeyValue(ctx context.Context, db db_queries.DBTX, apiKey string) (db_queries.NeosyncApiAccountApiKey, error)
}

type TokenContextData

type TokenContextData struct {
	RawToken   string
	ApiKey     *db_queries.NeosyncApiAccountApiKey
	ApiKeyType apikey.ApiKeyType
}

func GetTokenDataFromCtx

func GetTokenDataFromCtx(ctx context.Context) (*TokenContextData, error)

type TokenContextKey

type TokenContextKey struct{}

Jump to

Keyboard shortcuts

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