Commit 96a56271 authored by Sietse Ringers's avatar Sietse Ringers

refactor: rename CredentialType.SupportsRevocation -> RevocationSupported

parent ac1248f5
......@@ -98,7 +98,7 @@ func (ad AttributeType) IsOptional() bool {
return ad.Optional == "true"
}
func (ct *CredentialType) SupportsRevocation() bool {
func (ct *CredentialType) RevocationSupported() bool {
return len(ct.RevocationServers) > 0
}
......
......@@ -47,7 +47,7 @@ func New(conf *server.Configuration) (*Server, error) {
s.scheduler.Every(irma.RevocationRequestorUpdateInterval).Minutes().Do(func() {
for credid, credtype := range s.conf.IrmaConfiguration.CredentialTypes {
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
continue
}
if s := conf.RevocationSettings[credid]; s != nil && s.Mode != irma.RevocationModeRequestor {
......
......@@ -79,7 +79,7 @@ func (session *session) issuanceHandleRevocation(
cred *irma.CredentialRequest, attributes *irma.AttributeList, sk *gabi.PrivateKey,
) (*revocation.Witness, error) {
id := cred.CredentialTypeID
if !session.conf.IrmaConfiguration.CredentialTypes[id].SupportsRevocation() {
if !session.conf.IrmaConfiguration.CredentialTypes[id].RevocationSupported() {
return nil, nil
}
......
......@@ -47,7 +47,7 @@ func postRevocation(request *irma.RevocationRequest, url, schemespath, authmetho
if !known {
die("unknown credential type", nil)
}
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
die("credential type does not support revocation", nil)
}
......
......@@ -18,7 +18,7 @@ func (client *Client) initRevocation() {
// For every credential supporting revocation, compute nonrevocation caches in async jobs
for typ, attrsets := range client.attributes {
for i, attrs := range attrsets {
if attrs.CredentialType() == nil || !attrs.CredentialType().SupportsRevocation() {
if attrs.CredentialType() == nil || !attrs.CredentialType().RevocationSupported() {
continue
}
typ := typ // make copy of same name to capture the value for closure below
......@@ -41,7 +41,7 @@ func (client *Client) initRevocation() {
client.Configuration.Scheduler.Every(nonrevUpdateInterval).Seconds().Do(func() {
for typ, attrsets := range client.attributes {
for i, attrs := range attrsets {
if attrs.CredentialType() == nil || !attrs.CredentialType().SupportsRevocation() {
if attrs.CredentialType() == nil || !attrs.CredentialType().RevocationSupported() {
continue
}
cred, err := client.credential(typ, i)
......@@ -82,7 +82,7 @@ func (client *Client) NonrevPrepare(request irma.SessionRequest) error {
for typ := range request.Disclosure().Identifiers().CredentialTypes {
credtype := client.Configuration.CredentialTypes[typ]
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
continue
}
if !base.RequestsRevocation(typ) {
......@@ -208,7 +208,7 @@ func (client *Client) nonrevPrepareCache(typ irma.CredentialTypeIdentifier, inde
func (client *Client) nonrevRepopulateCaches(request irma.SessionRequest) {
for typ := range request.Disclosure().Identifiers().CredentialTypes {
credtype := client.Configuration.CredentialTypes[typ]
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
continue
}
for i := range client.attrs(typ) {
......
......@@ -1532,7 +1532,7 @@ func (conf *Configuration) ValidateKeys() error {
if err != nil {
return err
}
if typ.SupportsRevocation() && !pk.RevocationSupported() {
if typ.RevocationSupported() && !pk.RevocationSupported() {
return errors.Errorf("credential type %s supports revocation but latest private key of issuer %s does not", typ, issuerid)
}
}
......
......@@ -441,7 +441,7 @@ func (rs *RevocationStorage) SaveIssuanceRecord(typ CredentialTypeIdentifier, re
if credtype == nil {
return errors.New("unknown credential type")
}
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
return errors.New("cannot save issuance record: credential type does not support revocation")
}
......@@ -590,7 +590,7 @@ func (rs *RevocationStorage) SetRevocationUpdates(b *BaseRequest) error {
var err error
b.RevocationUpdates = make(map[CredentialTypeIdentifier]map[uint]*revocation.Update, len(b.Revocation))
for _, credid := range b.Revocation {
if !rs.conf.CredentialTypes[credid].SupportsRevocation() {
if !rs.conf.CredentialTypes[credid].RevocationSupported() {
return errors.Errorf("cannot request nonrevocation proof for %s: revocation not enabled in scheme")
}
if err = rs.UpdateIfOld(credid); err != nil {
......
......@@ -276,7 +276,7 @@ func (conf *Configuration) verifyRevocation() error {
}
for credid, credtype := range conf.IrmaConfiguration.CredentialTypes {
if !credtype.SupportsRevocation() {
if !credtype.RevocationSupported() {
continue
}
_, err := rev.Keys.PrivateKeyLatest(credid.IssuerIdentifier())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment