security

package
v0.0.0-...-8813fe1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 *fiber.Ctx) error

func (*ApiKey) Provider

func (k *ApiKey) Provider() AuthType

func (*ApiKey) Scheme

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

type AuthType

type AuthType string
const (
	Credentials          = "credentials"
	BasicAuth   AuthType = "BasicAuth"
	BearerAuth  AuthType = "BearerAuth"
	ApiKeyAuth  AuthType = "ApiKeyAuth"
	OpenIDAuth  AuthType = "OpenIDAuth"
	OAuth2Auth  AuthType = "OAuth2Auth"
	CookieAuth  AuthType = "CookieAuth"
)

type Basic

type Basic struct {
	Security
}

func (*Basic) Authorize

func (b *Basic) Authorize(c *fiber.Ctx) error

func (*Basic) Provider

func (b *Basic) Provider() AuthType

func (*Basic) Scheme

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

type Bearer

type Bearer struct {
	Security
}

func (*Bearer) Authorize

func (b *Bearer) Authorize(c *fiber.Ctx) error

func (*Bearer) Provider

func (b *Bearer) Provider() AuthType

func (*Bearer) Scheme

func (b *Bearer) Scheme() *openapi3.SecurityScheme
type Cookie struct {
	Security
	Name string
}

func (*Cookie) Authorize

func (k *Cookie) Authorize(c *fiber.Ctx) error

func (*Cookie) Provider

func (k *Cookie) Provider() AuthType

func (*Cookie) Scheme

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

type ISecurity

type ISecurity interface {
	Authorize(c *fiber.Ctx) error
	Callback(c *fiber.Ctx, credentials interface{})
	Provider() AuthType
	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 *fiber.Ctx) error

func (*OAuth2) Provider

func (i *OAuth2) Provider() AuthType

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 *fiber.Ctx) error

func (*OpenID) Provider

func (i *OpenID) Provider() AuthType

func (*OpenID) Scheme

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

type Security

type Security struct {
	ISecurity
}

func (*Security) Callback

func (s *Security) Callback(c *fiber.Ctx, credentials interface{})

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