@@ -25,7 +25,6 @@ import (
2525 "io"
2626 "net/http"
2727 "strconv"
28- "time"
2928
3029 "github.com/nuts-foundation/go-did/vc"
3130 "github.com/nuts-foundation/nuts-node/core"
@@ -102,6 +101,7 @@ func (cs *StatusList2021) Verify(credentialToVerify vc.VerifiableCredential) err
102101func (cs * StatusList2021 ) statusList (statusListCredential string ) (* credentialRecord , error ) {
103102 cr , err := cs .loadCredential (statusListCredential )
104103 if err != nil {
104+ log .Logger ().WithError (err ).Warnf ("Failed to load StatusList2021Credential from database, fetching from issuer (url=%s)" , statusListCredential )
105105 // assume any error means we don't have the credential, so try fetching remote
106106 return cs .update (statusListCredential )
107107 }
@@ -111,23 +111,11 @@ func (cs *StatusList2021) statusList(statusListCredential string) (*credentialRe
111111 return cr , nil
112112 }
113113
114- // TODO: renewal criteria need to be reconsidered if we add other purposes. A 'suspension' may have been canceled
115- // renew expired certificates
116- if (cr .Expires != nil && time .Unix (* cr .Expires , 0 ).Before (time .Now ())) || // expired
117- time .Unix (cr .CreatedAt , 0 ).Add (cs .maxAge ).Before (time .Now ()) { // older than 15 min
118- crUpdated , err := cs .update (statusListCredential )
119- if err == nil {
120- return crUpdated , nil
121- }
122- // use known StatusList2021Credential if we can't fetch a new one, even if it is older/expired
123- if cr .Expires != nil && time .Unix (* cr .Expires , 0 ).Before (time .Now ()) {
124- // log warning if using expired StatusList2021Credential
125- log .Logger ().WithError (err ).WithField (core .LogFieldCredentialSubject , statusListCredential ).
126- Info ("Validating credentialStatus using expired StatusList2021Credential" )
127- }
114+ // PROJECT-GF: for demo purposes, we always update the statuslist credentials, so we can demo revocation.
115+ crUpdated , err := cs .update (statusListCredential )
116+ if err == nil {
117+ return crUpdated , nil
128118 }
129-
130- // return credentialRecord, which could be outdated but is the best information available.
131119 return cr , nil
132120}
133121
0 commit comments