mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
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:
parent
0a35eb2dda
commit
6088e2dc0f
5 changed files with 277 additions and 2 deletions
|
@ -123,5 +123,173 @@ MOCK_ENTRIES = {
|
|||
"expected": [""],
|
||||
"output": load_file("v2_out_04.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase id (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "lowercaseid",
|
||||
},
|
||||
"expected": ["lowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase id (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "LOWERCASEID",
|
||||
},
|
||||
"expected": ["lowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase label (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "lowercaselabel",
|
||||
},
|
||||
"expected": ["lowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase label (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "LOWERCASELABEL",
|
||||
},
|
||||
"expected": ["lowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case id (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "MiXeDcAsEiD",
|
||||
},
|
||||
"expected": ["mixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case id (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "mixedcaseid",
|
||||
},
|
||||
"expected": ["mixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case label (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "MiXeDcAsElAbEl",
|
||||
},
|
||||
"expected": ["mixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case label (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "mixedcaselabel",
|
||||
},
|
||||
"expected": ["mixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "sectionlowercaseid",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "SECTIONLOWERCASEID",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "sectionlowercaselabel",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "SECTIONLOWERCASELABEL",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "SeCtIoNmIxEdCaSeId",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "sectionmixedcaseid",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "SeCtIoNmIxEdCaSeLaBeL",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case not matching)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["LabelCasing"],
|
||||
"kwargs": {
|
||||
"field": "sectionmixedcaselabel",
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue