credentials

package
v0.0.0-...-1b3166d Latest Latest
Warning

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

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

Documentation

Overview

Package credentials loads certificates and validates user credentials.

Index

Constants

This section is empty.

Variables

View Source
var (
	TargetName = flag.String("target_name", "", "The target name used to verify the hostname returned by TLS handshake") // TargetName is a flag containing the hostname verfified by TLS handshake

)

Functions

func AuthorizeUser

func AuthorizeUser(ctx context.Context) (string, bool)

AuthorizeUser checks for valid credentials in the context Metadata.

func ClientCredentials

func ClientCredentials() []grpc.DialOption

ClientCredentials generates gRPC DialOptions for existing credentials.

func GetCAEntity

func GetCAEntity() *entity.Entity

GetCAEntity gets a CA entity from a CA file and private key.

func LoadCertificates

func LoadCertificates() ([]tls.Certificate, *x509.CertPool)

LoadCertificates loads certificates from files and exits if there's an error.

func ParseCertificates

func ParseCertificates() (*tls.Certificate, *x509.Certificate)

ParseCertificates gets certificates from files or generates them from the CA.

func ServerCredentials

func ServerCredentials() []grpc.ServerOption

ServerCredentials generates gRPC ServerOptions for existing credentials.

func SetTargetName

func SetTargetName(name string)

SetTargetName sets the targetName variable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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