forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
31 lines (24 loc) · 915 Bytes
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package authorizer
import (
"net/http"
"k8s.io/kubernetes/pkg/apiserver/request"
"k8s.io/kubernetes/pkg/auth/authorizer"
"k8s.io/kubernetes/pkg/util/sets"
)
type SubjectLocator interface {
GetAllowedSubjects(attributes authorizer.Attributes) (sets.String, sets.String, error)
}
type AuthorizationAttributeBuilder interface {
GetAttributes(request *http.Request) (authorizer.Attributes, error)
}
type RequestInfoFactory interface {
NewRequestInfo(req *http.Request) (*request.RequestInfo, error)
}
// ForbiddenMessageMaker creates a forbidden message from a MessageContext
type ForbiddenMessageMaker interface {
MakeMessage(ctx MessageContext) (string, error)
}
// MessageContext contains sufficient information to create a forbidden message. It is bundled in this one object to make it easy and obvious how to build a golang template
type MessageContext struct {
Attributes authorizer.Attributes
}