auth

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

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceExpire = 180 * time.Second
)

Variables

This section is empty.

Functions

func AuthorizeRequest

func AuthorizeRequest(request sip.Request, response sip.Response, user, password sip.MaybeString) error

Types

type AuthSession

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

AuthSession .

type Authorization

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

currently only Digest and MD5

func AuthFromValue

func AuthFromValue(value string) *Authorization

func (*Authorization) CalcResponse

func (auth *Authorization) CalcResponse(request sip.Request) *Authorization

calculates Authorization response https://www.ietf.org/rfc/rfc2617.txt

func (*Authorization) SetMethod

func (auth *Authorization) SetMethod(method string) *Authorization

func (*Authorization) SetPassword

func (auth *Authorization) SetPassword(password string) *Authorization

func (*Authorization) SetUri

func (auth *Authorization) SetUri(uri string) *Authorization

func (*Authorization) SetUsername

func (auth *Authorization) SetUsername(username string) *Authorization

func (*Authorization) String

func (auth *Authorization) String() string

type Authorizer

type Authorizer interface {
	AuthorizeRequest(request sip.Request, response sip.Response) error
}

type ClientAuthorizer

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

func NewClientAuthorizer

func NewClientAuthorizer(u string, p string) *ClientAuthorizer

func (*ClientAuthorizer) AuthorizeRequest

func (auth *ClientAuthorizer) AuthorizeRequest(request sip.Request, response sip.Response) error

type RequestCredentialCallback

type RequestCredentialCallback func(username string) (password string, ha1 string, err error)

type ServerAuthorizer

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

ServerAuthorizer Proxy-Authorization | WWW-Authenticate

func NewServerAuthorizer

func NewServerAuthorizer(callback RequestCredentialCallback, realm string, authInt bool) *ServerAuthorizer

NewServerAuthorizer .

func (*ServerAuthorizer) Authenticate

func (auth *ServerAuthorizer) Authenticate(request sip.Request, tx sip.ServerTransaction) (string, bool)

ServerAuthorizer handles Authenticate requests.

Jump to

Keyboard shortcuts

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