Documentation ¶
Index ¶
- Variables
- func ContextWithAccountID(ctx context.Context, accountID string) context.Context
- func ContextWithRequestID(ctx context.Context, requestID string) context.Context
- func ContextWithSessionID(ctx context.Context, sessionID string) context.Context
- func ContextWithTenantID(ctx context.Context, tenantID string) context.Context
- func ExtractAccountID(ctx context.Context) string
- func ExtractRequestID(ctx context.Context) string
- func ExtractSessionID(ctx context.Context) string
- func ExtractTenantID(ctx context.Context) string
- func ExtractTenantKey(ctx context.Context) string
- func IncomingHeaderMatcher(key string) (string, bool)
- func IsValidUUID(uid string) bool
- func KnownContextValueStrings(ctx context.Context) map[string]interface{}
- func KnownContextValues(ctx context.Context) map[interface{}]interface{}
- func OutgoingHeaderMatcher(key string) (string, bool)
- type CtxKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ValueMachineAccountConnectionID = CtxKey("machine-account-connection-id") ValueMachineAccountCertID = CtxKey("machine-account-cert-id") )
If a call is authenticated with a machine account, these hold info about the connection and cert that resolved that machine account.
View Source
var ( HeaderAsertoTenantID = CtxKey(textproto.CanonicalMIMEHeaderKey("Aserto-Tenant-Id")) HeaderAsertoAccountID = CtxKey(textproto.CanonicalMIMEHeaderKey("Aserto-Account-Id")) HeaderAsertoTenantKey = CtxKey(textproto.CanonicalMIMEHeaderKey("Aserto-Api-Key")) HeaderAsertoRequestID = CtxKey(textproto.CanonicalMIMEHeaderKey("Aserto-Request-Id")) HeaderAsertoSessionID = CtxKey(textproto.CanonicalMIMEHeaderKey("Aserto-Session-Id")) HeaderAsertoTenantIDLowercase = CtxKey(strings.ToLower(string(HeaderAsertoTenantID))) HeaderAsertoAccountIDLowercase = CtxKey(strings.ToLower(string(HeaderAsertoAccountID))) HeaderAsertoTenantKeyLowercase = CtxKey(strings.ToLower(string(HeaderAsertoTenantKey))) HeaderAsertoRequestIDLowercase = CtxKey(strings.ToLower(string(HeaderAsertoRequestID))) HeaderAsertoSessionIDLowercase = CtxKey(strings.ToLower(string(HeaderAsertoSessionID))) )
Functions ¶
func ContextWithAccountID ¶
func ContextWithRequestID ¶
func ContextWithSessionID ¶
func ContextWithTenantID ¶
func ExtractAccountID ¶
func ExtractRequestID ¶
func ExtractSessionID ¶
func ExtractTenantID ¶
func ExtractTenantKey ¶
func IncomingHeaderMatcher ¶
IncomingHeaderMatcher is a matcher that makes it so that HTTP clients do not have to prefix the header key with Grpc-Metadata-. see https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_your_gateway/#mapping-from-http-request-headers-to-grpc-client-metadata
func IsValidUUID ¶
func KnownContextValueStrings ¶
KnownContextValueStrings is the same as KnownContextValues, but uses string keys (useful for logging).
func KnownContextValues ¶
func OutgoingHeaderMatcher ¶
OutgoingHeaderMatcher filters headers that are allowed to reach the client.
Types ¶
Click to show internal directories.
Click to hide internal directories.