security

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 1 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 {
	// Name of the header to be used.
	Name string
}

func (ApiKey) Provider

func (k ApiKey) Provider() AuthProviderType

func (ApiKey) Scheme

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

type AuthProviderType added in v0.1.1

type AuthProviderType string
const (
	AuthProviderTypeBasic  AuthProviderType = "Basic"
	AuthProviderTypeApiKey AuthProviderType = "ApiKey"
	AuthProviderTypeBearer AuthProviderType = "Bearer"
	AuthProviderTypeOAuth2 AuthProviderType = "OAuth2"
	AuthProviderTypeOIDC   AuthProviderType = "OIDC"
)

type Basic

type Basic struct{}

func (Basic) Provider

func (b Basic) Provider() AuthProviderType

func (Basic) Scheme

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

type Bearer

type Bearer struct{}

func (Bearer) Provider

func (b Bearer) Provider() AuthProviderType

func (Bearer) Scheme

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

type OAuth2

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

func (OAuth2) Provider

func (i OAuth2) Provider() AuthProviderType

func (OAuth2) Scheme

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

type OpenID

type OpenID struct {
	ConnectUrl string
}

func (OpenID) Provider

func (i OpenID) Provider() AuthProviderType

func (OpenID) Scheme

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

type Security

type Security interface {
	Provider() AuthProviderType
	Scheme() *openapi3.SecurityScheme
}

type User

type User struct {
	// Username basic auth username
	Username string

	// Password basic auth password
	Password string
}

Jump to

Keyboard shortcuts

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