package credentials
import "google.golang.org/grpc/internal/credentials"
Package credentials defines APIs for parsing SPIFFE ID.
All APIs in this package are experimental.
Index ¶
- func AppendH2ToNextProtos(ps []string) []string
- func ClientHandshakeInfoFromContext(ctx context.Context) any
- func CloneTLSConfig(cfg *tls.Config) *tls.Config
- func NewClientHandshakeInfoContext(ctx context.Context, chi any) context.Context
- func NewRequestInfoContext(ctx context.Context, ri any) context.Context
- func RequestInfoFromContext(ctx context.Context) any
- func SPIFFEIDFromCert(cert *x509.Certificate) *url.URL
- func SPIFFEIDFromState(state tls.ConnectionState) *url.URL
- func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn
Functions ¶
func AppendH2ToNextProtos ¶
AppendH2ToNextProtos appends h2 to next protos.
func ClientHandshakeInfoFromContext ¶
ClientHandshakeInfoFromContext extracts the ClientHandshakeInfo from ctx.
func CloneTLSConfig ¶
CloneTLSConfig returns a shallow clone of the exported fields of cfg, ignoring the unexported sync.Once, which contains a mutex and must not be copied.
If cfg is nil, a new zero tls.Config is returned.
TODO: inline this function if possible.
func NewClientHandshakeInfoContext ¶
NewClientHandshakeInfoContext creates a context with chi.
func NewRequestInfoContext ¶
NewRequestInfoContext creates a context with ri.
func RequestInfoFromContext ¶
RequestInfoFromContext extracts the RequestInfo from ctx.
func SPIFFEIDFromCert ¶
func SPIFFEIDFromCert(cert *x509.Certificate) *url.URL
SPIFFEIDFromCert parses the SPIFFE ID from x509.Certificate. If the SPIFFE ID format is invalid, return nil with warning.
func SPIFFEIDFromState ¶
func SPIFFEIDFromState(state tls.ConnectionState) *url.URL
SPIFFEIDFromState parses the SPIFFE ID from State. If the SPIFFE ID format is invalid, return nil with warning.
func WrapSyscallConn ¶
WrapSyscallConn tries to wrap rawConn and newConn into a net.Conn that implements syscall.Conn. rawConn will be used to support syscall, and newConn will be used for read/write.
This function returns newConn if rawConn doesn't implement syscall.Conn.
Source Files ¶
credentials.go spiffe.go syscallconn.go util.go
Directories ¶
Path | Synopsis |
---|---|
internal/credentials/xds | Package xds contains non-user facing functionality of the xds credentials. |
- Version
- v1.70.0 (latest)
- Published
- Jan 23, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 7 minutes ago –
Tools for package owners.