Use the Windows Credentials Manager when the helper
is installed in the path.
Signed-off-by: David Calavera <david.calavera@gmail.com>
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,22 @@ |
| 0 |
+package credentials |
|
| 1 |
+ |
|
| 2 |
+import ( |
|
| 3 |
+ "os/exec" |
|
| 4 |
+ |
|
| 5 |
+ "github.com/docker/docker/cliconfig" |
|
| 6 |
+) |
|
| 7 |
+ |
|
| 8 |
+// DetectDefaultStore sets the default credentials store |
|
| 9 |
+// if the host includes the default store helper program. |
|
| 10 |
+func DetectDefaultStore(c *cliconfig.ConfigFile) {
|
|
| 11 |
+ if c.CredentialsStore != "" {
|
|
| 12 |
+ // user defined |
|
| 13 |
+ return |
|
| 14 |
+ } |
|
| 15 |
+ |
|
| 16 |
+ if defaultCredentialsStore != "" {
|
|
| 17 |
+ if _, err := exec.LookPath(remoteCredentialsPrefix + defaultCredentialsStore); err == nil {
|
|
| 18 |
+ c.CredentialsStore = defaultCredentialsStore |
|
| 19 |
+ } |
|
| 20 |
+ } |
|
| 21 |
+} |
| ... | ... |
@@ -1,22 +1,3 @@ |
| 1 | 1 |
package credentials |
| 2 | 2 |
|
| 3 |
-import ( |
|
| 4 |
- "os/exec" |
|
| 5 |
- |
|
| 6 |
- "github.com/docker/docker/cliconfig" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 | 3 |
const defaultCredentialsStore = "osxkeychain" |
| 10 |
- |
|
| 11 |
-// DetectDefaultStore sets the default credentials store |
|
| 12 |
-// if the host includes the default store helper program. |
|
| 13 |
-func DetectDefaultStore(c *cliconfig.ConfigFile) {
|
|
| 14 |
- if c.CredentialsStore != "" {
|
|
| 15 |
- // user defined |
|
| 16 |
- return |
|
| 17 |
- } |
|
| 18 |
- |
|
| 19 |
- if _, err := exec.LookPath(remoteCredentialsPrefix + c.CredentialsStore); err == nil {
|
|
| 20 |
- c.CredentialsStore = defaultCredentialsStore |
|
| 21 |
- } |
|
| 22 |
-} |
| 0 | 5 |
deleted file mode 100644 |
| ... | ... |
@@ -1,11 +0,0 @@ |
| 1 |
-// +build !darwin |
|
| 2 |
- |
|
| 3 |
-package credentials |
|
| 4 |
- |
|
| 5 |
-import "github.com/docker/docker/cliconfig" |
|
| 6 |
- |
|
| 7 |
-// DetectDefaultStore sets the default credentials store |
|
| 8 |
-// if the host includes the default store helper program. |
|
| 9 |
-// This operation is only supported in Darwin. |
|
| 10 |
-func DetectDefaultStore(c *cliconfig.ConfigFile) {
|
|
| 11 |
-} |