forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
empties.go
35 lines (25 loc) · 932 Bytes
/
empties.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
35
package handlers
import (
"net/http"
"github.com/golang/glog"
authapi "github.com/openshift/origin/pkg/auth/api"
"k8s.io/kubernetes/pkg/auth/user"
)
type EmptyAuth struct{}
func (EmptyAuth) AuthenticationNeeded(client authapi.Client, w http.ResponseWriter, req *http.Request) (bool, error) {
return false, nil
}
type EmptySuccess struct{}
func (EmptySuccess) AuthenticationSucceeded(user user.Info, state string, w http.ResponseWriter, req *http.Request) (bool, error) {
glog.V(4).Infof("AuthenticationSucceeded: %v (state=%s)", user, state)
return false, nil
}
type EmptyError struct{}
func (EmptyError) AuthenticationError(err error, w http.ResponseWriter, req *http.Request) (bool, error) {
glog.Errorf("AuthenticationError: %v", err)
return false, err
}
func (EmptyError) GrantError(err error, w http.ResponseWriter, req *http.Request) (bool, error) {
glog.Errorf("GrantError: %v", err)
return false, err
}