v1

package
v1.6.4-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIKeyHeader      = "X-Api-Key"
	BouncerContextKey = "bouncer_info"
)
View Source
const MachineIDKey = "id"

Variables

This section is empty.

Functions

func Authorizator

func Authorizator(data interface{}, c *gin.Context) bool

func GenerateAPIKey

func GenerateAPIKey(n int) (string, error)

func HashSHA512

func HashSHA512(str string) string

func IdentityHandler

func IdentityHandler(c *gin.Context) interface{}

func PayloadFunc

func PayloadFunc(data interface{}) jwt.MapClaims

func Unauthorized

func Unauthorized(c *gin.Context, code int, message string)

Types

type APIKey

type APIKey struct {
	HeaderName string
	DbClient   *database.Client
	TlsAuth    *TLSAuth
}

func NewAPIKey

func NewAPIKey(dbClient *database.Client) *APIKey

func (*APIKey) MiddlewareFunc

func (a *APIKey) MiddlewareFunc() gin.HandlerFunc

type CRLChecker added in v1.6.3

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

func NewCRLChecker added in v1.6.3

func NewCRLChecker(crlPath string, onLoad func(), logger *log.Entry) (*CRLChecker, error)

type JWT

type JWT struct {
	Middleware *jwt.GinJWTMiddleware
	DbClient   *database.Client
	TlsAuth    *TLSAuth
}

func NewJWT

func NewJWT(dbClient *database.Client) (*JWT, error)

func (*JWT) Authenticator

func (j *JWT) Authenticator(c *gin.Context) (interface{}, error)

type Middlewares

type Middlewares struct {
	APIKey *APIKey
	JWT    *JWT
}

func NewMiddlewares

func NewMiddlewares(dbClient *database.Client) (*Middlewares, error)

type OCSPChecker added in v1.6.3

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

func NewOCSPChecker added in v1.6.3

func NewOCSPChecker(logger *log.Entry) *OCSPChecker

type RevocationCache added in v1.6.3

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

func NewRevocationCache added in v1.6.3

func NewRevocationCache(expiration time.Duration, logger *log.Entry) *RevocationCache

func (*RevocationCache) Empty added in v1.6.3

func (rc *RevocationCache) Empty()

func (*RevocationCache) Get added in v1.6.3

func (rc *RevocationCache) Get(cert *x509.Certificate) (error, bool)

func (*RevocationCache) Set added in v1.6.3

func (rc *RevocationCache) Set(cert *x509.Certificate, err error)

type TLSAuth added in v1.4.0

type TLSAuth struct {
	AllowedOUs []string
	// contains filtered or unexported fields
}

func NewTLSAuth added in v1.4.0

func NewTLSAuth(allowedOus []string, crlPath string, cacheExpiration time.Duration, logger *log.Entry) (*TLSAuth, error)

func (*TLSAuth) ValidateCert added in v1.4.0

func (ta *TLSAuth) ValidateCert(c *gin.Context) (string, error)

Jump to

Keyboard shortcuts

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