apikeyhelper

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncodeKeyEnvStr = "ENCRYPTION_SECRET"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyHelper

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

func NewApiKeyHelper

func NewApiKeyHelper(basicRes context.BasicRes, logger log.Logger) *ApiKeyHelper

func (*ApiKeyHelper) Create

func (c *ApiKeyHelper) Create(tx dal.Transaction, user *common.User, name string, expiredAt *time.Time, allowedPath string, apiKeyType string, extra string) (*models.ApiKey, errors.Error)

func (*ApiKeyHelper) CreateForPlugin

func (c *ApiKeyHelper) CreateForPlugin(tx dal.Transaction, user *common.User, name string, pluginName string, allowedPath string, extra string) (*models.ApiKey, errors.Error)

func (*ApiKeyHelper) Delete

func (c *ApiKeyHelper) Delete(id uint64) errors.Error

func (*ApiKeyHelper) DeleteForPlugin

func (c *ApiKeyHelper) DeleteForPlugin(tx dal.Transaction, pluginName string, extra string) errors.Error

func (*ApiKeyHelper) DigestToken

func (c *ApiKeyHelper) DigestToken(token string) (string, errors.Error)

func (*ApiKeyHelper) GenApiKeyNameForPlugin

func (c *ApiKeyHelper) GenApiKeyNameForPlugin(pluginName string, connectionId uint64) string

func (*ApiKeyHelper) GetApiKey

func (c *ApiKeyHelper) GetApiKey(tx dal.Dal, additionalClauses ...dal.Clause) (*models.ApiKey, errors.Error)

func (*ApiKeyHelper) Put

func (c *ApiKeyHelper) Put(user *common.User, id uint64) (*models.ApiKey, errors.Error)

Jump to

Keyboard shortcuts

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