@@ -18,7 +18,7 @@ type OnePasswordSDKProvider struct {
1818 accountName string
1919 enabled bool
2020 vaults []VaultInfo // Stores vault ID and title (title may be [Encrypted] until auth)
21- vaultNameMap map [string ]string // Maps vault IDs to friendly names from config
21+ vaultNameMap map [string ]string // Fallback mapping for encrypted vault names (SDK v0.4.1+ decrypts automatically)
2222 cliProvider * OnePasswordProvider // Fallback to CLI if SDK not available
2323}
2424
@@ -498,33 +498,36 @@ func (p *OnePasswordSDKProvider) ListVaults() ([]string, error) {
498498}
499499
500500// GetVaults returns vault information (ID and title)
501- // Note: Titles may be [Encrypted] until biometric authentication occurs
502- // If vault name mappings are configured, they will be used instead of encrypted titles
501+ // With SDK v0.4.1-beta.1+: Vault names are decrypted after biometric authentication
502+ // Manual vault name mappings are used only as fallback for encrypted names
503503func (p * OnePasswordSDKProvider ) GetVaults () []VaultInfo {
504504 if ! p .enabled {
505505 return []VaultInfo {}
506506 }
507507
508- // If we have vault name mappings, use them to provide friendly names
509- if len (p .vaultNameMap ) > 0 {
510- vaults := make ([]VaultInfo , 0 , len (p .vaults ))
511- for _ , v := range p .vaults {
512- title := v .Title
508+ // Prefer SDK-provided decrypted names, use manual mapping only for encrypted names
509+ vaults := make ([]VaultInfo , 0 , len (p .vaults ))
510+ for _ , v := range p .vaults {
511+ title := v .Title
512+
513+ // If vault name is still encrypted, try to use manual mapping
514+ if title == "[Encrypted]" && len (p .vaultNameMap ) > 0 {
513515 if friendlyName , ok := p .vaultNameMap [v .ID ]; ok {
514516 title = friendlyName
515517 }
516- vaults = append (vaults , VaultInfo {
517- ID : v .ID ,
518- Title : title ,
519- })
520518 }
521- return vaults
522- }
523519
524- return p .vaults
520+ vaults = append (vaults , VaultInfo {
521+ ID : v .ID ,
522+ Title : title ,
523+ })
524+ }
525+ return vaults
525526}
526527
527528// SetVaultNameMap sets the vault ID to friendly name mapping from config
529+ // Note: With SDK v0.4.1-beta.1+, manual mapping is only needed as fallback for encrypted names
530+ // The SDK now provides decrypted vault names after biometric authentication
528531func (p * OnePasswordSDKProvider ) SetVaultNameMap (nameMap map [string ]string ) {
529532 p .vaultNameMap = nameMap
530533}
0 commit comments