oauth

package
v4.4.3-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package oauth provides OAuth service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDAO

func NewDAO(ctx context.Context, o dao.DAO) (dao.DAO, error)

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 {
	common.RuntimeHolder
}

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, 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 web spins an OpenID Connect Server using the coreos/dex implementation
Package web 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