In internal/secret/keychainunlocker_stub.go (non-darwin build), all methods including NewKeychainUnlocker, GetType(), GetID(), etc. call panic() instead of returning errors:
funcNewKeychainUnlocker(fsafero.Fs,directorystring,metadataUnlockerMetadata)*KeychainUnlocker{panic("keychain unlockers are only supported on macOS")}
This is a crash bug on Linux/Windows. The code paths in vault/unlockers.goGetCurrentUnlocker() and findUnlockerByID() call NewKeychainUnlocker when they encounter a keychain-type unlocker in metadata:
If a vault is synced from macOS to Linux (which is a valid use case since vaults are just files), and the vault has a keychain unlocker, any operation that lists or resolves unlockers will panic and crash instead of gracefully skipping or returning an error.
Impact
Cross-platform vault portability is broken
Program crashes instead of showing a helpful error
secret unlocker list crashes on Linux if any keychain unlocker exists
Fix
Stub methods should return errors instead of panicking. NewKeychainUnlocker should return a valid struct whose methods return appropriate errors.
## Bug
In `internal/secret/keychainunlocker_stub.go` (non-darwin build), all methods including `NewKeychainUnlocker`, `GetType()`, `GetID()`, etc. call `panic()` instead of returning errors:
```go
func NewKeychainUnlocker(fs afero.Fs, directory string, metadata UnlockerMetadata) *KeychainUnlocker {
panic("keychain unlockers are only supported on macOS")
}
```
This is a **crash bug** on Linux/Windows. The code paths in `vault/unlockers.go` `GetCurrentUnlocker()` and `findUnlockerByID()` call `NewKeychainUnlocker` when they encounter a keychain-type unlocker in metadata:
```go
case "keychain":
unlocker = secret.NewKeychainUnlocker(v.fs, unlockerDir, metadata)
```
If a vault is synced from macOS to Linux (which is a valid use case since vaults are just files), and the vault has a keychain unlocker, any operation that lists or resolves unlockers will **panic and crash** instead of gracefully skipping or returning an error.
## Impact
- Cross-platform vault portability is broken
- Program crashes instead of showing a helpful error
- `secret unlocker list` crashes on Linux if any keychain unlocker exists
## Fix
Stub methods should return errors instead of panicking. `NewKeychainUnlocker` should return a valid struct whose methods return appropriate errors.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
In
internal/secret/keychainunlocker_stub.go(non-darwin build), all methods includingNewKeychainUnlocker,GetType(),GetID(), etc. callpanic()instead of returning errors:This is a crash bug on Linux/Windows. The code paths in
vault/unlockers.goGetCurrentUnlocker()andfindUnlockerByID()callNewKeychainUnlockerwhen they encounter a keychain-type unlocker in metadata:If a vault is synced from macOS to Linux (which is a valid use case since vaults are just files), and the vault has a keychain unlocker, any operation that lists or resolves unlockers will panic and crash instead of gracefully skipping or returning an error.
Impact
secret unlocker listcrashes on Linux if any keychain unlocker existsFix
Stub methods should return errors instead of panicking.
NewKeychainUnlockershould return a valid struct whose methods return appropriate errors.