Skip to content

Commit 609be86

Browse files
authored
🎨 Rename Anoncreds to AnonCreds (#3573)
* 🎨 Rename Anoncreds to AnonCreds Signed-off-by: ff137 <[email protected]> * 🎨 Organize imports Signed-off-by: ff137 <[email protected]> * 🎨 Rename Anoncreds to AnonCreds in docs and other files Signed-off-by: ff137 <[email protected]> * 🎨 Fix AnoncredsError Signed-off-by: ff137 <[email protected]> * 🎨 Rename AnonCreds in swagger titles Signed-off-by: ff137 <[email protected]> * 🎨 Include additional renames Signed-off-by: ff137 <[email protected]> * 📝 Updated openapi specs Signed-off-by: ff137 <[email protected]> * ⏪ Revert renaming owl-agent-test-harness tag Signed-off-by: ff137 <[email protected]> --------- Signed-off-by: ff137 <[email protected]>
1 parent 3caf680 commit 609be86

File tree

153 files changed

+979
-1127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+979
-1127
lines changed

.github/workflows/bdd-interop-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
run: |
8585
cd owl-agent-test-harness
8686
NO_TTY=1 LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -d acapy-main -t @critical -t ~@wip -t ~@T004-RFC0211 -t ~@DidMethod_orb -t ~@Transport_NoHttpOutbound -t ~@Anoncreds >> output.txt
87-
- name: Run Release or Nightly Interop Tests Anoncreds
87+
- name: Run Release or Nightly Interop Tests AnonCreds
8888
if: (steps.check_if_release.outputs.is_release == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' && steps.check-if-src-changed.outputs.run_tests != 'false')
8989
run: |
9090
cd owl-agent-test-harness

Managing-ACA-Py-Doc-Site.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ are a few files listed below that we don't generate into the documentation site,
6767
and they can be ignored.
6868

6969
- `assets/README.md`
70-
- `design/AnoncredsW3CCompatibility.md`
70+
- `design/AnonCredsW3CCompatibility.md`
7171
- `design/UpgradeViaApi.md`
7272
- `features/W3cCredentials.md`
7373

acapy_agent/admin/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"acapy::keylist::updated": "keylist",
6666
}
6767

68-
anoncreds_wallets = singletons.IsAnoncredsSingleton().wallets
68+
anoncreds_wallets = singletons.IsAnonCredsSingleton().wallets
6969
in_progress_upgrades = singletons.UpgradeInProgressSingleton()
7070

7171
status_paths = ("/status/live", "/status/ready")

acapy_agent/admin/tests/test_admin_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ async def test_upgrade_middleware(self):
567567
await storage.delete_record(upgrading_record)
568568

569569
# Upgrade in progress with cache
570-
singletons.IsAnoncredsSingleton().set_wallet(profile.name)
570+
singletons.IsAnonCredsSingleton().set_wallet(profile.name)
571571
await test_module.upgrade_middleware(request, handler)
572572

573573

acapy_agent/anoncreds/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
RevRegDefResult,
1717
)
1818
from .models.schema import AnonCredsSchema, GetSchemaResult, SchemaResult
19-
from .models.schema_info import AnoncredsSchemaInfo
19+
from .models.schema_info import AnonCredsSchemaInfo
2020

2121
T = TypeVar("T")
2222

@@ -138,12 +138,12 @@ async def get_revocation_list(
138138
@abstractmethod
139139
async def get_schema_info_by_id(
140140
self, profile: Profile, schema_id: str
141-
) -> AnoncredsSchemaInfo:
141+
) -> AnonCredsSchemaInfo:
142142
"""Get a schema info from the registry."""
143143

144144

145145
class BaseAnonCredsRegistrar(BaseAnonCredsHandler):
146-
"""Base Anoncreds Registrar."""
146+
"""Base AnonCreds Registrar."""
147147

148148
@abstractmethod
149149
async def register_schema(

acapy_agent/anoncreds/default/did_indy/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
RevRegDefResult,
1818
)
1919
from ...models.schema import AnonCredsSchema, GetSchemaResult, SchemaResult
20-
from ...models.schema_info import AnoncredsSchemaInfo
20+
from ...models.schema_info import AnonCredsSchemaInfo
2121

2222
LOGGER = logging.getLogger(__name__)
2323

@@ -122,6 +122,6 @@ async def update_revocation_list(
122122

123123
async def get_schema_info_by_id(
124124
self, profile: Profile, schema_id: str
125-
) -> AnoncredsSchemaInfo:
125+
) -> AnonCredsSchemaInfo:
126126
"""Get a schema info from the registry."""
127127
return await super().get_schema_info_by_id(schema_id)

