Skip to content

Commit

Permalink
feat: less bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Burdett <[email protected]>
  • Loading branch information
burdettadam committed Nov 8, 2023
1 parent 004d54d commit de9e7ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion oid4vci/demo/frontend/src/FormPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FormPage = () => {
lastname: lastName,
email,
},
credential_supported_id: selectedCredential,
supported_cred_id: selectedCredential,
})
.then((response) => {
console.log(response.data);
Expand Down
14 changes: 7 additions & 7 deletions oid4vci/oid4vci/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CredExRecordListQueryStringSchema(OpenAPISchema):
class CreateCredExSchema(OpenAPISchema):
"""Schema for CreateCredExSchema."""

credential_supported_id = fields.Str(
supported_cred_id = fields.Str(
required=True,
metadata={
"description": "Identifier used to identify credential supported record",
Expand Down Expand Up @@ -159,11 +159,11 @@ async def credential_exchange_list(request: web.BaseRequest):
session, exchange_id
)
# There should only be one record for a id
results = [record.dump()]
results = [vars(record)]
else:
# TODO: use filter
records = await OID4VCIExchangeRecord.query(session=session)
results = [record.dump() for record in records]
results = [vars(record) for record in records]
except (StorageError, BaseModelError, StorageNotFoundError) as err:
raise web.HTTPBadRequest(reason=err.roll_up) from err
return web.json_response({"results": results})
Expand All @@ -190,7 +190,7 @@ async def credential_exchange_create(request: web.BaseRequest):
context = request["context"]
body = await request.json()
LOGGER.info(f"creating exchange with {body}")
credential_supported_id = body.get("credential_supported_id")
supported_cred_id = body.get("supported_cred_id")
credential_subject = body.get("credential_subject")
# TODO: retrieve cred sup record and validate subjects
nonce = body.get("nonce")
Expand All @@ -199,7 +199,7 @@ async def credential_exchange_create(request: web.BaseRequest):

# create exchange record from submitted
record = OID4VCIExchangeRecord(
credential_supported_id=credential_supported_id,
supported_cred_id=supported_cred_id,
credential_subject=credential_subject,
nonce=nonce,
pin=pin,
Expand All @@ -209,7 +209,7 @@ async def credential_exchange_create(request: web.BaseRequest):

async with context.session() as session:
await record.save(session, reason="New oid4vci exchange")
return web.json_response({"exchange_id": record.credential_exchange_id})
return web.json_response({"exchange_id": record.exchange_id})


@docs(
Expand Down Expand Up @@ -298,7 +298,7 @@ async def credential_supported_create(request: web.BaseRequest):
scope = body.get("scope")

record = SupportedCredential(
credential_supported_id=credential_definition_id,
supported_cred_id=credential_definition_id,
format=format,
types=types,
cryptographic_binding_methods_supported=cryptographic_binding_methods_supported,
Expand Down

0 comments on commit de9e7ae

Please sign in to comment.