Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change arg_parse to always set --emit-new-didcomm-prefix and --emit-new-didcomm-mime-type to true #2517

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions aries_cloudagent/config/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,8 @@ def add_arguments(self, parser: ArgumentParser):
help=(
"Emit protocol messages with new DIDComm prefix; i.e., "
"'https://didcomm.org/' instead of (default) prefix "
"'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/'."
"'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/'. "
"Forced to `true` as the old prefix must never be used."
),
)
parser.add_argument(
Expand All @@ -1217,7 +1218,8 @@ def add_arguments(self, parser: ArgumentParser):
help=(
"Send packed agent messages with the DIDComm MIME type "
"as of RFC 0044; i.e., 'application/didcomm-envelope-enc' "
"instead of 'application/ssi-agent-wire'."
"instead of 'application/ssi-agent-wire'. "
"Forced to `true` as the old MIME type must never be used."
),
)
parser.add_argument(
Expand Down Expand Up @@ -1288,10 +1290,10 @@ def get_settings(self, args: Namespace) -> dict:
raise ArgsParseError("Error writing trace event " + str(e))
if args.preserve_exchange_records:
settings["preserve_exchange_records"] = True
if args.emit_new_didcomm_prefix:
settings["emit_new_didcomm_prefix"] = True
if args.emit_new_didcomm_mime_type:
settings["emit_new_didcomm_mime_type"] = True
# NOT setting the following two parameters `True` is no longer supported
# Even if the args are not set, the config setting is True.
settings["emit_new_didcomm_prefix"] = True
settings["emit_new_didcomm_mime_type"] = True
if args.exch_use_unencrypted_tags:
settings["exch_use_unencrypted_tags"] = True
environ["EXCH_UNENCRYPTED_TAGS"] = "True"
Expand Down
2 changes: 2 additions & 0 deletions aries_cloudagent/protocols/tests/test_didcomm_prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def test_didcomm_prefix(self):
f"{DIDCommPrefix.NEW.value}/hello"
)

# No longer possible to have the arg `False` but leaving in test
# Still want to be able to receive the OLD format, just not emit it
DIDCommPrefix.set({"emit_new_didcomm_prefix": False})
assert environ.get("DIDCOMM_PREFIX") == DIDCommPrefix.OLD.value
assert DIDCommPrefix.qualify_current("hello") == (
Expand Down