Skip to content

Commit

Permalink
extra_settings dict field update
Browse files Browse the repository at this point in the history
Signed-off-by: Shaanjot Gill <[email protected]>
  • Loading branch information
shaangill025 committed Jun 27, 2023
1 parent 8ff4a97 commit caea160
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
10 changes: 4 additions & 6 deletions Multitenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ To allow configurablity of ACA-Py startup parameters/environment variables at a
"wallet_dispatch_type": "base",
"extra_settings": {
"ACAPY_LOG_LEVEL": "INFO",
"ACAPY_INVITE_PUBLIC": "true",
"ACAPY_PUBLIC_INVITES": "True",
"ACAPY_INVITE_PUBLIC": true,
"ACAPY_PUBLIC_INVITES": true
},
}
```
Expand All @@ -442,8 +442,8 @@ To allow configurablity of ACA-Py startup parameters/environment variables at a
"image_url": " ... ",
"extra_settings": {
"ACAPY_LOG_LEVEL": "INFO",
"ACAPY_INVITE_PUBLIC": "True",
"ACAPY_PUBLIC_INVITES": "false",
"ACAPY_INVITE_PUBLIC": true,
"ACAPY_PUBLIC_INVITES": false
},
}
```
Expand All @@ -454,5 +454,3 @@ To allow configurablity of ACA-Py startup parameters/environment variables at a
-H "x-api-key: $ACAPY_ADMIN_URL_API_KEY" \
-d @-
```

All the currently suppoorted settings in `extra_settings` are either accepting str or boolean. But the bool attributes in the request body should be passed along as a string such as `"true", "True", "false", "False"`.
23 changes: 5 additions & 18 deletions aries_cloudagent/multitenant/admin/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
response_schema,
)
from marshmallow import ValidationError, fields, validate, validates_schema
from typing import Union

from ...admin.request_context import AdminRequestContext
from ...core.error import BaseError
Expand Down Expand Up @@ -62,16 +61,6 @@ def format_wallet_record(wallet_record: WalletRecord):
return wallet_info


def process_bool_label(label: str) -> Union[bool, str]:
"""Return processed extra settings dict value."""
if label == "True" or label == "true":
return True
elif label == "False" or label == "false":
return False
else:
return label


def get_extra_settings_dict_per_tenant(tenant_settings: dict) -> dict:
"""Get per tenant settings to be applied when creating wallet."""

Expand All @@ -91,7 +80,7 @@ def get_extra_settings_dict_per_tenant(tenant_settings: dict) -> dict:
continue
if flag != "ACAPY_ENDORSER_ROLE":
map_flag = ACAPY_LIFECYCLE_CONFIG_FLAG_MAP[flag]
extra_settings[map_flag] = process_bool_label(tenant_settings[flag])
extra_settings[map_flag] = tenant_settings[flag]
return extra_settings


Expand All @@ -117,9 +106,8 @@ class CreateWalletRequestSchema(OpenAPISchema):
)

extra_settings = fields.Dict(
keys=fields.Str(description="Agent Config Flag"),
values=fields.Str(description="Parameter"),
allow_none=True,
description="Agent config key-value pairs",
required=False,
)

wallet_key_derivation = fields.Str(
Expand Down Expand Up @@ -209,9 +197,8 @@ class UpdateWalletRequestSchema(OpenAPISchema):
validate=validate.OneOf(["default", "both", "base"]),
)
extra_settings = fields.Dict(
keys=fields.Str(description="Agent Config Flag"),
values=fields.Str(description="Parameter"),
allow_none=True,
description="Agent config key-value pairs",
required=False,
)
wallet_webhook_urls = fields.List(
fields.Str(
Expand Down

0 comments on commit caea160

Please sign in to comment.