Skip to content

Commit

Permalink
Group By on COUNT(*)
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Oct 3, 2024
1 parent f821e0e commit 70b4fc0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions e2e-tests/oauth-flow/rfc021/do-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ fi
# (Discovery: GetActivationStatus fails on MS SQL Server)
echo "Getting activation status from Discovery Service..."
RESPONSE=$(curl -s http://localhost:28081/internal/discovery/v1/e2e-test/vendorB)
# check for `"activated": true`
if echo $RESPONSE | grep -q "\"activated\": true"; then
echo $RESPONSE
if echo $RESPONSE | grep -q "true"; then
echo "Activation status OK"
else
echo "FAILED: Could not get activation status of vendor B on Discovery Service" 1>&2
Expand Down
6 changes: 4 additions & 2 deletions e2e-tests/oauth-flow/rfc021/shared/discovery/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
},
{
"path": [
"$.credentialSubject.organization.name"
"$.credentialSubject.organization.name",
"$.credentialSubject[0].organization.name"
],
"filter": {
"type": "string"
}
},
{
"path": [
"$.credentialSubject.organization.city"
"$.credentialSubject.organization.city",
"$.credentialSubject[0].organization.city"
],
"filter": {
"type": "string"
Expand Down
2 changes: 2 additions & 0 deletions vcr/revocation/statuslist2021_issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (cs *StatusList2021) isManaged(subjectID string) bool {
var exists bool
cs.db.Model(new(credentialIssuerRecord)).
Select("count(*) > 0").
Group("subject_id").
Where("subject_id = ?", subjectID).
First(&exists)
return exists
Expand Down Expand Up @@ -423,6 +424,7 @@ func (cs *StatusList2021) Revoke(ctx context.Context, credentialID ssi.URI, entr
err = tx.Model(new(credentialRecord)).
Clauses(clause.Locking{Strength: clause.LockingStrengthUpdate}).
Select("count(*) > 0").
Group("subject_id").
Where("subject_id = ?", entry.StatusListCredential).
First(new(bool)).
Error
Expand Down

0 comments on commit 70b4fc0

Please sign in to comment.