auth

package
v1.4.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultAccesskeyStorage

func GetDefaultAccesskeyStorage() filter.AccessKeyStorage

func GetDefaultAuthenticator

func GetDefaultAuthenticator() filter.Authenticator

func IsEmpty

func IsEmpty(s string, allowSpace bool) bool

func Sign

func Sign(metadata, key string) string

Sign get a signature string with given information, such as metadata or parameters

func SignWithParams

func SignWithParams(params []interface{}, metadata, key string) (string, error)

Types

type ConsumerSignFilter

type ConsumerSignFilter struct {
}

ConsumerSignFilter This filter is working for signing the request on consumer side

func (*ConsumerSignFilter) Invoke

func (csf *ConsumerSignFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result

func (*ConsumerSignFilter) OnResponse

func (csf *ConsumerSignFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result

type DefaultAccesskeyStorage

type DefaultAccesskeyStorage struct {
}

DefaultAccesskeyStorage The default implementation of AccesskeyStorage

func (*DefaultAccesskeyStorage) GetAccessKeyPair

func (storage *DefaultAccesskeyStorage) GetAccessKeyPair(invocation protocol.Invocation, url *common.URL) *filter.AccessKeyPair

GetAccessKeyPair get AccessKeyPair from url by the key "accessKeyId" and "secretAccessKey"

type DefaultAuthenticator

type DefaultAuthenticator struct {
}

DefaultAuthenticator The default implemetation of Authenticator

func (*DefaultAuthenticator) Authenticate

func (authenticator *DefaultAuthenticator) Authenticate(invocation protocol.Invocation, url *common.URL) error

Authenticate This method verifies whether the signature sent by the requester is correct

func (*DefaultAuthenticator) Sign

func (authenticator *DefaultAuthenticator) Sign(invocation protocol.Invocation, url *common.URL) error

Sign add the signature for the invocation

type ProviderAuthFilter

type ProviderAuthFilter struct {
}

ProviderAuthFilter This filter is used to verify the correctness of the signature on provider side

func (*ProviderAuthFilter) Invoke

func (paf *ProviderAuthFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result

func (*ProviderAuthFilter) OnResponse

func (paf *ProviderAuthFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result

Jump to

Keyboard shortcuts

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