Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jan 5, 2024
1 parent 865782a commit d3b96be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion persistence/sql/persister_grant_jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ func (p *Persister) GetPublicKeys(ctx context.Context, issuer string, subject st
ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetPublicKeys")
defer otelx.End(span, &err)

expiresAt := "expires_at > NOW()"
if p.conn.Dialect.Name() == "sqlite" {
expiresAt = "expires_at > datetime('now')"
}

grantsData := make([]trust.SQLData, 0)
query := p.QueryWithNetwork(ctx).
Select("key_set", "key_id").
Where("expires_at > NOW()").
Where(expiresAt).
Where("issuer = ?", issuer).
Where("(subject = ? OR allow_any_subject IS TRUE)", subject).
Order("created_at DESC").
Expand Down

0 comments on commit d3b96be

Please sign in to comment.