auth

package
v0.0.0-...-12382fa Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// Basic ...
	Basic = "Basic"
	// Bearer ...
	Bearer = "Bearer"
	// APIKey ...
	APIKey = "APIKey"
	// APIKeyScannerAdapter ...
	APIKeyScannerAdapter = "X-ScannerAdapter-API-Key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Authorize(req *http.Request) error
}

Authorizer defines operation for authorizing the requests

func GetAuthorizer

func GetAuthorizer(auth, cred string) (Authorizer, error)

GetAuthorizer is a factory method for getting an authorizer based on the given auth type

func NewAPIKeyAuthorizer

func NewAPIKeyAuthorizer(key, accessCred string) Authorizer

NewAPIKeyAuthorizer news a apiKeyAuthorizer

func NewBasicAuth

func NewBasicAuth(accessCred string) Authorizer

NewBasicAuth basic authorizer

func NewBearerAuth

func NewBearerAuth(accessCred string) Authorizer

NewBearerAuth create bearer authorizer

func NewNoAuth

func NewNoAuth() Authorizer

NewNoAuth creates a noAuth authorizer

Jump to

Keyboard shortcuts

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