@@ -60,6 +60,7 @@ func TestHandleDiscoveryOIDC(t *testing.T) {
6060 UserInfo : fmt .Sprintf ("%s/userinfo" , httpServer .URL ),
6161 DeviceEndpoint : fmt .Sprintf ("%s/device/code" , httpServer .URL ),
6262 Introspect : fmt .Sprintf ("%s/token/introspect" , httpServer .URL ),
63+ Registration : fmt .Sprintf ("%s/register" , httpServer .URL ),
6364 GrantTypes : []string {
6465 "authorization_code" ,
6566 "refresh_token" ,
@@ -107,48 +108,49 @@ func TestHandleDiscoveryOIDC(t *testing.T) {
107108}
108109
109110func TestHandleDiscoveryOAuth2 (t * testing.T ) {
110- httpServer , server := newTestServer (t , nil )
111- defer httpServer .Close ()
112-
113- rr := httptest .NewRecorder ()
114- server .ServeHTTP (rr , httptest .NewRequest ("GET" , "/.well-known/oauth-authorization-server" , nil ))
115-
116- if rr .Code != http .StatusOK {
117- t .Errorf ("expected 200 got %d" , rr .Code )
118- }
119-
120- var res discoveryOAuth2
121- err := json .NewDecoder (rr .Result ().Body ).Decode (& res )
122- require .NoError (t , err )
123-
124- require .Equal (t , discoveryOAuth2 {
125- Issuer : httpServer .URL ,
126- Auth : fmt .Sprintf ("%s/auth" , httpServer .URL ),
127- Token : fmt .Sprintf ("%s/token" , httpServer .URL ),
128- Keys : fmt .Sprintf ("%s/keys" , httpServer .URL ),
129- DeviceEndpoint : fmt .Sprintf ("%s/device/code" , httpServer .URL ),
130- Introspect : fmt .Sprintf ("%s/token/introspect" , httpServer .URL ),
131- GrantTypes : []string {
132- "authorization_code" ,
133- "refresh_token" ,
134- "urn:ietf:params:oauth:grant-type:device_code" ,
135- "urn:ietf:params:oauth:grant-type:token-exchange" ,
136- },
137- ResponseTypes : []string {
138- "code" ,
139- },
140- CodeChallengeAlgs : []string {
141- "S256" ,
142- "plain" ,
143- },
144- Scopes : []string {
145- "offline_access" ,
146- },
147- AuthMethods : []string {
148- "client_secret_basic" ,
149- "client_secret_post" ,
150- },
151- }, res )
111+ httpServer , server := newTestServer (t , nil )
112+ defer httpServer .Close ()
113+
114+ rr := httptest .NewRecorder ()
115+ server .ServeHTTP (rr , httptest .NewRequest ("GET" , "/.well-known/oauth-authorization-server" , nil ))
116+
117+ if rr .Code != http .StatusOK {
118+ t .Errorf ("expected 200 got %d" , rr .Code )
119+ }
120+
121+ var res discoveryOAuth2
122+ err := json .NewDecoder (rr .Result ().Body ).Decode (& res )
123+ require .NoError (t , err )
124+
125+ require .Equal (t , discoveryOAuth2 {
126+ Issuer : httpServer .URL ,
127+ Auth : fmt .Sprintf ("%s/auth" , httpServer .URL ),
128+ Token : fmt .Sprintf ("%s/token" , httpServer .URL ),
129+ Keys : fmt .Sprintf ("%s/keys" , httpServer .URL ),
130+ DeviceEndpoint : fmt .Sprintf ("%s/device/code" , httpServer .URL ),
131+ Introspect : fmt .Sprintf ("%s/token/introspect" , httpServer .URL ),
132+ Registration : fmt .Sprintf ("%s/register" , httpServer .URL ),
133+ GrantTypes : []string {
134+ "authorization_code" ,
135+ "refresh_token" ,
136+ "urn:ietf:params:oauth:grant-type:device_code" ,
137+ "urn:ietf:params:oauth:grant-type:token-exchange" ,
138+ },
139+ ResponseTypes : []string {
140+ "code" ,
141+ },
142+ CodeChallengeAlgs : []string {
143+ "S256" ,
144+ "plain" ,
145+ },
146+ Scopes : []string {
147+ "offline_access" ,
148+ },
149+ AuthMethods : []string {
150+ "client_secret_basic" ,
151+ "client_secret_post" ,
152+ },
153+ }, res )
152154}
153155
154156func TestHandleHealthFailure (t * testing.T ) {
0 commit comments