auth

package
v3.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 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

GetDefaultAccesskeyStorage initiates an empty DefaultAccesskeyStorage

func GetDefaultAuthenticator

func GetDefaultAuthenticator() filter.Authenticator

GetDefaultAuthenticator creates an empty DefaultAuthenticator instance

func IsEmpty

func IsEmpty(s string, allowSpace bool) bool

IsEmpty verify whether the inputted string is empty

func Sign

func Sign(metadata, key string) string

Sign gets a signature string with given bytes

func SignWithParams

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

SignWithParams returns a signature with giving params and metadata.

Types

type ConsumerSignFilter

type ConsumerSignFilter struct{}

ConsumerSignFilter signs the request on consumer side

func (*ConsumerSignFilter) Invoke

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

Invoke retrieves the configured Authenticator to add signature to invocation

func (*ConsumerSignFilter) OnResponse

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

OnResponse dummy process, returns the result directly

type DefaultAccesskeyStorage

type DefaultAccesskeyStorage struct{}

DefaultAccesskeyStorage is the default implementation of AccesskeyStorage

func (*DefaultAccesskeyStorage) GetAccessKeyPair

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

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

type DefaultAuthenticator

type DefaultAuthenticator struct{}

DefaultAuthenticator is the default implementation of Authenticator

func (*DefaultAuthenticator) Authenticate

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

Authenticate 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 adds the signature to the invocation

type ProviderAuthFilter

type ProviderAuthFilter struct{}

ProviderAuthFilter verifies 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

Invoke retrieves the configured Authenticator to verify the signature in an invocation

func (*ProviderAuthFilter) OnResponse

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

OnResponse dummy process, returns the result directly

Jump to

Keyboard shortcuts

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