Skip to content

Commit

Permalink
feat: multiple id bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Burdett <[email protected]>
  • Loading branch information
burdettadam committed Nov 15, 2023
1 parent 6436a7a commit e82b3e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions oid4vci/oid4vci/v1_0/models/supported_cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def __init__(
self.display = display
self.format_data = format_data

@property
def supported_cred_id(self):
"""Accessor for the ID associated with this record."""
return self._id
# @property
# def supported_cred_id(self):
# """Accessor for the ID associated with this record."""
# return self._id

@property
def record_value(self) -> dict:
Expand Down Expand Up @@ -110,6 +110,10 @@ class Meta:

model_class = SupportedCredential

supported_cred_id = fields.Str(
required=False,
description="supported credential identifier",
)
format = fields.Str(required=True, metadata={"example": "jwt_vc_json"})
identifier = fields.Str(
data_key="id", required=True, metadata={"example": "UniversityDegreeCredential"}
Expand Down
6 changes: 4 additions & 2 deletions oid4vci/oid4vci/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,21 @@ async def credential_supported_create(request: web.Request):
profile = context.profile

body: Dict[str, Any] = await request.json()

LOGGER.info(f"body: {body}")
known = {
k: body.pop(k)
for k in (
"format",
"id",
# "id",
"cryptographic_binding_methods_supported",
"cryptographic_suites_supported",
"display",
)
if k in body
}
format_specific = body
LOGGER.info(f"format_data: {format_specific}")
LOGGER.info(f"known: {known}")

record = SupportedCredential(
**known,
Expand Down

0 comments on commit e82b3e9

Please sign in to comment.