credentials

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic struct {
	// contains filtered or unexported fields
}

Basic defines a basic authentication mechanism that attaches a username and password to each request.

func NewBasicAuthentication

func NewBasicAuthentication(username, password string) *Basic

NewBasicAuthentication returns a value describing authentication credentials for a HTTP request.

func (*Basic) AddCredentials

func (c *Basic) AddCredentials(r *http.Request) *http.Request

AddCredentials includes the basic authentication credentials within a HTTP request.

type Bearer

type Bearer struct {
	// contains filtered or unexported fields
}

Bearer defines an authentication mechanism that attaches bearer token security credentials to each request.

func NewBearer

func NewBearer(token tokenFunc) *Bearer

NewBearer returns a value describing authentication credentials for a HTTP request.

func NewBearerWithStaticToken

func NewBearerWithStaticToken(token string) *Bearer

NewBearerWithStaticToken returns a value describing authentication credentials for a HTTP request.

func (*Bearer) AddCredentials

func (c *Bearer) AddCredentials(r *http.Request) *http.Request

AddCredentials includes the bearer authentication credentials within a HTTP request.

func (*Bearer) SetHeader

func (c *Bearer) SetHeader(header string)

SetHeader allows for the bearer authentication scheme to be used with a non-default header.

Jump to

Keyboard shortcuts

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