Skip to content

Commit

Permalink
Fix documentation for sphinx syntax
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Jul 3, 2024
1 parent 9cec4d6 commit 4874a30
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ class Format(Enum):
)
"""
Once we switch to anoncreds this will replace the above INDY definition.
In the meantime there are some hardcoded references in the
"...formats.indy.handler.IndyCredFormatHandler" class.
INDY = FormatSpec(
"hlindy/",
V20CredExRecordIndy,
DeferLoad(
"aries_cloudagent.protocols.issue_credential.v2_0"
".formats.anoncreds.handler.AnonCredsCredFormatHandler"
),
)
In the meantime there are some hardcoded references in the
"...formats.indy.handler.IndyCredFormatHandler" class.
::
INDY = FormatSpec(
"hlindy/",
V20CredExRecordIndy,
DeferLoad(
"aries_cloudagent.protocols.issue_credential.v2_0"
".formats.anoncreds.handler.AnonCredsCredFormatHandler"
),
)
"""
LD_PROOF = FormatSpec(
"aries/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ class Format(Enum):
),
)
"""
To make the switch from indy to anoncreds replace the above with the following
INDY = FormatSpec(
"hlindy/",
DeferLoad(
"aries_cloudagent.protocols.present_proof.v2_0"
".formats.anoncreds.handler.AnonCredsPresExchangeHandler"
),
)
To make the switch from indy to anoncreds replace the above with the following.
::
INDY = FormatSpec(
"hlindy/",
DeferLoad(
"aries_cloudagent.protocols.present_proof.v2_0"
".formats.anoncreds.handler.AnonCredsPresExchangeHandler"
),
)
"""
DIF = FormatSpec(
"dif/",
Expand Down
109 changes: 58 additions & 51 deletions aries_cloudagent/resolver/default/legacy_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,63 +31,70 @@ class LegacyDocCorrections:
conventions. This also helps with consistent processing of DID Docs.
Input example:
{
"@context": "https://w3id.org/did/v1",
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKey": [
::
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1",
"type": "Ed25519VerificationKey2018",
"controller": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKeyBase58": "AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
"@context": "https://w3id.org/did/v1",
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKey": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1",
"type": "Ed25519VerificationKey2018",
"controller": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKeyBase58": "AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
}
],
"authentication": [
{
"type": "Ed25519SignatureAuthentication2018",
"publicKey": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"
}
],
"service": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ;indy",
"type": "IndyAgent",
"priority": 0,
"recipientKeys": [
"AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
],
"routingKeys": ["9NnKFUZoYcCqYC2PcaXH3cnaGsoRfyGgyEHbvbLJYh8j"],
"serviceEndpoint": "http://bob:3000"
}
]
}
],
"authentication": [
{
"type": "Ed25519SignatureAuthentication2018",
"publicKey": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"
}
],
"service": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ;indy",
"type": "IndyAgent",
"priority": 0,
"recipientKeys": [
"AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
],
"routingKeys": ["9NnKFUZoYcCqYC2PcaXH3cnaGsoRfyGgyEHbvbLJYh8j"],
"serviceEndpoint": "http://bob:3000"
}
]
}
Output example:
{
"@context": "https://w3id.org/did/v1",
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"verificationMethod": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1",
"type": "Ed25519VerificationKey2018",
"controller": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKeyBase58": "AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
}
],
"authentication": ["did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"],
"service": [
::
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#didcomm",
"type": "did-communication",
"priority": 0,
"recipientKeys": ["did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"],
"routingKeys": [
"did:key:z6Mknq3MqipEt9hJegs6J9V7tiLa6T5H5rX3fFCXksJKTuv7#z6Mknq3MqipEt9hJegs6J9V7tiLa6T5H5rX3fFCXksJKTuv7"
],
"serviceEndpoint": "http://bob:3000"
"@context": "https://w3id.org/did/v1",
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"verificationMethod": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1",
"type": "Ed25519VerificationKey2018",
"controller": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ",
"publicKeyBase58": "AU2FFjtkVzjFuirgWieqGGqtNrAZWS9LDuB8TDp6EUrG"
}
],
"authentication": ["did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"],
"service": [
{
"id": "did:sov:JNKL9kJxQi5pNCfA8QBXdJ#didcomm",
"type": "did-communication",
"priority": 0,
"recipientKeys": ["did:sov:JNKL9kJxQi5pNCfA8QBXdJ#1"],
"routingKeys": [
"did:key:z6Mknq3MqipEt9hJegs6J9V7tiLa6T5H5rX3fFCXksJKTuv7#z6Mknq3MqipEt9hJegs6J9V7tiLa6T5H5rX3fFCXksJKTuv7"
],
"serviceEndpoint": "http://bob:3000"
}
]
}
]
}
"""

@staticmethod
Expand Down
3 changes: 3 additions & 0 deletions aries_cloudagent/wallet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ async def create_public_did(
"""Create and store a new public DID.
This method creates a new public DID using the specified DID method and key type.
The optional `seed` parameter can be used to provide a seed for the DID
generation.
If a `did` is provided, it will be used as the DID instead of generating a new
one.
The `metadata` parameter can be used to store additional metadata with the DID.
Args:
Expand Down
12 changes: 0 additions & 12 deletions aries_cloudagent/wallet/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,11 +1067,6 @@ async def wallet_jwt_sign(request: web.BaseRequest):
Args:
request (web.BaseRequest): The HTTP request object.
"headers": { ... },
"payload": { ... },
"did": "did:example:123",
"verificationMethod": "did:example:123#keys-1"
with did and verification being mutually exclusive.
Returns:
web.Response: The HTTP response containing the signed JWS.
Expand Down Expand Up @@ -1114,13 +1109,6 @@ async def wallet_sd_jwt_sign(request: web.BaseRequest):
Args:
request (web.BaseRequest): The HTTP request object.
Contains the request context and payload.
"headers": { ... },
"payload": { ... },
"did": "did:example:123",
"verificationMethod": "did:example:123#keys-1"
with did and verification being mutually exclusive.
"non_sd_list": []
Returns:
web.Response: The HTTP response object.
Expand Down

0 comments on commit 4874a30

Please sign in to comment.