auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizationHeader = "Authorization"
View Source
const BearerPrefix = "Bearer"

Variables

This section is empty.

Functions

This section is empty.

Types

type BearerSecurityScheme

type BearerSecurityScheme struct {
	Type        Type
	Scheme      SchemeName
	In          SchemeIn
	Name        string
	ValidValue  *string
	TokenWriter *jwt.JWTWriter
	AttackValue string
}

func NewAuthorizationBearerSecurityScheme

func NewAuthorizationBearerSecurityScheme(name string, value *string) *BearerSecurityScheme

func (*BearerSecurityScheme) GetAttackValue

func (ss *BearerSecurityScheme) GetAttackValue() interface{}

func (*BearerSecurityScheme) GetCookies

func (ss *BearerSecurityScheme) GetCookies() []*http.Cookie

func (*BearerSecurityScheme) GetHeaders

func (ss *BearerSecurityScheme) GetHeaders() http.Header

func (*BearerSecurityScheme) GetValidValue

func (ss *BearerSecurityScheme) GetValidValue() interface{}

func (*BearerSecurityScheme) GetValidValueWriter added in v0.3.1

func (ss *BearerSecurityScheme) GetValidValueWriter() interface{}

func (*BearerSecurityScheme) SetAttackValue

func (ss *BearerSecurityScheme) SetAttackValue(v interface{})

type NoAuthSecurityScheme added in v0.3.1

type NoAuthSecurityScheme struct{}

func NewNoAuthSecurityScheme added in v0.3.1

func NewNoAuthSecurityScheme() *NoAuthSecurityScheme

func (*NoAuthSecurityScheme) GetAttackValue added in v0.3.1

func (ss *NoAuthSecurityScheme) GetAttackValue() interface{}

func (*NoAuthSecurityScheme) GetCookies added in v0.3.1

func (ss *NoAuthSecurityScheme) GetCookies() []*http.Cookie

func (*NoAuthSecurityScheme) GetHeaders added in v0.3.1

func (ss *NoAuthSecurityScheme) GetHeaders() http.Header

func (*NoAuthSecurityScheme) GetValidValue added in v0.3.1

func (ss *NoAuthSecurityScheme) GetValidValue() interface{}

func (*NoAuthSecurityScheme) GetValidValueWriter added in v0.3.1

func (ss *NoAuthSecurityScheme) GetValidValueWriter() interface{}

func (*NoAuthSecurityScheme) SetAttackValue added in v0.3.1

func (ss *NoAuthSecurityScheme) SetAttackValue(v interface{})

type SchemeIn

type SchemeIn string
const (
	InHeader  SchemeIn = "header"
	InCookie  SchemeIn = "cookie"
	InUnknown SchemeIn = "unknown"
)

type SchemeName

type SchemeName string
const (
	BasicScheme  SchemeName = "basic"
	BearerScheme SchemeName = "bearer"
	DigestScheme SchemeName = "digest"
	OAuthScheme  SchemeName = "oauth"
	PrivateToken SchemeName = "privateToken"

	NoneScheme SchemeName = "none"
)

Values are registred in the IANA Authentication Scheme registry https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml

func (*SchemeName) Set

func (s *SchemeName) Set(v string) error

func (*SchemeName) String

func (s *SchemeName) String() string

func (*SchemeName) Type

func (e *SchemeName) Type() string

type SecurityScheme

type SecurityScheme interface {
	GetHeaders() http.Header
	GetCookies() []*http.Cookie
	GetValidValue() interface{}
	GetValidValueWriter() interface{}
	SetAttackValue(v interface{})
	GetAttackValue() interface{}
}

type Type

type Type string
const (
	HttpType      Type = "http"
	OAuth2        Type = "oauth2"
	OpenIdConnect Type = "openIdConnect"
	ApiKey        Type = "apiKey"
)

Jump to

Keyboard shortcuts

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