Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl committed Oct 29, 2024
1 parent 39e1c61 commit c7864d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ go 1.22

toolchain go1.22.5

replace github.com/ory/fosite => ../fosite

replace github.com/ory/hydra-client-go/v2 => ./internal/httpclient

replace github.com/gobuffalo/pop/v6 => github.com/ory/pop/v6 v6.2.0
Expand Down Expand Up @@ -35,7 +33,7 @@ require (
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/oleiade/reflections v1.0.1
github.com/ory/analytics-go/v5 v5.0.1
github.com/ory/fosite v0.47.1-0.20241028132122-b35b62fed16e
github.com/ory/fosite v0.47.1-0.20241028135452-199f8ab66014
github.com/ory/go-acc v0.2.9-0.20230103102148-6b1c9a70dbbe
github.com/ory/graceful v0.1.3
github.com/ory/herodot v0.10.3-0.20230626083119-d7e5192f0d88
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ github.com/ory/dockertest/v3 v3.10.1-0.20240704115616-d229e74b748d h1:By96ZSVuH5
github.com/ory/dockertest/v3 v3.10.1-0.20240704115616-d229e74b748d/go.mod h1:F2FIjwwAk6CsNAs//B8+aPFQF0t84pbM8oliyNXwQrk=
github.com/ory/fosite v0.47.1-0.20241028132122-b35b62fed16e h1:aRhPoQt0QFrjQVrNDGiGQcT9cY/o8iqqBkMdoiyznjI=
github.com/ory/fosite v0.47.1-0.20241028132122-b35b62fed16e/go.mod h1:5U6c9nOLxyTdD/qrFv7N88TSxkdk5Wq8NzvB7UViDP0=
github.com/ory/fosite v0.47.1-0.20241028135452-199f8ab66014 h1:vtcEvjeArxH3CayG8Gn5y3mCzo1gibu74rZhvvveANE=
github.com/ory/fosite v0.47.1-0.20241028135452-199f8ab66014/go.mod h1:5U6c9nOLxyTdD/qrFv7N88TSxkdk5Wq8NzvB7UViDP0=
github.com/ory/go-acc v0.2.9-0.20230103102148-6b1c9a70dbbe h1:rvu4obdvqR0fkSIJ8IfgzKOWwZ5kOT2UNfLq81Qk7rc=
github.com/ory/go-acc v0.2.9-0.20230103102148-6b1c9a70dbbe/go.mod h1:z4n3u6as84LbV4YmgjHhnwtccQqzf4cZlSk9f1FhygI=
github.com/ory/go-convenience v0.1.0 h1:zouLKfF2GoSGnJwGq+PE/nJAE6dj2Zj5QlTgmMTsTS8=
Expand Down
7 changes: 3 additions & 4 deletions oauth2/oauth2_rop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func TestResourceOwnerPasswordGrant(t *testing.T) {
publicTS, adminTS := testhelpers.NewOAuth2Server(ctx, t, reg)

secret := uuid.New().String()
audience := "https://aud.example.com"
audience := sqlxx.StringSliceJSONFormat{"https://aud.example.com"}
client := &hydra.Client{
Secret: secret,
GrantTypes: []string{"password", "refresh_token"},
Scope: "offline",
Audience: sqlxx.StringSliceJSONFormat{audience},
Audience: audience,
Lifespans: hydra.Lifespans{
PasswordGrantAccessTokenLifespan: x.NullDuration{Duration: 1 * time.Hour, Valid: true},
PasswordGrantRefreshTokenLifespan: x.NullDuration{Duration: 1 * time.Hour, Valid: true},
Expand All @@ -72,7 +72,6 @@ func TestResourceOwnerPasswordGrant(t *testing.T) {
require.NoError(t, json.NewDecoder(r.Body).Decode(&hookReq))
assert.NotEmpty(t, hookReq.Session)
assert.NotEmpty(t, hookReq.Request)
assert.ElementsMatch(t, []string{}, hookReq.Request.GrantedAudience)

claims := hookReq.Session.Extra
claims["hooked"] = true
Expand Down Expand Up @@ -119,7 +118,7 @@ func TestResourceOwnerPasswordGrant(t *testing.T) {
assert.Equal(t, kratos.FakeIdentityID, jwtAT.Claims["sub"])
assert.Equal(t, publicTS.URL, jwtAT.Claims["iss"])
assert.True(t, jwtAT.Claims["ext"].(map[string]any)["hooked"].(bool))
assert.Equal(t, oauth2Config.ClientID, audience, jwtAT.Claims["aud"])
assert.ElementsMatch(t, audience, jwtAT.Claims["aud"])

t.Run("case=introspect token", func(t *testing.T) {
// Introspected token should have hook and identity_id claims
Expand Down

0 comments on commit c7864d6

Please sign in to comment.