-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add securityDefinitions to the generated OpenAPI spec #14745
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package discovery | ||
package util | ||
|
||
import ( | ||
"reflect" | ||
|
@@ -7,18 +7,18 @@ import ( | |
"github.com/RangelReale/osin" | ||
) | ||
|
||
func TestGet(t *testing.T) { | ||
actual := Get("https://localhost:8443", "https://localhost:8443/oauth/authorize", "https://localhost:8443/oauth/token") | ||
func TestGetOauthMetadata(t *testing.T) { | ||
actual := GetOauthMetadata("https://localhost:8443") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Capitalize the A in OAuth: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nvm, this is consistent with the containing file and the whole code base is really inconsistent on this anyway. |
||
expected := OauthAuthorizationServerMetadata{ | ||
Issuer: "https://localhost:8443", | ||
AuthorizationEndpoint: "https://localhost:8443/oauth/authorize", | ||
TokenEndpoint: "https://localhost:8443/oauth/token", | ||
ScopesSupported: []string{ | ||
"user:check-access", | ||
"user:full", | ||
"user:info", | ||
"user:check-access", | ||
"user:list-scoped-projects", | ||
"user:list-projects", | ||
"user:list-scoped-projects", | ||
}, | ||
ResponseTypesSupported: osin.AllowedAuthorizeType{ | ||
"code", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package util | ||
|
||
import ( | ||
"path" | ||
|
||
"github.com/openshift/origin/pkg/auth/server/tokenrequest" | ||
"github.com/openshift/origin/pkg/oauth/server/osinserver" | ||
) | ||
|
||
const ( | ||
OpenShiftOAuthAPIPrefix = "/oauth" | ||
) | ||
|
||
func OpenShiftOAuthAuthorizeURL(masterAddr string) string { | ||
return masterAddr + path.Join(OpenShiftOAuthAPIPrefix, osinserver.AuthorizePath) | ||
} | ||
func OpenShiftOAuthTokenURL(masterAddr string) string { | ||
return masterAddr + path.Join(OpenShiftOAuthAPIPrefix, osinserver.TokenPath) | ||
} | ||
func OpenShiftOAuthTokenRequestURL(masterAddr string) string { | ||
return masterAddr + path.Join(OpenShiftOAuthAPIPrefix, tokenrequest.RequestTokenEndpoint) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package dependency was previously excluded intentionally. The asset server should not depend on the oauth package at all. The two are logically independent.