package
0.27.274
Repository: https://github.com/effective-security/porto.git
Documentation: pkg.go.dev

# Functions

AddToContext returns a new golang context that adds `rq` as the request context.
BasicAuthFromRequest returns client id from Basic authentication, which is in base64encode(id:secret) form.
ClientIPFromRequest return client's real public IP address from http request headers.
FromContext extracts the RequestContext stored inside a go context.
FromRequest returns the full context ascocicated with this http request.
GuestIdentityForContext always returns "guest" for the role.
GuestIdentityMapper always returns "guest" for the role.
NewAuthUnaryInterceptor returns grpc.UnaryServerInterceptor that identity to the context.
NewContextHandler returns a handler that will extact the role & contextID from the request and stash them away in the request context for later handlers to use.
NewIdentity returns a new Identity instance with the indicated role.
NewRequestContext creates a request context with a specific identity.
WithTestIdentity is used in unit tests to set HTTP request identity.

# Constants

GuestRoleName is default role name for guest.

# Structs

RequestContext represents user contextual information about a request being processed by the server, it includes identity, CorrelationID [for cross system request correlation].

# Interfaces

Context represents user contextual information about a request being processed by the server, it includes identity, CorrelationID [for cross system request correlation].
Identity contains information about the identity of an API caller.

# Type aliases

ProviderFromContext returns Identity from supplied context.
ProviderFromRequest returns Identity from supplied HTTP request.