forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
34 lines (25 loc) · 795 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
32
33
34
package authenticator
import (
"net/http"
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/user"
"github.com/openshift/origin/pkg/auth/api"
)
type Token interface {
AuthenticateToken(token string) (user.Info, bool, error)
}
type Request interface {
AuthenticateRequest(req *http.Request) (user.Info, bool, error)
}
type Password interface {
AuthenticatePassword(user, password string) (user.Info, bool, error)
}
type Assertion interface {
AuthenticateAssertion(assertionType, data string) (user.Info, bool, error)
}
type Client interface {
AuthenticateClient(client api.Client) (user.Info, bool, error)
}
type RequestFunc func(req *http.Request) (user.Info, bool, error)
func (f RequestFunc) AuthenticateRequest(req *http.Request) (user.Info, bool, error) {
return f(req)
}