Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Apr 5, 2024
1 parent c9a5b08 commit 9f6a07b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions persistence/sql/persister_nid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (s *PersisterTestSuite) TestCreateAccessTokenSession() {
fr.Session = &oauth2.Session{DefaultSession: &openid.DefaultSession{Subject: "sub"}}
require.NoError(t, r.Persister().CreateAccessTokenSession(s.t1, sig, fr))
actual := persistencesql.OAuth2RequestSQL{Table: "access"}
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
require.Equal(t, s.t1NID, actual.NID)
})
}
Expand Down Expand Up @@ -572,11 +572,11 @@ func (s *PersisterTestSuite) DeleteAccessTokenSession() {
require.NoError(t, r.Persister().DeleteAccessTokenSession(s.t2, sig))

actual := persistencesql.OAuth2RequestSQL{Table: "access"}
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
require.Equal(t, s.t1NID, actual.NID)

require.NoError(t, r.Persister().DeleteAccessTokenSession(s.t1, sig))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
})
}
}
Expand All @@ -595,11 +595,11 @@ func (s *PersisterTestSuite) TestDeleteAccessTokens() {
require.NoError(t, r.Persister().DeleteAccessTokens(s.t2, client.ID))

actual := persistencesql.OAuth2RequestSQL{Table: "access"}
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
require.Equal(t, s.t1NID, actual.NID)

require.NoError(t, r.Persister().DeleteAccessTokens(s.t1, client.ID))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
})
}
}
Expand Down Expand Up @@ -851,9 +851,9 @@ func (s *PersisterTestSuite) TestFlushInactiveAccessTokens() {
actual := persistencesql.OAuth2RequestSQL{Table: "access"}

require.NoError(t, r.Persister().FlushInactiveAccessTokens(s.t2, time.Now().Add(time.Hour), 100, 100))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
require.NoError(t, r.Persister().FlushInactiveAccessTokens(s.t1, time.Now().Add(time.Hour), 100, 100))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
})
}
}
Expand Down Expand Up @@ -1754,11 +1754,11 @@ func (s *PersisterTestSuite) TestRevokeAccessToken() {
require.NoError(t, r.Persister().RevokeAccessToken(s.t2, fr.ID))

actual := persistencesql.OAuth2RequestSQL{Table: "access"}
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.NoError(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
require.Equal(t, s.t1NID, actual.NID)

require.NoError(t, r.Persister().RevokeAccessToken(s.t1, fr.ID))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, persistencesql.SignatureHash(sig)))
require.Error(t, r.Persister().Connection(context.Background()).Find(&actual, x.SignatureHash(sig)))
})
}
}
Expand Down

0 comments on commit 9f6a07b

Please sign in to comment.