acapy_agent/anoncreds/default/did_web/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
RevRegDefResult,
1818
)
1919
from ...models.schema import AnonCredsSchema, GetSchemaResult, SchemaResult
20-
from ...models.schema_info import AnoncredsSchemaInfo
20+
from ...models.schema_info import AnonCredsSchemaInfo
2121

2222
LOGGER = logging.getLogger(__name__)
2323

@@ -124,6 +124,6 @@ async def update_revocation_list(
124124

125125
async def get_schema_info_by_id(
126126
self, profile: Profile, schema_id: str
127-
) -> AnoncredsSchemaInfo:
127+
) -> AnonCredsSchemaInfo:
128128
"""Get a schema info from the registry."""
129129
return await super().get_schema_info_by_id(schema_id)

acapy_agent/anoncreds/default/legacy_indy/author.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
from acapy_agent.connections.models.conn_record import ConnRecord
88
from acapy_agent.messaging.models.base import BaseModelError
9-
from acapy_agent.protocols.endorse_transaction.v1_0.util import (
10-
get_endorser_connection_id,
11-
)
9+
from acapy_agent.protocols.endorse_transaction.v1_0.util import get_endorser_connection_id
1210
from acapy_agent.storage.error import StorageNotFoundError
1311

1412

acapy_agent/anoncreds/default/legacy_indy/registry.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,8 @@
7474
RevRegDefState,
7575
RevRegDefValue,
7676
)
77-
from ...models.schema import (
78-
AnonCredsSchema,
79-
GetSchemaResult,
80-
SchemaResult,
81-
SchemaState,
82-
)
83-
from ...models.schema_info import AnoncredsSchemaInfo
77+
from ...models.schema import AnonCredsSchema, GetSchemaResult, SchemaResult, SchemaState
78+
from ...models.schema_info import AnonCredsSchemaInfo
8479
from ...revocation import (
8580
CATEGORY_REV_LIST,
8681
CATEGORY_REV_REG_DEF,
@@ -1233,10 +1228,10 @@ async def txn_submit(
12331228

12341229
async def get_schema_info_by_id(
12351230
self, profile: Profile, schema_id: str
1236-
) -> AnoncredsSchemaInfo:
1231+
) -> AnonCredsSchemaInfo:
12371232
"""Get schema info by schema id."""
12381233
schema_id_parts = re.match(r"^(\w+):2:([^:]+):([^:]+)$", schema_id)
1239-
return AnoncredsSchemaInfo(
1234+
return AnonCredsSchemaInfo(
12401235
issuer_id=schema_id_parts.group(1),
12411236
name=schema_id_parts.group(2),
12421237
version=schema_id_parts.group(3),

acapy_agent/anoncreds/default/legacy_indy/tests/test_registry.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
from .....anoncreds.base import AnonCredsSchemaAlreadyExists
1717
from .....anoncreds.default.legacy_indy import registry as test_module
1818
from .....anoncreds.issuer import AnonCredsIssuer
19-
from .....askar.profile_anon import (
20-
AskarAnoncredsProfileSession,
21-
)
19+
from .....askar.profile_anon import AskarAnonCredsProfileSession
2220
from .....connections.models.conn_record import ConnRecord
2321
from .....core.event_bus import EventBus
2422
from .....ledger.base import BaseLedger
@@ -31,9 +29,7 @@
3129
from .....protocols.endorse_transaction.v1_0.models.transaction_record import (
3230
TransactionRecord,
3331
)
34-
from .....revocation_anoncreds.models.issuer_cred_rev_record import (
35-
IssuerCredRevRecord,
36-
)
32+
from .....revocation_anoncreds.models.issuer_cred_rev_record import IssuerCredRevRecord
3733
from .....tests import mock
3834
from .....utils.testing import create_test_profile
3935
from ....models.credential_definition import (
@@ -800,7 +796,7 @@ async def test_txn_submit(self):
800796
),
801797
),
802798
)
803-
@mock.patch.object(AskarAnoncredsProfileSession, "handle")
799+
@mock.patch.object(AskarAnonCredsProfileSession, "handle")
804800
async def test_register_revocation_list_no_endorsement(
805801
self, mock_handle, mock_send_revoc_reg_entry
806802
):
@@ -1165,7 +1161,7 @@ async def test_fix_ledger_entry(self, *_):
11651161
update=mock.MagicMock(return_value=MockRevListEntry())
11661162
),
11671163
)
1168-
@mock.patch.object(AskarAnoncredsProfileSession, "handle")
1164+
@mock.patch.object(AskarAnonCredsProfileSession, "handle")
11691165
async def test_sync_wallet_rev_list_with_issuer_cred_rev_records(
11701166
self, mock_handle, *_
11711167
):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Error messages for anoncreds."""
22

3-
ANONCREDS_PROFILE_REQUIRED_MSG = "AnonCreds interface requires AskarAnoncreds profile"
3+
ANONCREDS_PROFILE_REQUIRED_MSG = "AnonCreds interface requires AskarAnonCreds profile"

acapy_agent/anoncreds/holder.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Anoncreds holder implementation."""
1+
"""AnonCreds holder implementation."""
22

