grpccredentials

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MTLSClientCredentials

func MTLSClientCredentials(svid x509svid.Source, bundle x509bundle.Source, authorizer tlsconfig.Authorizer, opts ...tlsconfig.Option) credentials.TransportCredentials

MTLSClientCredentials returns TLS credentials which present an X509-SVID to the server and verifies and authorizes the server X509-SVID.

func MTLSServerCredentials

func MTLSServerCredentials(svid x509svid.Source, bundle x509bundle.Source, authorizer tlsconfig.Authorizer, opts ...tlsconfig.Option) credentials.TransportCredentials

MTLSServerCredentials returns TLS credentials which present an X509-SVID to the client and requires, verifies, and authorizes client X509-SVIDs.

func MTLSWebClientCredentials

func MTLSWebClientCredentials(svid x509svid.Source, roots *x509.CertPool, opts ...tlsconfig.Option) credentials.TransportCredentials

MTLSWebClientCredentials returns TLS credentials which present an X509-SVID to the server and verifies the server certificate using provided roots (or the system roots if nil).

func MTLSWebServerCredentials

func MTLSWebServerCredentials(cert *tls.Certificate, bundle x509bundle.Source, authorizer tlsconfig.Authorizer, opts ...tlsconfig.Option) credentials.TransportCredentials

MTLSWebServerCredentials returns TLS credentials which present a web server certificate to the client and requires, verifies, and authorizes client X509-SVIDs.

func PeerIDFromContext

func PeerIDFromContext(ctx context.Context) (spiffeid.ID, bool)

PeerIDFromContext returns the SPIFFE ID from the peer information on the context. If the peer does not have a SPIFFE ID, or the credentials for the connection were not provided by this package, the function returns false.

func PeerIDFromPeer

func PeerIDFromPeer(p *peer.Peer) (spiffeid.ID, bool)

PeerIDFromPeer returns the SPIFFE ID for the peer information on the context. If the peer does not have a SPIFFE ID, or the credentials for the connection were not provided by this package, the function returns false.

func TLSClientCredentials

func TLSClientCredentials(bundle x509bundle.Source, authorizer tlsconfig.Authorizer, opts ...tlsconfig.Option) credentials.TransportCredentials

TLSClientCredentials returns TLS credentials which verify and authorize the server X509-SVID.

func TLSServerCredentials

func TLSServerCredentials(svid x509svid.Source, opts ...tlsconfig.Option) credentials.TransportCredentials

TLSServerCredentials returns TLS credentials which present an X509-SVID to the client and does not require or verify client certificates.

Types

This section is empty.

Jump to

Keyboard shortcuts

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