Skip to content

Commit b638188

Browse files
committed
Remove duplicate Origin authenticator interfaces
This change removes the duplicate authenticator interfaces that are no longer needed. The exact same interfaces exist upstream, so this change is purely mechanical. Signed-off-by: Monis Khan <[email protected]>
1 parent 5a8373a commit b638188

File tree

12 files changed

+31
-41
lines changed

12 files changed

+31
-41
lines changed

pkg/auth/authenticator/interfaces.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
11
package authenticator
22

33
import (
4-
"net/http"
4+
"k8s.io/apiserver/pkg/authentication/user"
55

66
"github.com/openshift/origin/pkg/auth/api"
7-
"k8s.io/apiserver/pkg/authentication/user"
87
)
98

10-
type Token interface {
11-
AuthenticateToken(token string) (user.Info, bool, error)
12-
}
13-
14-
type Request interface {
15-
AuthenticateRequest(req *http.Request) (user.Info, bool, error)
16-
}
17-
18-
type Password interface {
19-
AuthenticatePassword(user, password string) (user.Info, bool, error)
20-
}
21-
229
type Assertion interface {
2310
AuthenticateAssertion(assertionType, data string) (user.Info, bool, error)
2411
}
2512

2613
type Client interface {
2714
AuthenticateClient(client api.Client) (user.Info, bool, error)
2815
}
29-
30-
type RequestFunc func(req *http.Request) (user.Info, bool, error)
31-
32-
func (f RequestFunc) AuthenticateRequest(req *http.Request) (user.Info, bool, error) {
33-
return f(req)
34-
}

pkg/auth/authenticator/password/allowanypassword/anyauthpassword.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55

66
"github.com/golang/glog"
77

8-
authapi "github.com/openshift/origin/pkg/auth/api"
9-
"github.com/openshift/origin/pkg/auth/authenticator"
8+
"k8s.io/apiserver/pkg/authentication/authenticator"
109
"k8s.io/apiserver/pkg/authentication/user"
10+
11+
authapi "github.com/openshift/origin/pkg/auth/api"
1112
)
1213

1314
// alwaysAcceptPasswordAuthenticator approves any login attempt with non-blank username and password

pkg/auth/authenticator/password/basicauthpassword/basicauthpassword.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import (
1010

1111
"github.com/golang/glog"
1212

13-
authapi "github.com/openshift/origin/pkg/auth/api"
14-
"github.com/openshift/origin/pkg/auth/authenticator"
13+
"k8s.io/apiserver/pkg/authentication/authenticator"
1514
"k8s.io/apiserver/pkg/authentication/user"
15+
16+
authapi "github.com/openshift/origin/pkg/auth/api"
1617
)
1718

1819
// Authenticator uses basic auth to make a request to a JSON-returning URL.

pkg/auth/authenticator/password/denypassword/denypassword.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package denypassword
22

33
import (
4-
"github.com/openshift/origin/pkg/auth/authenticator"
4+
"k8s.io/apiserver/pkg/authentication/authenticator"
55
"k8s.io/apiserver/pkg/authentication/user"
66
)
77

pkg/auth/authenticator/password/htpasswd/htpasswd.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import (
99
"strings"
1010

1111
"github.com/golang/glog"
12-
authapi "github.com/openshift/origin/pkg/auth/api"
13-
"github.com/openshift/origin/pkg/auth/authenticator"
1412
"golang.org/x/crypto/bcrypt"
13+
14+
"k8s.io/apiserver/pkg/authentication/authenticator"
1515
"k8s.io/apiserver/pkg/authentication/user"
16+
17+
authapi "github.com/openshift/origin/pkg/auth/api"
1618
)
1719

1820
// Authenticator watches a file generated by htpasswd to validate usernames and passwords

pkg/auth/authenticator/password/keystonepassword/keystonepassword.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import (
99
"github.com/rackspace/gophercloud"
1010
"github.com/rackspace/gophercloud/openstack"
1111

12-
authapi "github.com/openshift/origin/pkg/auth/api"
13-
"github.com/openshift/origin/pkg/auth/authenticator"
1412
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
13+
"k8s.io/apiserver/pkg/authentication/authenticator"
1514
"k8s.io/apiserver/pkg/authentication/user"
15+
16+
authapi "github.com/openshift/origin/pkg/auth/api"
1617
)
1718

1819
// keystonePasswordAuthenticator uses OpenStack keystone to authenticate a user by password

pkg/auth/authenticator/password/ldappassword/ldap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66

