Closed bitjip closed 10 months ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @Rylon click here for bot help
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @azenk @samdoran @scottsb click here for bot help
+1
I'm not sure why this should be a bug. The lookup does not claim to be case-insensitive w.r.t. section and field name. So this looks more like a feature request to me?
(This might simply be a expectation mismatch as well because other 1Password tools are case insensitive. I don't know whether you can add two different sections which only differ by casing, or two different fields that differ only by casing.)
It seems like an expectation mismatch which could be interpreted as a bug. I think it would be good to make the field name matching case insensitive since the items created in 1Password may be either "Password" or "password".
Is the field name selected by the user? I'm wondering why it's sometimes password
and sometimes Password
. If it is determined by the user, is it possible to add both a password
and a Password
field to the same entry?
1Password creates the field, but the user can change it. I'm thinking that may older versions of 1Password created items with a 'Password' label, but I'm not sure.
If it is determined by the user, is it possible to add both a password and a Password field to the same entry?
Yes. There is an id
and label
for each item. id
is a unique value. label
is what is visible in the UI. The plugins favor label
over id
when looking for the requested value. The first matched value is returned.
Sounds like a good matching algorithm needs to be somewhat complex then :)
@felixfontein for clarification: the problem is that the behaviour of the lookup plugin changed from case-insensitive to case-sensitive causing quite a lot of fallout, since 1password used to display all section names, always, in upper case letters, for several years and still does it on the mac client in the default views (on edit you get, since a year or so, the correct upper/lower strings) so we got a lot of those upper-case lookups in our ansible code that are now failing
I see the issue now. When I wrote the v2 code, I did not make it case insensitive like the v1 code is. This is a regression.
Ah, that's good to know! Thanks for the update!
@rembart @bitjip Could you test with #7564 to see if that resolves this issue?
Summary
I try to do a lookup to a 1Password field, but because the Onepassword v2 plugin is case sensitive it cannot find the password from the field.
See: https://github.com/ansible-collections/community.general/blob/c604cc5ba901574697b99bd31236d99e0e6cd1a3/plugins/lookup/onepassword.py#L453
Issue Type
Bug Report
Component Name
onepassword
Ansible Version
Community.general Version
Configuration
No response
OS / Environment
Mac OS 12.4 x86
Steps to Reproduce
Expected Results
I expect that the field
password
in the sectionsection name
get the password from 1Password which has the field namePassword
and the section nameSection Name
.Actual Results
The lookup returns an empty string.
Code of Conduct