Your environment
SDK Version: v1.5.3
Connect Server Version: 1.7.3
OS: Ubuntu 22.04.3 LTS
Go Version: go1.24.3 linux/amd64
What happened?
When using the struct tag opsection to load a field from a specific section in a 1Password item, the SDK appears to require the section name to be lowercase. If the actual section name in 1Password contains uppercase letters or mixed casing, the field is not populated.
After reviewing the source code, it looks like section names are lowercased before being compared, which causes a mismatch if the user provides a tag value matching the case used in 1Password.
What did you expect to happen?
I expected the SDK to use a case-insensitive match when resolving section names, or at minimum, to preserve the case as provided in the opsection tag so that values from properly cased sections in 1Password can be loaded correctly.
Steps to reproduce
- In 1Password, create an item with a custom section named
Details and a text field named hostname.
- Create the struct like the following:
type Config struct {
Host string `opsection:"Details" opfield:"hostname"`
}
- Attempt to unmarshal the item into struct using
client.LoadStructFromItem(&c, "<item uuid>", "<vault uuid>").
- Observe that the
Host field is not populated.
- Change
opsection:"Details" to opsection:"details" (lowercase).
- Observe that the field is now populated correctly.
Your environment
SDK Version: v1.5.3
Connect Server Version: 1.7.3
OS: Ubuntu 22.04.3 LTS
Go Version: go1.24.3 linux/amd64
What happened?
When using the struct tag
opsectionto load a field from a specific section in a 1Password item, the SDK appears to require the section name to be lowercase. If the actual section name in 1Password contains uppercase letters or mixed casing, the field is not populated.After reviewing the source code, it looks like section names are lowercased before being compared, which causes a mismatch if the user provides a tag value matching the case used in 1Password.
What did you expect to happen?
I expected the SDK to use a case-insensitive match when resolving section names, or at minimum, to preserve the case as provided in the
opsectiontag so that values from properly cased sections in 1Password can be loaded correctly.Steps to reproduce
Detailsand a text field namedhostname.client.LoadStructFromItem(&c, "<item uuid>", "<vault uuid>").Hostfield is not populated.opsection:"Details"toopsection:"details"(lowercase).