gitalyauth

package
v1.87.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken added in v0.96.1

func CheckToken(ctx context.Context, secret string, targetTime time.Time) error

CheckToken checks the 'authentication' header of incoming gRPC metadata in ctx. It returns nil if and only if the token matches secret.

func RPCCredentials

func RPCCredentials(token string) credentials.PerRPCCredentials

RPCCredentials can be used with grpc.WithPerRPCCredentials to create a grpc.DialOption that inserts the supplied token for authentication with a Gitaly server.

func RPCCredentialsV2 added in v0.120.0

func RPCCredentialsV2(token string) credentials.PerRPCCredentials

RPCCredentialsV2 can be used with grpc.WithPerRPCCredentials to create a grpc.DialOption that inserts an HMAC token with the current timestamp for authentication with a Gitaly server.

Types

type AuthInfo added in v0.120.0

type AuthInfo struct {
	Version       string
	SignedMessage []byte
	Message       string
}

AuthInfo contains the authentication information coming from a request

func ExtractAuthInfo added in v0.120.0

func ExtractAuthInfo(ctx context.Context) (*AuthInfo, error)

ExtractAuthInfo returns an `AuthInfo` with the data extracted from `ctx`

Jump to

Keyboard shortcuts

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