auth

package
v0.0.0-...-b349366 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 3 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenCredentials

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

TokenCredentials RPC Credentials

func WithStaticToken

func WithStaticToken(token string) *TokenCredentials

WithStaticToken injects a static token on each request

func WithTokenFunc

func WithTokenFunc(k string, tokenFunc func(v string) string) *TokenCredentials

WithTokenFunc returns TokenCredentials that execute the tokenFunc on each request The value of v sent to the tokenFunk is the MD value of the supplied k

func (*TokenCredentials) DialOption

func (c *TokenCredentials) DialOption() grpc.DialOption

DialOption returns a DialOption for the TokenCredentials

func (*TokenCredentials) GetRequestMetadata

func (c *TokenCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata implements credentials.PerRPCCredentials

func (*TokenCredentials) RequireTransportSecurity

func (c *TokenCredentials) RequireTransportSecurity() bool

RequireTransportSecurity implements credentials.PerRPCCredentials

func (*TokenCredentials) WithInsecure

func (c *TokenCredentials) WithInsecure() *TokenCredentials

WithInsecure returns a copy of the TokenCredentials, allowing insecure transport

Jump to

Keyboard shortcuts

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