forked from ansible-collections/community.general
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…-collections#7240) (ansible-collections#7241) A OnePassword field item might not have a value (property) when the user has omitted it (on purpose).
- Loading branch information
1 parent
17f1477
commit 7bbfc69
Showing
5 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/7241-prevent-key-error-when-value-does-not-exist.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- onepassword - fix KeyError exception when trying to access value of a field that is not filled out in OnePassword item (https://github.com/ansible-collections/community.general/pull/7241). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
tests/unit/plugins/lookup/onepassword_fixtures/v2_out_04.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"id": "bgqegp3xcxnpfkb45olwigpkpi", | ||
"title": "OmittedValues", | ||
"version": 1, | ||
"vault": { | ||
"id": "stpebbaccrq72xulgouxsk4p7y", | ||
"name": "Private" | ||
}, | ||
"category": "LOGIN", | ||
"last_edited_by": "WOUTERRUYBH7BFPHMZ2KKGL6AU", | ||
"created_at": "2023-09-12T08:30:07Z", | ||
"updated_at": "2023-09-12T08:30:07Z", | ||
"additional_information": "fluxility", | ||
"sections": [ | ||
{ | ||
"id": "7osqcvd43i75teocdzbb6d7mie", | ||
"label": "section-without-values" | ||
} | ||
], | ||
"fields": [ | ||
{ | ||
"id": "username", | ||
"type": "STRING", | ||
"purpose": "USERNAME", | ||
"label": "username", | ||
"value": "fluxility", | ||
"reference": "op://Testcase/OmittedValues/username" | ||
}, | ||
{ | ||
"id": "password", | ||
"type": "CONCEALED", | ||
"purpose": "PASSWORD", | ||
"label": "password", | ||
"value": "j89Dyb7psat*[email protected]_V_xtMhrn37rQ_2uRYoRiozj6TjWVLy2pbfEvjnse", | ||
"entropy": 427.01202392578125, | ||
"reference": "op://Testcase/OmittedValues/password", | ||
"password_details": { | ||
"entropy": 427, | ||
"generated": true, | ||
"strength": "FANTASTIC" | ||
} | ||
}, | ||
{ | ||
"id": "notesPlain", | ||
"type": "STRING", | ||
"purpose": "NOTES", | ||
"label": "notesPlain", | ||
"reference": "op://Testcase/OmittedValues/notesPlain" | ||
}, | ||
{ | ||
"id": "67890q7mspf4x6zrlw3qejn7m", | ||
"type": "URL", | ||
"label": "label-without-value", | ||
"reference": "op://01202392578125/OmittedValues/section-without-values/section-without-value" | ||
}, | ||
{ | ||
"id": "123345q7mspf4x6zrlw3qejn7m", | ||
"section": { | ||
"id": "6hbtca5yrlmoptgy3nw74222", | ||
"label": "section-without-values" | ||
}, | ||
"type": "URL", | ||
"label": "section-label-without-value", | ||
"reference": "op://01202392578125/OmittedValues/section-without-values/section-without-value" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/unit/plugins/lookup/onepassword_fixtures/v2_out_04.json.license
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
SPDX-FileCopyrightText: 2022, Ansible Project |