Documentation ¶
Index ¶
- Constants
- func GetSecuritySchemeUniqueName(securityScheme *SecurityScheme) string
- func NewErrTokenFormatShouldBeJWT() error
- type InCookieValue
- type InHeaderValue
- type InQueryValue
- type OAuthConfig
- type OAuthFlow
- type OAuthValue
- type SchemeIn
- type SchemeName
- type SecurityScheme
- func MustNewAPIKeySecurityScheme(name string, in SchemeIn, value *string) *SecurityScheme
- func MustNewAuthorizationBearerSecurityScheme(name string, value *string) *SecurityScheme
- func MustNewNoAuthSecurityScheme() *SecurityScheme
- func MustNewOAuthSecurityScheme(name string, in *SchemeIn, value *OAuthValue, config *OAuthConfig) *SecurityScheme
- func NewAPIKeySecurityScheme(name string, in SchemeIn, value *string) (*SecurityScheme, error)
- func NewAuthorizationBearerSecurityScheme(name string, value *string) (*SecurityScheme, error)
- func NewNoAuthSecurityScheme() (*SecurityScheme, error)
- func NewOAuthSecurityScheme(name string, in *SchemeIn, value *OAuthValue, config *OAuthConfig) (*SecurityScheme, error)
- func NewSecurityScheme(name string, config interface{}, t Type, scheme SchemeName, in *SchemeIn, ...) (*SecurityScheme, error)
- func (securityScheme *SecurityScheme) GetAttackValue() interface{}
- func (securityScheme *SecurityScheme) GetConfig() interface{}
- func (securityScheme *SecurityScheme) GetCookies() []*http.Cookie
- func (securityScheme *SecurityScheme) GetHeaders() http.Header
- func (securityScheme *SecurityScheme) GetIn() *SchemeIn
- func (securityScheme *SecurityScheme) GetName() string
- func (securityScheme *SecurityScheme) GetScheme() SchemeName
- func (securityScheme *SecurityScheme) GetToken() string
- func (securityScheme *SecurityScheme) GetTokenFormat() *TokenFormat
- func (securityScheme *SecurityScheme) GetType() Type
- func (securityScheme *SecurityScheme) GetValidValue() interface{}
- func (securityScheme *SecurityScheme) HasValidValue() bool
- func (securityScheme *SecurityScheme) SetAttackValue(value interface{}) error
- func (securityScheme *SecurityScheme) SetTokenFormat(tokenFormat TokenFormat) error
- func (securityScheme *SecurityScheme) SetValidValue(value interface{}) error
- type SecuritySchemesMap
- type TokenFormat
- type Type
Constants ¶
View Source
const AuthorizationHeader = "Authorization"
View Source
const BearerPrefix = "Bearer"
Variables ¶
This section is empty.
Functions ¶
func GetSecuritySchemeUniqueName ¶ added in v0.8.3
func GetSecuritySchemeUniqueName(securityScheme *SecurityScheme) string
func NewErrTokenFormatShouldBeJWT ¶ added in v0.8.4
func NewErrTokenFormatShouldBeJWT() error
Types ¶
type InCookieValue ¶ added in v0.8.4
type InHeaderValue ¶ added in v0.8.4
type InHeaderValue = string
type InQueryValue ¶ added in v0.8.4
type InQueryValue = string
type OAuthConfig ¶ added in v0.6.1
type OAuthValue ¶ added in v0.8.4
type OAuthValue struct { AccessToken string `json:"access_token" yaml:"access_token"` RefreshToken *string `json:"refresh_token" yaml:"refresh_token"` ExpiresIn *time.Time `json:"expires_in" yaml:"expires_in"` Scope *string `json:"scope" yaml:"scope"` }
func NewOAuthValue ¶ added in v0.8.4
func (*OAuthValue) GetAccessToken ¶ added in v0.8.4
func (value *OAuthValue) GetAccessToken() string
func (*OAuthValue) SetAccessToken ¶ added in v0.8.4
func (value *OAuthValue) SetAccessToken(accessToken string)
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) String ¶
func (s *SchemeName) String() string
func (*SchemeName) Type ¶
func (e *SchemeName) Type() string
type SecurityScheme ¶
type SecurityScheme struct { Type Type `json:"type" yaml:"type"` Scheme SchemeName `json:"scheme" yaml:"scheme"` In *SchemeIn `json:"in" yaml:"in"` TokenFormat *TokenFormat `json:"token_format" yaml:"token_format"` Name string `json:"name" yaml:"name"` Config interface{} `json:"config" yaml:"config"` ValidValue interface{} `json:"-" yaml:"-"` AttackValue interface{} `json:"-" yaml:"-"` }
func MustNewAPIKeySecurityScheme ¶ added in v0.8.4
func MustNewAPIKeySecurityScheme(name string, in SchemeIn, value *string) *SecurityScheme
func MustNewAuthorizationBearerSecurityScheme ¶ added in v0.8.4
func MustNewAuthorizationBearerSecurityScheme(name string, value *string) *SecurityScheme
func MustNewNoAuthSecurityScheme ¶ added in v0.8.4
func MustNewNoAuthSecurityScheme() *SecurityScheme
func MustNewOAuthSecurityScheme ¶ added in v0.8.4
func MustNewOAuthSecurityScheme(name string, in *SchemeIn, value *OAuthValue, config *OAuthConfig) *SecurityScheme
func NewAPIKeySecurityScheme ¶ added in v0.8.4
func NewAPIKeySecurityScheme(name string, in SchemeIn, value *string) (*SecurityScheme, error)
func NewAuthorizationBearerSecurityScheme ¶
func NewAuthorizationBearerSecurityScheme(name string, value *string) (*SecurityScheme, error)
func NewNoAuthSecurityScheme ¶ added in v0.3.1
func NewNoAuthSecurityScheme() (*SecurityScheme, error)
func NewOAuthSecurityScheme ¶ added in v0.6.1
func NewOAuthSecurityScheme(name string, in *SchemeIn, value *OAuthValue, config *OAuthConfig) (*SecurityScheme, error)
func NewSecurityScheme ¶ added in v0.8.4
func NewSecurityScheme(name string, config interface{}, t Type, scheme SchemeName, in *SchemeIn, tokenFormat *TokenFormat) (*SecurityScheme, error)
func (*SecurityScheme) GetAttackValue ¶
func (securityScheme *SecurityScheme) GetAttackValue() interface{}
func (*SecurityScheme) GetConfig ¶ added in v0.8.4
func (securityScheme *SecurityScheme) GetConfig() interface{}
func (*SecurityScheme) GetCookies ¶
func (securityScheme *SecurityScheme) GetCookies() []*http.Cookie
func (*SecurityScheme) GetHeaders ¶
func (securityScheme *SecurityScheme) GetHeaders() http.Header
func (*SecurityScheme) GetIn ¶ added in v0.8.0
func (securityScheme *SecurityScheme) GetIn() *SchemeIn
func (*SecurityScheme) GetName ¶ added in v0.8.0
func (securityScheme *SecurityScheme) GetName() string
func (*SecurityScheme) GetScheme ¶ added in v0.8.0
func (securityScheme *SecurityScheme) GetScheme() SchemeName
func (*SecurityScheme) GetToken ¶ added in v0.8.4
func (securityScheme *SecurityScheme) GetToken() string
func (*SecurityScheme) GetTokenFormat ¶ added in v0.8.4
func (securityScheme *SecurityScheme) GetTokenFormat() *TokenFormat
func (*SecurityScheme) GetType ¶ added in v0.8.0
func (securityScheme *SecurityScheme) GetType() Type
func (*SecurityScheme) GetValidValue ¶
func (securityScheme *SecurityScheme) GetValidValue() interface{}
func (*SecurityScheme) HasValidValue ¶ added in v0.6.0
func (securityScheme *SecurityScheme) HasValidValue() bool
func (*SecurityScheme) SetAttackValue ¶
func (securityScheme *SecurityScheme) SetAttackValue(value interface{}) error
func (*SecurityScheme) SetTokenFormat ¶ added in v0.8.4
func (securityScheme *SecurityScheme) SetTokenFormat(tokenFormat TokenFormat) error
func (*SecurityScheme) SetValidValue ¶ added in v0.8.4
func (securityScheme *SecurityScheme) SetValidValue(value interface{}) error
type SecuritySchemesMap ¶ added in v0.6.1
type SecuritySchemesMap map[string]*SecurityScheme
type TokenFormat ¶ added in v0.8.4
type TokenFormat string
const ( JWTTokenFormat TokenFormat = "jwt" NoneTokenFormat TokenFormat = "none" )
Click to show internal directories.
Click to hide internal directories.