Skip to content

Commit

Permalink
Merge pull request #1714 from DaevMithran/Issue-1682
Browse files Browse the repository at this point in the history
Add seed command line parameter but use only if also an "allow insecure seed" parameter is set
  • Loading branch information
swcurran authored Aug 22, 2022
2 parents e22e84b + fde8491 commit 2a0e088
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions aries_cloudagent/wallet/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ class DIDCreateSchema(OpenAPISchema):
description="To define a key type for a did:key",
)

seed = fields.Str(
required=False,
description=(
"Optional seed to use for DID, Must be"
"enabled in configuration before use."
),
example="000000000000000000000000Trustee1",
)


class CreateAttribTxnForEndorserOptionSchema(OpenAPISchema):
"""Class for user to input whether to create a transaction for endorser or not."""
Expand Down Expand Up @@ -349,9 +358,9 @@ async def wallet_create_did(request: web.BaseRequest):
f" support key type {key_type.key_type}"
)
)
seed = None
if context.settings.get("wallet.allow_insecure_seed"):
seed = body.get("seed") or None
seed = body.get("seed") or None
if seed and not context.settings.get("wallet.allow_insecure_seed"):
raise web.HTTPBadRequest(reason="Seed support is not enabled")
info = None
async with context.session() as session:
wallet = session.inject_or(BaseWallet)
Expand Down

0 comments on commit 2a0e088

Please sign in to comment.