fixes #7918 - onepassword lookup fails if field name contains uppercase letters and section is specified (#7919)

* fix #7918

* Update plugins/lookup/onepassword.py

Co-authored-by: Sam Doran <github@samdoran.com>

* onepassword lookup: transform field ids to lowercase

* #7918: added unit tests

* #7919: add changelog fragment

* Update changelogs/fragments/7919-onepassword-fieldname-casing.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Sam Doran <github@samdoran.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Benjamin Mitzkus 2024-02-16 13:53:07 +01:00 committed by GitHub
commit 6088e2dc0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 277 additions and 2 deletions

View file

@ -0,0 +1,102 @@
{
"id": "bgqegp3xcxnpfkb45olwigpkpi",
"title": "LabelCasing",
"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-with-values"
}
],
"fields": [
{
"id": "lowercaseid",
"type": "STRING",
"purpose": "USERNAME",
"label": "label0",
"value": "lowercaseid",
"reference": "op://Testcase/LabelCasing/lowercase"
},
{
"id": "MiXeDcAsEiD",
"type": "STRING",
"purpose": "USERNAME",
"label": "label1",
"value": "mixedcaseid",
"reference": "op://Testcase/LabelCasing/lowercase"
},
{
"id": "id1",
"type": "STRING",
"purpose": "USERNAME",
"label": "lowercaselabel",
"value": "lowercaselabel",
"reference": "op://Testcase/LabelCasing/lowercase"
},
{
"id": "id2",
"type": "STRING",
"purpose": "USERNAME",
"label": "MiXeDcAsElAbEl",
"value": "mixedcaselabel",
"reference": "op://Testcase/LabelCasing/lowercase"
},
{
"id": "sectionlowercaseid",
"type": "STRING",
"purpose": "USERNAME",
"label": "label2",
"value": "sectionlowercaseid",
"reference": "op://Testcase/LabelCasing/lowercase",
"section": {
"id": "7osqcvd43i75teocdzbb6d7mie",
"label": "section-with-values"
}
},
{
"id": "SeCtIoNmIxEdCaSeId",
"type": "STRING",
"purpose": "USERNAME",
"label": "label3",
"value": "sectionmixedcaseid",
"reference": "op://Testcase/LabelCasing/lowercase",
"section": {
"id": "7osqcvd43i75teocdzbb6d7mie",
"label": "section-with-values"
}
},
{
"id": "id3",
"type": "STRING",
"purpose": "USERNAME",
"label": "sectionlowercaselabel",
"value": "sectionlowercaselabel",
"reference": "op://Testcase/LabelCasing/lowercase",
"section": {
"id": "7osqcvd43i75teocdzbb6d7mie",
"label": "section-with-values"
}
},
{
"id": "id2",
"type": "STRING",
"purpose": "USERNAME",
"label": "SeCtIoNmIxEdCaSeLaBeL",
"value": "sectionmixedcaselabel",
"reference": "op://Testcase/LabelCasing/lowercase",
"section": {
"id": "7osqcvd43i75teocdzbb6d7mie",
"label": "section-with-values"
}
}
]
}

View file

@ -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