77
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
88
"k8s.io/apimachinery/pkg/util/sets"
9+
"k8s.io/apiserver/pkg/authentication/authenticator"
910
"k8s.io/apiserver/pkg/authentication/user"
1011

1112
"github.com/golang/glog"
1213
"gopkg.in/ldap.v2"
1314

1415
authapi "github.com/openshift/origin/pkg/auth/api"
15-
"github.com/openshift/origin/pkg/auth/authenticator"
1616
"github.com/openshift/origin/pkg/auth/ldaputil"
1717
"github.com/openshift/origin/pkg/auth/ldaputil/ldapclient"
1818
)

pkg/auth/authenticator/request/basicauthrequest/basicauth.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import (
66
"net/http"
77
"strings"
88

9+
"github.com/golang/glog"
10+
11+
"k8s.io/apiserver/pkg/authentication/authenticator"
912
"k8s.io/apiserver/pkg/authentication/user"
1013

11-
"github.com/golang/glog"
12-
"github.com/openshift/origin/pkg/auth/authenticator"
1314
"github.com/openshift/origin/pkg/auth/prometheus"
1415
)
1516

pkg/auth/authenticator/request/paramtoken/paramtoken.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"net/http"
55
"strings"
66

7-
"github.com/openshift/origin/pkg/auth/authenticator"
7+
"k8s.io/apiserver/pkg/authentication/authenticator"
88
"k8s.io/apiserver/pkg/authentication/user"
99
"k8s.io/apiserver/pkg/util/wsstream"
1010
)

pkg/auth/oauth/handlers/authenticator.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import (
66
"github.com/RangelReale/osin"
77
"github.com/golang/glog"
88

9-
"github.com/openshift/origin/pkg/auth/api"
10-
"github.com/openshift/origin/pkg/auth/authenticator"
9+
"k8s.io/apiserver/pkg/authentication/authenticator"
1110
"k8s.io/apiserver/pkg/authentication/user"
11+
12+
"github.com/openshift/origin/pkg/auth/api"
13+
openshiftauthenticator "github.com/openshift/origin/pkg/auth/authenticator"
1214
)
1315

1416
// AuthorizeAuthenticator implements osinserver.AuthorizeHandler to ensure requests are authenticated
@@ -61,12 +63,12 @@ func (h *AuthorizeAuthenticator) HandleAuthorize(ar *osin.AuthorizeRequest, resp
6163
// AccessAuthenticator implements osinserver.AccessHandler to ensure non-token requests are authenticated
6264
type AccessAuthenticator struct {
6365
password authenticator.Password
64-
assertion authenticator.Assertion
65-
client authenticator.Client
66+
assertion openshiftauthenticator.Assertion
67+
client openshiftauthenticator.Client
6668
}
6769

6870
// NewAccessAuthenticator returns a new AccessAuthenticator
69-
func NewAccessAuthenticator(password authenticator.Password, assertion authenticator.Assertion, client authenticator.Client) *AccessAuthenticator {
71+
func NewAccessAuthenticator(password authenticator.Password, assertion openshiftauthenticator.Assertion, client openshiftauthenticator.Client) *AccessAuthenticator {
7072
return &AccessAuthenticator{password, assertion, client}
7173
}
7274

pkg/auth/server/grant/grant.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import (
77
"path"
88
"strings"
99

10+
"github.com/golang/glog"
11+
1012
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1113
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
14+
"k8s.io/apiserver/pkg/authentication/authenticator"
1215
"k8s.io/apiserver/pkg/authentication/serviceaccount"
1316
"k8s.io/apiserver/pkg/authentication/user"
1417

15-
"github.com/golang/glog"
16-
"github.com/openshift/origin/pkg/auth/authenticator"
1718
"github.com/openshift/origin/pkg/auth/server/csrf"
1819
"github.com/openshift/origin/pkg/auth/server/headers"
1920
scopeauthorizer "github.com/openshift/origin/pkg/authorization/authorizer/scope"

pkg/auth/server/login/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/golang/glog"
1212

1313
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
14+
"k8s.io/apiserver/pkg/authentication/authenticator"
1415

15-
"github.com/openshift/origin/pkg/auth/authenticator"
1616
"github.com/openshift/origin/pkg/auth/oauth/handlers"
1717
"github.com/openshift/origin/pkg/auth/prometheus"
1818
"github.com/openshift/origin/pkg/auth/server/csrf"

0 commit comments

Comments
 (0)