security

package
v0.0.0-...-1ef1c0e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Credentials = "credentials"
	BasicAuth   = "BasicAuth"
	BearerAuth  = "BearerAuth"
	ApiKeyAuth  = "ApiKeyAuth"
	OpenIDAuth  = "OpenIDAuth"
	OAuth2Auth  = "OAuth2Auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Security
	Name string
}

func (*ApiKey) Authorize

func (k *ApiKey) Authorize(c *gin.Context)

func (*ApiKey) Provider

func (k *ApiKey) Provider() string

func (*ApiKey) Scheme

func (k *ApiKey) Scheme() *openapi3.SecurityScheme

type Basic

type Basic struct {
	Security
}

func (*Basic) Authorize

func (b *Basic) Authorize(c *gin.Context)

func (*Basic) Provider

func (b *Basic) Provider() string

func (*Basic) Scheme

func (b *Basic) Scheme() *openapi3.SecurityScheme

type Bearer

type Bearer struct {
	Security
}

func (*Bearer) Authorize

func (b *Bearer) Authorize(c *gin.Context)

func (*Bearer) Provider

func (b *Bearer) Provider() string

func (*Bearer) Scheme

func (b *Bearer) Scheme() *openapi3.SecurityScheme

type ISecurity

type ISecurity interface {
	Authorize(g *gin.Context)
	Callback(c *gin.Context, credentials any, err error)
	Provider() string
	Scheme() *openapi3.SecurityScheme
}

type OAuth2

type OAuth2 struct {
	Security
	AuthorizationURL string
	TokenURL         string
	RefreshURL       string
	Scopes           map[string]string
}

func (*OAuth2) Authorize

func (i *OAuth2) Authorize(c *gin.Context)

func (*OAuth2) Provider

func (i *OAuth2) Provider() string

func (*OAuth2) Scheme

func (i *OAuth2) Scheme() *openapi3.SecurityScheme

type OpenID

type OpenID struct {
	Security
	ConnectUrl string
}

func (*OpenID) Authorize

func (i *OpenID) Authorize(c *gin.Context)

func (*OpenID) Provider

func (i *OpenID) Provider() string

func (*OpenID) Scheme

func (i *OpenID) Scheme() *openapi3.SecurityScheme

type Security

type Security struct {
	ISecurity
}

func (*Security) Callback

func (s *Security) Callback(c *gin.Context, credentials any, err error)

type User

type User struct {
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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