Skip to content

Commit

Permalink
Tweaks to DID fetching
Browse files Browse the repository at this point in the history
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
esune committed Mar 25, 2024
1 parent 510b68f commit 811ac68
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docker/manage
Original file line number Diff line number Diff line change
@@ -174,8 +174,8 @@ configureEnvironment() {

#controller app settings
export SET_NON_REVOKED="True"
export USE_OOB_PRESENT_PROOF=${USE_OOB_PRESENT_PROOF:-"True"}
export USE_OOB_LOCAL_DID_SERVICE=${USE_OOB_LOCAL_DID_SERVICE:-"True"}
export USE_OOB_PRESENT_PROOF=${USE_OOB_PRESENT_PROOF:-"false"}
export USE_OOB_LOCAL_DID_SERVICE=${USE_OOB_LOCAL_DID_SERVICE:-"true"}

# agent
export AGENT_TENANT_MODE="${AGENT_TENANT_MODE:-single}"
2 changes: 1 addition & 1 deletion docs/ConfigurationGuide.md
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ Several functions in VC-AuthN can be tweaked by using the following environment
| ------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| SET_NON_REVOKED | bool | if True, the `non_revoked` attributed will be added to each of the present-proof request `requested_attribute` and `requested_predicate` with 'from=0' and'to=`int(time.time())` | |
| USE_OOB_PRESENT_PROOF | bool | if True, the present-proof request will be provided as a an [out of band](https://github.com/hyperledger/aries-rfcs/tree/main/features/0434-outofband) invitation with a [present-proof](https://github.com/hyperledger/aries-rfcs/tree/main/features/0037-present-proof) request inside. If False, the present-proof request will be use the [service-decorator](https://github.com/hyperledger/aries-rfcs/tree/main/features/0056-service-decorator) | **TRUE:** BC Wallet supports our OOB Message with a minor glitch, BiFold, Lissi, Trinsic, and Estatus all read the QR code as 'Invalid' |
| USE_OOB_LOCAL_DID_SERVICE | bool | Instructs VC-AuthN to use a local DID, useful if the agent service is not registered on the ledger with a public DID | Use this when `ACAPY_WALLET_LOCAL_DID` is set to `true` in the agent. |
| USE_OOB_LOCAL_DID_SERVICE | bool | Instructs VC-AuthN to use a local DID, it must be used when the agent service is not registered on the ledger with a public DID | Use this when `ACAPY_WALLET_LOCAL_DID` is set to `true` in the agent. |
| LOG_WITH_JSON | bool | If True, logging output should printed as JSON if False it will be pretty printed. | Default behavior will print as JSON. |
| LOG_TIMESTAMP_FORMAT | string | determines the timestamp formatting used in logs | Default is "iso" |
| LOG_LEVEL | "DEBUG", "INFO", "WARNING", or "ERROR" | sets the minimum log level that will be printed to standard out | Defaults to DEBUG |
15 changes: 5 additions & 10 deletions oidc-controller/api/routers/oidc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import base64
import io
import json
from typing import cast
import uuid
from datetime import datetime
from typing import cast
from urllib.parse import urlencode

import qrcode
@@ -116,11 +116,9 @@ async def get_authorize(request: Request, db: Database = Depends(get_db)):
response = client.create_presentation_request(ver_config.generate_proof_request())
pres_exch_dict = response.dict()

# Prepeare the presentation request
# Prepeare the presentation request
client = AcapyClient()
use_public_did = (
not settings.USE_OOB_PRESENT_PROOF
) and settings.USE_OOB_LOCAL_DID_SERVICE
use_public_did = not settings.USE_OOB_LOCAL_DID_SERVICE
wallet_did = client.get_wallet_did(public=use_public_did)

byo_attachment = PresentProofv10Attachment.build(
@@ -135,7 +133,6 @@ async def get_authorize(request: Request, db: Database = Depends(get_db)):
recipient_keys=[wallet_did.verkey],
).dict()
else:
wallet_did = client.get_wallet_did(public=True)
oob_s_d = wallet_did.verkey

msg = PresentationRequestMessage(
@@ -163,9 +160,8 @@ async def get_authorize(request: Request, db: Database = Depends(get_db)):
service=s_d,
)
msg_contents = msg


# Create and save OIDC AuthSession

# Create and save OIDC AuthSession
new_auth_session = AuthSessionCreate(
response_url=authn_response.request(auth_req["redirect_uri"]),
pyop_auth_code=authn_response["code"],
@@ -195,7 +191,6 @@ async def get_authorize(request: Request, db: Database = Depends(get_db)):
base64_msg = base64.b64encode(formated_msg.encode("utf-8")).decode("utf-8")
wallet_deep_link = f"bcwallet://aries_proof-request?c_i={base64_msg}"


# This is the payload to send to the template
data = {
"image_contents": image_contents,

0 comments on commit 811ac68

Please sign in to comment.