package mxgateway import ( "crypto/tls" "strings" "time" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) // Options configures gateway connections. type Options struct { Endpoint string APIKey string Plaintext bool CACertFile string ServerNameOverride string DialTimeout time.Duration CallTimeout time.Duration TLSConfig *tls.Config TransportCredentials credentials.TransportCredentials DialOptions []grpc.DialOption } // RedactedAPIKey returns a display-safe representation of the configured API // key for diagnostics and CLI output. func (o Options) RedactedAPIKey() string { return RedactAPIKey(o.APIKey) } // RedactAPIKey hides credential material while keeping enough shape for // troubleshooting whether a key was supplied. func RedactAPIKey(apiKey string) string { if apiKey == "" { return "" } if len(apiKey) <= 8 { return "" } prefix, suffix := apiKey[:4], apiKey[len(apiKey)-4:] return prefix + strings.Repeat("*", len(apiKey)-8) + suffix }