Documentation ¶
Overview ¶
Package credentials loads certificates and validates user credentials.
Index ¶
- Variables
- func AuthorizeUser(ctx context.Context) (string, bool)
- func ClientCredentials() []grpc.DialOption
- func GetCAEntity() *entity.Entity
- func LoadCertificates() ([]tls.Certificate, *x509.CertPool)
- func ParseCertificates() (*tls.Certificate, *x509.Certificate)
- func ServerCredentials() []grpc.ServerOption
- func SetTargetName(name string)
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 ¶
AuthorizeUser checks for valid credentials in the context Metadata.
func ClientCredentials ¶
func ClientCredentials() []grpc.DialOption
ClientCredentials generates gRPC DialOptions for existing credentials.
func GetCAEntity ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.