bufconnect

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Overview

Package bufconnect provides buf-specific Connect functionality.

Index

Constants

View Source
const (
	// AuthenticationHeader is the standard OAuth header used for authenticating
	// a user. Ignore the misnomer.
	AuthenticationHeader = "Authorization"
	// AuthenticationTokenPrefix is the standard OAuth token prefix.
	// We use it for familiarity.
	AuthenticationTokenPrefix = "Bearer "
	// CliVersionHeaderName is the name of the header carrying the buf CLI version.
	CliVersionHeaderName = "buf-version"
	// DefaultRemote is the default remote if none can be inferred from a module name.
	DefaultRemote = "buf.build"
)

Variables

This section is empty.

Functions

func NewAuthorizationInterceptorProvider

func NewAuthorizationInterceptorProvider(container appflag.Container) func(string) connect.UnaryInterceptorFunc

NewAuthorizationInterceptorProvider returns a new provider function which, when invoked, returns an interceptor which will look up an auth token by address and set it into the request header. This is used for registry providers where the token is looked up by the client address at the time of client construction (i.e. for clients where a user is already authenticated and the token is stored in .netrc)

Note that the interceptor returned from this provider is always applied LAST in the series of interceptors added to a client.

func NewAuthorizationInterceptorProviderWithToken

func NewAuthorizationInterceptorProviderWithToken(token string) func(string) connect.UnaryInterceptorFunc

NewAuthorizationInterceptorProviderWithToken returns a new provider function which, when invoked, returns an interceptor which sets the provided auth token into the request header. This is used for registry providers where the token is known at provider creation (i.e. when logging in and explicitly pasting a token into stdin

Note that the interceptor returned from this provider is always applied LAST in the series of interceptors added to a client.

func NewSetCLIVersionInterceptor

func NewSetCLIVersionInterceptor(version string) connect.UnaryInterceptorFunc

NewSetCLIVersionInterceptor returns a new Connect Interceptor that sets the Buf CLI version into all request headers

Types

This section is empty.

Jump to

Keyboard shortcuts

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