Commit 661dc7ad authored by Sietse Ringers's avatar Sietse Ringers
Browse files

refactor: polish

parent 8491c20a
...@@ -370,6 +370,8 @@ var revocationIssuanceRequest = irma.NewIssuanceRequest([]*irma.CredentialReques ...@@ -370,6 +370,8 @@ var revocationIssuanceRequest = irma.NewIssuanceRequest([]*irma.CredentialReques
func TestRevocation(t *testing.T) { func TestRevocation(t *testing.T) {
defer test.ClearTestStorage(t) defer test.ClearTestStorage(t)
attr := irma.NewAttributeTypeIdentifier("irma-demo.MijnOverheid.root.BSN")
cred := attr.CredentialTypeIdentifier()
client, handler := revocationSetup(t) client, handler := revocationSetup(t)
// issue second credential which overwrites the first one, as our credtype is a singleton // issue second credential which overwrites the first one, as our credtype is a singleton
...@@ -386,7 +388,6 @@ func TestRevocation(t *testing.T) { ...@@ -386,7 +388,6 @@ func TestRevocation(t *testing.T) {
// revoke cred0 // revoke cred0
logger.Info("step 2") logger.Info("step 2")
cred := revocationIssuanceRequest.Credentials[0].CredentialTypeID
require.NoError(t, revocationServer.Revoke(cred, "cred0")) require.NoError(t, revocationServer.Revoke(cred, "cred0"))
// perform another disclosure session with nonrevocation proof to see that cred1 still works // perform another disclosure session with nonrevocation proof to see that cred1 still works
...@@ -401,18 +402,14 @@ func TestRevocation(t *testing.T) { ...@@ -401,18 +402,14 @@ func TestRevocation(t *testing.T) {
require.NoError(t, revocationServer.Revoke(cred, "cred1")) require.NoError(t, revocationServer.Revoke(cred, "cred1"))
// try to perform session with revoked credential // try to perform session with revoked credential
// client notices that is credential is revoked and aborts // client notices that his credential is revoked and aborts
logger.Info("step 5") logger.Info("step 5")
attr := irma.NewAttributeTypeIdentifier("irma-demo.MijnOverheid.root.BSN")
result = revocationSession(t, client, sessionOptionIgnoreClientError) result = revocationSession(t, client, sessionOptionIgnoreClientError)
require.Equal(t, result.Status, server.StatusCancelled) require.Equal(t, result.Status, server.StatusCancelled)
// client revocation callback was called // client revocation callback was called
require.NotNil(t, handler.(*TestClientHandler).revoked) require.NotNil(t, handler.(*TestClientHandler).revoked)
require.Equal(t, require.Equal(t, cred, handler.(*TestClientHandler).revoked.Type)
attr.CredentialTypeIdentifier(), // credential is no longer suggested as candidate
handler.(*TestClientHandler).revoked.Type,
)
// credential is no longer suggested as candidates
candidates, missing := client.Candidates(irma.AttributeDisCon{{{Type: attr}}}) candidates, missing := client.Candidates(irma.AttributeDisCon{{{Type: attr}}})
require.Empty(t, candidates) require.Empty(t, candidates)
require.NotEmpty(t, missing) require.NotEmpty(t, missing)
......
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