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

[BUG] Handle get key operation when no tag has been set #3256

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

PatStLouis
Copy link
Contributor

@PatStLouis PatStLouis commented Sep 26, 2024

Handle cases where a key doesn't have a tags property.

@dbluhm @jamshale small but critical bug introduced by my last PR, I was under the impression every key had tags by default but it doesn't seem like so, this will handle such cases.

PatStLouis and others added 3 commits September 25, 2024 22:17
Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>
Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>
Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
@PatStLouis
Copy link
Contributor Author

another fix could be to change this line:
https://github.com/OpSecId/aries-cloudagent-python/blob/036f108a5ea4fbc4805b49be6bdc8fd02b1511f6/aries_cloudagent/wallet/askar.py#L100

from:

if kid:
    tags = {"kid": kid}
else:
    tags = None

to

if kid:
    tags = {"kid": kid}
else:
    tags = {}

I believe this would be more consistent as a fix since all keys will have a tags object. Any opinion?

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
@PatStLouis
Copy link
Contributor Author

I made a combination of @jamshale suggestion and the latter idea.

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
Copy link

sonarcloud bot commented Sep 26, 2024

@jamshale jamshale merged commit 9163871 into openwallet-foundation:main Sep 26, 2024
11 checks passed
ff137 pushed a commit to ff137/acapy that referenced this pull request Oct 22, 2024
…oundation#3256)

* Bug-fix

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>

* Update in_memory.py

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>

* linting

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* apply better suggestion

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* set empty tags object instead of none for consistency

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

* remove unnecessary change in the in memory wallet

Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>

---------

Signed-off-by: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com>
Signed-off-by: PatStLouis <patrick.st-louis@opsecid.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants