MCPcopy Index your code
hub / github.com/docker/docker-agent / NewKeychainProvider

Function NewKeychainProvider

pkg/environment/keychain.go:22–28  ·  view source on GitHub ↗

NewKeychainProvider creates a new KeychainProvider instance. It verifies that the `security` command is available on the system and stores the resolved absolute path for later use.

()

Source from the content-addressed store, hash-verified

20// It verifies that the `security` command is available on the system and
21// stores the resolved absolute path for later use.
22func NewKeychainProvider() (*KeychainProvider, error) {
23 path, err := lookupBinary("security", KeychainNotAvailableError{})
24 if err != nil {
25 return nil, err
26 }
27 return &KeychainProvider{binaryPath: path}, nil
28}
29
30// Get retrieves the value of a secret by its service name from the macOS keychain.
31// It uses the `security find-generic-password -w -s <name>` command to fetch the password.

Callers 1

NewDefaultProviderFunction · 0.85

Calls 1

lookupBinaryFunction · 0.85

Tested by

no test coverage detected