auth

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// For authentication of runner and store
	Secret string

	// disable authentication while development
	IsDev bool
}

Config is the object used to configure the auth module

type JWTAlgorithm

type JWTAlgorithm string

JWTAlgorithm describes the jwt algorithm to use

const (
	// RSA256 is used for rsa256 algorithm
	RSA256 JWTAlgorithm = "rsa256"

	// HS256 is used for hs256 algorithm
	HS256 JWTAlgorithm = "hs256"
)

type Module

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

Module manages the auth module

func New

func New(config *Config) (*Module, error)

New creates a new instance of the auth module

func (*Module) VerifyToken

func (m *Module) VerifyToken(token string) (map[string]interface{}, error)

VerifyToken checks if the token is valid and returns the token claims

Jump to

Keyboard shortcuts

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