Skip to content

Commit 8753bd6

Browse files
Merge pull request #20473 from deads2k/oauth-01-tighten
tighten usage of oauthserver package in openshift
2 parents 5157fe5 + 3eb4de7 commit 8753bd6

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

hack/import-restrictions.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,7 @@
108108
"github.com/openshift/origin/pkg/oauthserver",
109109

110110
"github.com/openshift/origin/pkg/cmd/server/origin",
111-
"github.com/openshift/origin/pkg/authorization/registry/clusterrole",
112-
"github.com/openshift/origin/pkg/authorization/registry/clusterrolebinding",
113-
"github.com/openshift/origin/pkg/authorization/registry/role",
114-
"github.com/openshift/origin/pkg/authorization/registry/rolebinding",
115-
"github.com/openshift/origin/pkg/build/admission/jenkinsbootstrapper",
116-
"github.com/openshift/origin/pkg/build/admission/secretinjector",
117111
"github.com/openshift/origin/pkg/cmd/server/apis/config/validation",
118-
"github.com/openshift/origin/pkg/cmd/server/handlers",
119-
"github.com/openshift/origin/pkg/oauth/util",
120112
"github.com/openshift/origin/pkg/oc/cli/admin",
121113
"github.com/openshift/origin/pkg/oc/cli/admin/createerrortemplate",
122114
"github.com/openshift/origin/pkg/oc/cli/admin/createlogintemplate",
@@ -126,8 +118,7 @@
126118
"github.com/openshift/origin/pkg/oc/lib/groupsync/ad",
127119
"github.com/openshift/origin/pkg/oc/lib/groupsync/groupdetector",
128120
"github.com/openshift/origin/pkg/oc/lib/groupsync/rfc2307",
129-
"github.com/openshift/origin/pkg/oc/lib/groupsync/syncerror",
130-
"github.com/openshift/origin/pkg/user"
121+
"github.com/openshift/origin/pkg/oc/lib/groupsync/syncerror"
131122
],
132123
"forbiddenImportPackageRoots": [
133124
"github.com/openshift/origin/pkg/oauthserver"

pkg/oauth/util/discovery.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
1414
"github.com/openshift/origin/pkg/oauth/apis/oauth/validation"
1515
"github.com/openshift/origin/pkg/oauth/urls"
16-
"github.com/openshift/origin/pkg/oauthserver/osinserver"
1716
)
1817

1918
// OauthAuthorizationServerMetadata holds OAuth 2.0 Authorization Server Metadata used for discovery
@@ -51,15 +50,14 @@ type OauthAuthorizationServerMetadata struct {
5150
// validate configuration using LoadOAuthMetadataFile
5251

5352
func getOauthMetadata(masterPublicURL string) OauthAuthorizationServerMetadata {
54-
config := osinserver.NewDefaultServerConfig()
5553
return OauthAuthorizationServerMetadata{
5654
Issuer: masterPublicURL,
5755
AuthorizationEndpoint: urls.OpenShiftOAuthAuthorizeURL(masterPublicURL),
5856
TokenEndpoint: urls.OpenShiftOAuthTokenURL(masterPublicURL),
5957
// Note: this list is incomplete, which is allowed per the draft spec
6058
ScopesSupported: scope.DefaultSupportedScopes(),
61-
ResponseTypesSupported: config.AllowedAuthorizeTypes,
62-
GrantTypesSupported: osin.AllowedAccessType{osin.AUTHORIZATION_CODE, osin.AccessRequestType("implicit")}, // TODO use config.AllowedAccessTypes once our implementation handles other grant types
59+
ResponseTypesSupported: osin.AllowedAuthorizeType{osin.CODE, osin.TOKEN},
60+
GrantTypesSupported: osin.AllowedAccessType{osin.AUTHORIZATION_CODE, osin.AccessRequestType("implicit")},
6361
CodeChallengeMethodsSupported: validation.CodeChallengeMethodsSupported,
6462
}
6563
}

0 commit comments

Comments
 (0)