Skip to content

Commit

Permalink
fix: client specific CORS
Browse files Browse the repository at this point in the history
Closes #1754
  • Loading branch information
aeneasr committed Sep 7, 2022
1 parent 647822d commit 9a4f9e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions oauth2/oauth2_auth_code_test.go
Expand Up @@ -966,9 +966,6 @@ func TestAuthCodeWithMockStrategy(t *testing.T) {
resp := makeRequest(req)
require.Equal(t, http.StatusUnauthorized, resp.StatusCode)
})
t.Logf("Got token: %s", token.AccessToken)

// time.Sleep(time.Millisecond * 1200) // Makes sure exp/iat/nbf time is different later on

res, err := testRefresh(t, token, ts.URL, tc.checkExpiry)
require.NoError(t, err)
Expand All @@ -980,8 +977,6 @@ func TestAuthCodeWithMockStrategy(t *testing.T) {
var refreshedToken oauth2.Token
require.NoError(t, json.Unmarshal(body, &refreshedToken))

t.Logf("Got refresh token: %s", refreshedToken.AccessToken)

if tc.assertAccessToken != nil {
tc.assertAccessToken(t, refreshedToken.AccessToken)
}
Expand Down Expand Up @@ -1127,7 +1122,6 @@ func TestAuthCodeWithMockStrategy(t *testing.T) {
require.NoError(t, json.Unmarshal(body, &refreshedToken))

refreshedAccessTokenClaims := testhelpers.IntrospectToken(t, oauthConfig, &refreshedToken, ts)

assert.Equal(t, origAccessTokenClaims, refreshedAccessTokenClaims)
})

Expand Down
4 changes: 2 additions & 2 deletions x/oauth2cors/cors_test.go
Expand Up @@ -165,8 +165,8 @@ func TestOAuth2AwareCORSMiddleware(t *testing.T) {
{
d: "should succeed on pre-flight request when token introspection fails",
prep: func(t *testing.T, r driver.Registry) {
r.Config().MustSet("serve.public.cors.enabled", true)
r.Config().MustSet("serve.public.cors.allowed_origins", []string{"http://not-test-domain.com"})
r.Config().MustSet(context.Background(), "serve.public.cors.enabled", true)
r.Config().MustSet(context.Background(), "serve.public.cors.allowed_origins", []string{"http://not-test-domain.com"})
},
code: http.StatusNotImplemented,
header: http.Header{"Origin": {"http://foobar.com"}, "Authorization": {"Bearer 1234"}},
Expand Down

0 comments on commit 9a4f9e9

Please sign in to comment.