33
import asyncio
44
import json
@@ -22,7 +22,7 @@
2222
from pyld.jsonld import JsonLdProcessor
2323
from uuid_utils import uuid4
2424

25-
from ..askar.profile_anon import AskarAnoncredsProfile
25+
from ..askar.profile_anon import AskarAnonCredsProfile
2626
from ..core.error import BaseError
2727
from ..core.profile import Profile
2828
from ..storage.vc_holder.base import VCHolder
@@ -78,9 +78,9 @@ def __init__(self, profile: Profile):
7878
self._profile = profile
7979

8080
@property
81-
def profile(self) -> AskarAnoncredsProfile:
81+
def profile(self) -> AskarAnonCredsProfile:
8282
"""Accessor for the profile instance."""
83-
if not isinstance(self._profile, AskarAnoncredsProfile):
83+
if not isinstance(self._profile, AskarAnonCredsProfile):
8484
raise ValueError(ANONCREDS_PROFILE_REQUIRED_MSG)
8585

8686
return self._profile
@@ -598,10 +598,10 @@ async def create_presentation(
598598
599599
Args:
600600
presentation_request: Valid indy format presentation request
601-
requested_credentials: Anoncreds format requested credentials
602-
schemas: Anoncreds formatted schemas JSON
603-
credential_definitions: Anoncreds formatted credential definitions JSON
604-
rev_states: Anoncreds format revocation states JSON
601+
requested_credentials: AnonCreds format requested credentials
602+
schemas: AnonCreds formatted schemas JSON
603+
credential_definitions: AnonCreds formatted credential definitions JSON
604+
rev_states: AnonCreds format revocation states JSON
605605
606606
"""
607607

@@ -691,9 +691,9 @@ async def create_presentation_w3c(
691691
presentation_request: Valid indy format presentation request
692692
requested_credentials_w3c: W3C format requested credentials
693693
credentials_w3c_metadata: W3C format credential metadata
694-
schemas: Anoncreds formatted schemas JSON
695-
credential_definitions: Anoncreds formatted credential definitions JSON
696-
rev_states: Anoncreds format revocation states JSON
694+
schemas: AnonCreds formatted schemas JSON
695+
credential_definitions: AnonCreds formatted credential definitions JSON
696+
rev_states: AnonCreds format revocation states JSON
697697
698698
"""
699699
present_creds = PresentCredentials()

acapy_agent/anoncreds/issuer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818
from aries_askar import AskarError
1919

20-
from ..askar.profile_anon import AskarAnoncredsProfile, AskarAnoncredsProfileSession
20+
from ..askar.profile_anon import AskarAnonCredsProfile, AskarAnonCredsProfileSession
2121
from ..core.error import BaseError
2222
from ..core.event_bus import Event, EventBus
2323
from ..core.profile import Profile
@@ -91,9 +91,9 @@ def __init__(self, profile: Profile):
9191
self._profile = profile
9292

9393
@property
94-
def profile(self) -> AskarAnoncredsProfile:
94+
def profile(self) -> AskarAnonCredsProfile:
9595
"""Accessor for the profile instance."""
96-
if not isinstance(self._profile, AskarAnoncredsProfile):
96+
if not isinstance(self._profile, AskarAnonCredsProfile):
9797
raise ValueError(ANONCREDS_PROFILE_REQUIRED_MSG)
9898

9999
return self._profile
@@ -105,7 +105,7 @@ async def notify(self, event: Event):
105105

106106
async def _finish_registration(
107107
self,
108-
txn: AskarAnoncredsProfileSession,
108+
txn: AskarAnonCredsProfileSession,
109109
category: str,
110110
job_id: str,
111111
registered_id: str,

acapy_agent/anoncreds/models/credential.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
)
1818

1919

20-
class AnoncredsAttrValue(BaseModel):
21-
"""Anoncreds attribute value."""
20+
class AnonCredsAttrValue(BaseModel):
21+
"""AnonCreds attribute value."""
2222

2323
class Meta:
24-
"""Anoncreds attribute value."""
24+
"""AnonCreds attribute value."""
2525

26-
schema_class = "AnoncredsAttrValueSchema"
26+
schema_class = "AnonCredsAttrValueSchema"
2727

2828
def __init__(
2929
self, raw: Optional[str] = None, encoded: Optional[str] = None, **kwargs
@@ -34,13 +34,13 @@ def __init__(
3434
self.encoded = encoded
3535

3636

37-
class AnoncredsAttrValueSchema(BaseModelSchema):
38-
"""Anoncreds attribute value schema."""
37+
class AnonCredsAttrValueSchema(BaseModelSchema):
38+
"""AnonCreds attribute value schema."""
3939

4040
class Meta:
41-
"""Anoncreds attribute value schema metadata."""
41+
"""AnonCreds attribute value schema metadata."""
4242

43-
model_class = AnoncredsAttrValue
43+
model_class = AnonCredsAttrValue
4444
unknown = EXCLUDE
4545

4646
raw = fields.Str(required=True, metadata={"description": "Attribute raw value"})
@@ -54,14 +54,14 @@ class Meta:
5454
)
5555

5656

57-
class DictWithAnoncredsAttrValueSchema(fields.Dict):
57+
class DictWithAnonCredsAttrValueSchema(fields.Dict):
5858
"""Dict with anoncreds attribute value schema."""
5959

6060
def __init__(self, **kwargs):
61-
"""Initialize the custom schema for a dictionary with AnoncredsAttrValue."""
61+
"""Initialize the custom schema for a dictionary with AnonCredsAttrValue."""
6262
super().__init__(
6363
keys=fields.Str(metadata={"description": "Attribute name"}),
64-
values=fields.Nested(AnoncredsAttrValueSchema()),
64+
values=fields.Nested(AnonCredsAttrValueSchema()),
6565
**kwargs,
6666
)
6767

@@ -71,7 +71,7 @@ def _deserialize(self, value, attr, data, **kwargs):
7171
raise ValidationError("Value must be a dict.")
7272

7373
errors = {}
74-
anoncreds_attr_value_schema = AnoncredsAttrValueSchema()
74+
anoncreds_attr_value_schema = AnonCredsAttrValueSchema()
7575

7676
for k, v in value.items():
7777
if isinstance(v, dict):
@@ -85,20 +85,20 @@ def _deserialize(self, value, attr, data, **kwargs):
8585
return value
8686

8787

88-
class AnoncredsCredential(BaseModel):
89-
"""Anoncreds credential."""
88+
class AnonCredsCredential(BaseModel):
89+
"""AnonCreds credential."""
9090

9191
class Meta:
92-
"""Anoncreds credential metadata."""
92+
"""AnonCreds credential metadata."""
9393

94-
schema_class = "AnoncredsCredentialSchema"
94+
schema_class = "AnonCredsCredentialSchema"
9595

9696
def __init__(
9797
self,
9898
schema_id: Optional[str] = None,
9999
cred_def_id: Optional[str] = None,
100100
rev_reg_id: Optional[str] = None,
101-
values: Mapping[str, AnoncredsAttrValue] = None,
101+
values: Mapping[str, AnonCredsAttrValue] = None,
102102
signature: Optional[Mapping] = None,
103103
signature_correctness_proof: Optional[Mapping] = None,
104104
rev_reg: Optional[Mapping] = None,
@@ -115,13 +115,13 @@ def __init__(
115115
self.witness = witness
116116

117117

118-
class AnoncredsCredentialSchema(BaseModelSchema):
119-
"""Anoncreds credential schema."""
118+
class AnonCredsCredentialSchema(BaseModelSchema):
119+
"""AnonCreds credential schema."""
120120

121121
class Meta:
122-
"""Anoncreds credential schemametadata."""
122+
"""AnonCreds credential schemametadata."""
123123

124-
model_class = AnoncredsCredential
124+
model_class = AnonCredsCredential
125125
unknown = EXCLUDE
126126

127127
schema_id = fields.Str(
@@ -148,7 +148,7 @@ class Meta:
148148
"example": ANONCREDS_REV_REG_ID_EXAMPLE,
149149
},
150150
)
151-
values = DictWithAnoncredsAttrValueSchema(
151+
values = DictWithAnonCredsAttrValueSchema(
152152
required=True,
153153
metadata={"description": "Credential attributes"},
154154
)

0 commit comments

Comments
 (0)