Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Internal Auth Context Header, carries information of the // client that has been authenticated. // Where content itself will be of usual string format, which // is obtained by json marshaling of struct AuthInfo followed // by base64 encoding of the json marshaled content. // // This is usually Added by Auth Gateway, if present it // indicates that authentication is successfully performed // by Auth Gateway. HttpClientAuthContext = "Auth-Info" // grpc gateway will typically move the header to lowercase GrpcClientAuthContext = "auth-info" )
Variables ¶
This section is empty.
Functions ¶
func DeleteAuthInfoHeader ¶
delete the Auth info header from the given HTTP request
func ProcessAuthInfo ¶
Processes the headers available in context, to validate that the authentication is already performed
Types ¶
type AuthInfo ¶
type AuthInfo struct {
Realm string `json:"realm,omitempty"`
UserName string `json:"preferred_username"`
Email string `json:"email,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
FullName string `json:"name,omitempty"`
FirstName string `json:"given_name,omitempty"`
LastName string `json:"family_name,omitempty"`
SessionID string `json:"sid,omitempty"`
Roles []string `json:"roles,omitempty"`
IsRoot bool `json:"isRoot,omitempty"`
}
Auth construct obtained as part of the auth action being performed while processing a request, this is json tagged to allow passing the inforamtion internally in the system between the microservices we can validate entities like user, devices, service accounts etc
func GetAuthInfoFromContext ¶
gets Auth Info from Context available in the Http Request
Click to show internal directories.
Click to hide internal directories.