Documentation
¶
Index ¶
Constants ¶
View Source
const ( SubjectTokenClaimPrefix = "Subject-Token-Claim-" ActorTokenClaimPrefix = "Actor-Token-Claim-" EncodedSubjectTokenClaimPrefix = "Subject-Token-Encoded-Claim-" EncodedActorTokenClaimPrefix = "Actor-Token-Encoded-Claim-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client can delegate token validation to the Mise container.
type FakeMISEAdapter ¶
type Input ¶
type Input struct {
// OriginalUri is the Uri of the original request being validated.
OriginalUri string
// OriginalMethod is the method of the original request being validated.
OriginalMethod string
// OriginalIpAddress is the IP address of original request being validated.
OriginalIPAddress string
// AuthorizationHeader is the authorization header of the original request being validated.
AuthorizationHeader string
// ReturnAllActorClaims specifies whether to return all claims from the actor token.
ReturnAllActorClaims bool
// ReturnAllSubjectClaims specifies whether to return all claims from the subject token.
ReturnAllSubjectClaims bool
// ActorClaimsToReturn specifies the specific claims to return from the actor token if present.
ActorClaimsToReturn []string
// SubjectClaimsToReturn specifies the specific claims to return from the subject token.
SubjectClaimsToReturn []string
}
Input is the set of input options for Client.
type MISEAdapter ¶
type MISEAdapter interface {
IsAuthorized(ctx context.Context, r *http.Request) (bool, error)
IsReady() bool
}
func NewAuthorizer ¶
func NewAuthorizer(miseAddress string, log *logrus.Entry) MISEAdapter
func NewFakeAuthorizer ¶
type Result ¶
type Result struct {
// ActorClaims is the set of claims extracted from the actor token based on the input options.
ActorClaims map[string][]string
// SubjectClaims is the set of claims extracted from the subject token based on the input options.
SubjectClaims map[string][]string
// ErrorDescription is the description of the error from validating the token.
ErrorDescription []string
// WWWAuthenticate is the value of the WWWAuthenticate header when the request is unauthorized.
WWWAuthenticate []string
// StatusCode is the status code that the Mise container returns as a result of validating the token.
StatusCode int
}
Result is the authentication result.
Click to show internal directories.
Click to hide internal directories.