diff --git a/pkg/advancedapi/advancedApi.go b/pkg/advancedapi/advancedApi.go index 7a57d74..033214f 100644 --- a/pkg/advancedapi/advancedApi.go +++ b/pkg/advancedapi/advancedApi.go @@ -500,9 +500,6 @@ func createProof( ) (*register.Issuer, *proof.Proof, error) { for _, v := range subjectDoc.PublicKeys { if v.PublicKeyBase58 == subjectKeyPair.PublicKeyBase58 { - if v.Revoked { - return nil, nil, fmt.Errorf("subject public key is revoked") - } issuer, err := register.NewIssuer(subjectDoc.ID, v.ID) if err != nil { return nil, nil, err @@ -545,9 +542,6 @@ func ValidateDocumentProof(document *register.RegisterDocument) error { publicKeyBytes := base58.DecodeAlphabet(v.PublicKeyBase58, base58.BTCAlphabet) did, _ := identity.MakeIdentifier(publicKeyBytes) if did == document.ID { - if v.Revoked { - return fmt.Errorf("subject public key is revoked") - } docProof := &proof.Proof{ IssuerDid: document.ID, IssuerName: v.ID, diff --git a/pkg/advancedapi/advancedApi_test.go b/pkg/advancedapi/advancedApi_test.go index 9dd38de..07687c6 100644 --- a/pkg/advancedapi/advancedApi_test.go +++ b/pkg/advancedapi/advancedApi_test.go @@ -54,7 +54,7 @@ func Test_can_get_generic_delegation_proof(t *testing.T) { assert.DeepEqual(t, proof.Content, []byte("")) } -func Test_cannot_get_delegation_proof(t *testing.T) { +func Test_can_get_delegation_proof_with_revoked_key(t *testing.T) { ctx := context.TODO() subjectDoc, subjectIssuer := test.HelperGetRegisterDocumentFromSecret(test.ValidKeyPairPlop, "#name", identity.User) delegatingIssuer, err := register.NewIssuer("did:iotics:iotXarXAbViugciWyuFmwRTbNoB6y8Wievfn", "#user-0") @@ -81,7 +81,7 @@ func Test_cannot_get_delegation_proof(t *testing.T) { assert.NilError(t, err) _, _, err = advancedapi.CreateDelegationProof(delegatingIssuer, subjectDoc, test.ValidKeyPairPlop) - assert.ErrorContains(t, err, "key is revoked") + assert.NilError(t, err) } func Test_can_get_document_if_exists(t *testing.T) { @@ -540,7 +540,7 @@ func Test_can_validate_document_proof(t *testing.T) { assert.NilError(t, err) } -func Test_cannot_validate_document_proof(t *testing.T) { +func Test_can_validate_document_proof_with_revoked_key(t *testing.T) { ctx := context.TODO() resolver := test.NewInMemoryResolver() twinID, _, err := advancedapi.CreateNewIdentityAndRegister(ctx, resolver, identity.Twin, test.ValidKeyPairPlop, "#ExistingId", false) @@ -561,7 +561,7 @@ func Test_cannot_validate_document_proof(t *testing.T) { assert.NilError(t, err) err = advancedapi.ValidateDocumentProof(doc) - assert.ErrorContains(t, err, "key is revoked") + assert.NilError(t, err) } func Test_can_create_seed(t *testing.T) {