oauth

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: AGPL-3.0 Imports: 25 Imported by: 18

Documentation

Overview

Package acl provides persistence and access to Access Control List

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertPruningJob

func InsertPruningJob(ctx context.Context) error

InsertPruningJob adds a job to scheduler

func NewDAO

func NewDAO(o dao.DAO) dao.DAO

NewDAO creates a new DAO interface implementation. Only SQL is supported.

Types

type DAO

type DAO interface {
	dao.DAO
	// Load finds a corresponding, non-expired PAT based on the AccessToken.
	Load(accessToken string) (*auth.PersonalAccessToken, error)
	// Store inserts a PAT in the storage.
	Store(accessToken string, token *auth.PersonalAccessToken, update bool) error
	// Delete removes a PAT by its UUID.
	Delete(patUuid string) error
	// List lists all known PAT with optional filters.
	List(byType auth.PatType, byUser string) ([]*auth.PersonalAccessToken, error)
	// PruneExpired removes expired PAT from the storage.
	PruneExpired() (int, error)
}

DAO interface

func NewMemDao

func NewMemDao() DAO

type MemDAO

type MemDAO struct {
	sql.DAO
	// contains filtered or unexported fields
}

MemDAO is a dev-util for storing tokens in memory

func (*MemDAO) Delete

func (m *MemDAO) Delete(patUuid string) error

func (*MemDAO) List

func (m *MemDAO) List(byType auth.PatType, byUser string) ([]*auth.PersonalAccessToken, error)

func (*MemDAO) Load

func (m *MemDAO) Load(accessToken string) (*auth.PersonalAccessToken, error)

func (*MemDAO) PruneExpired

func (m *MemDAO) PruneExpired() (int, error)

func (*MemDAO) Store

func (m *MemDAO) Store(accessToken string, token *auth.PersonalAccessToken, _ bool) error

type PruneTokensAction

type PruneTokensAction struct{}

func (*PruneTokensAction) GetDescription

func (c *PruneTokensAction) GetDescription(lang ...string) actions.ActionDescription

func (*PruneTokensAction) GetName

func (c *PruneTokensAction) GetName() string

GetName Unique identifier

func (*PruneTokensAction) GetParametersForm

func (c *PruneTokensAction) GetParametersForm() *forms.Form

func (*PruneTokensAction) Init

func (c *PruneTokensAction) Init(job *jobs.Job, cl client.Client, action *jobs.Action) error

Init pass parameters

func (*PruneTokensAction) Run

Run the actual action code

Directories

Path Synopsis
Package grpc spins an OpenID Connect Server using the coreos/dex implementation
Package grpc spins an OpenID Connect Server using the coreos/dex implementation
Package lang provides auth-related i18n strings
Package lang provides auth-related i18n strings
Package rest provides access to the TokenServiceApi
Package rest provides access to the TokenServiceApi
Package grpc spins an OpenID Connect Server using the coreos/dex implementation
Package grpc spins an OpenID Connect Server using the coreos/dex implementation

Jump to

Keyboard shortcuts

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