Skip to content

Commit

Permalink
refactor: verification relationship prop
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Oct 19, 2023
1 parent 181df3e commit 38319cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/did_peer_2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class PurposeCode(Enum):
capability_delegation = "D"
service = "S"

def to_verification_relationship(self) -> str:
@property
def verification_relationship(self) -> str:
"""Convert the purpose code to a verification relationship."""
return {
"A": "assertionMethod",
Expand Down Expand Up @@ -241,7 +242,7 @@ def resolve(did: str) -> Dict[str, Any]:
"publicKeyMultibase": key.material,
}
document.setdefault("verificationMethod", []).append(verification_method)
document.setdefault(key.purpose.to_verification_relationship(), []).append(
document.setdefault(key.purpose.verification_relationship, []).append(
f"#key-{index}"
)
additional_contexts.update(key.required_contexts)
Expand Down

0 comments on commit 38319cb

Please sign in to comment.