1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-13 16:01:28 +05:30
Commit Graph

49 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 7d66ae02a6 osxkeychain: use designated domains in tests (RFC2606)
Update domains used in tests to used domains that are designated for this
purpose as described in [RFC2606, section 3][1]

[1]: https://www.rfc-editor.org/rfc/rfc2606.html#section-3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-26 13:59:01 +02:00
CrazyMax 9f5511c8d5 osxkeychain: use go build constraint
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-29 12:02:48 +02:00
CrazyMax 5944f8a485 osxkeychain: match min macos version for xx
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-28 15:55:56 +02:00
Sebastiaan van Stijn 5c5b09e7f8 osxkeychain: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 17:14:12 +02:00
Sebastiaan van Stijn 8282d3336a osxkeychain: use t.Cleanup(), and don't ignore errors
Make sure we don't drop errors when cleaning up state before/after
tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 17:14:12 +02:00
Sebastiaan van Stijn a7ff1c7d16 osxkeychain: don't use un-keyed literals in test-tables
Also moving the comments into the test-tables.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 17:14:12 +02:00
Sebastiaan van Stijn 810dcd4ed5 use "tc" for test-cases
Mostly for my own sanity; just about every repository we have
started to converge to using "tc" as variable name for this, so
updating this repository as well to help reduce cognitive load.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 17:14:09 +02:00
Sebastiaan van Stijn b21b69c8ee osxkeychain: Delete(): return typed errors
This allows a Delete for non-existing credentials to be handled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 16:54:37 +02:00
Sebastiaan van Stijn 7f00c5c8bd osxkeychain: use a switch for handling errors
Makes the error-handling slightly cleaner.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 16:54:37 +02:00
Sebastiaan van Stijn 1ed95cb020 osxkeychain: explicitly ignore error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 16:54:32 +02:00
Sebastiaan van Stijn 9817a23b17 format code with gofumpt
Doing a one-pass of formatting the code with gofumpt, which provides a
superset of gofmt.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-27 13:01:49 +02:00
Sebastiaan van Stijn 70f476531f registryurl: deprecate GetHostname(), GetPort()
These were just wrappers for url.Hostname() and url.Port()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-20 20:25:03 +02:00
Tonis Tiigi f4b8a8531e osxkeychain: improve error message for non-interactive sessions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-01-07 11:38:06 -08:00
Justin Cormack 87c80bfba5 Fix a double free in the List functions
The code was set up so that it would free the individual items and the data
in `freeListData`, but there was already a Go `defer` to free the data item,
resulting in a double free.

Remove the `free` in `freeListData` and leave the original one.

In addition, move the `defer` for freeing the list data before the error
check, so that the data is also free in the error case. This just removes
a minor leak.

This vulnerability was discovered by:
Jasiel Spelman of Trend Micro Zero Day Initiative and Trend Micro Team Nebula

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2019-07-01 14:41:30 +01:00
Vincent Demeester 152d64310b Merge pull request #139 from ekcasey/server-alias-wincred
make docker-credential-wincred work like docker-credential-osxkeychain
2019-04-30 09:10:39 +02:00
Emily Casey a3c1b5b757 Fix imports
Signed-off-by: Emily Casey <ecasey@pivotal.io>
2019-04-29 10:04:46 -04:00
Emily Casey 6f4b0a7c06 make docker-credential-wincred work like docker-credential-osxkeychain
* fetch credentials for server with matching hostname if scheme, path, or port are not provided
* if the credential request includes specific scheme, path, or port that does not match entry, don't return
* extract url helpers into a package

Signed-off-by: Emily Casey <ecasey@pivotal.io>
Signed-off-by: Danny Joyce <djoyce@pivotal.io>
2019-04-29 09:26:13 -04:00
pgayvallet 1546024a83 returns empty map instead of error if credentials not found in keychain
Signed-off-by: pgayvallet <pierre.gayvallet@gmail.com>
2019-04-26 18:34:58 +02:00
Ulrich VACHON df92c83808 Update Go version to 1.12.x, update XCode version to 10.1, update MacOS minimum supported version to 10.11.
Signed-off-by: Ulrich VACHON <ulrich.vachon@docker.com>
2019-04-26 12:00:35 +02:00
Sebastiaan van Stijn e1d4c012bc Fix storing URLs without scheme (#72)
* Fix storing URLs without scheme

If secrets are stored without specifying a scheme
(https://), the keychain-helper would interpret the
hostname as _path_, causing lookup of secrets to fail.

This patch makes sure that a scheme is added (if missing).

If no scheme is specified, https:// is used as a default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

* Have pre go1.8 compiler able to compile

Signed-off-by: Tibor Vass <teabee89@gmail.com>

* Fix URL parsing with port and no scheme

Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>

* Improve parseURL comment

Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-06-15 10:58:17 +02:00
Nassim 'Nass' Eddequiouaq 2a8670e0da Cleanup original modifications to the exposed APIs
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:14:04 +01:00
Nassim 'Nass' Eddequiouaq c5fbd3a5ad Fix type conversion for labels added to search queries on macOS
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:12:53 +01:00
Nassim 'Nass' Eddequiouaq c6cf8aa13b Add Label to Credentials in test files
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:12:32 +01:00
Nassim 'Nass' Eddequiouaq 406812bf8e Add a Docker Credentials label support for macOS
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:11:13 +01:00
Emmanuel Briney 19ec1c3164 reconstruct the full url when doing keychain_list
Signed-off-by: Emmanuel Briney <emmanuel.briney@docker.com>
2017-03-03 17:16:00 +01:00
Emmanuel Briney 94963d0da8 osxkeychain: add cgo flags to support older version of OSX
Signed-off-by: Emmanuel Briney <emmanuel.briney@docker.com>
2017-02-21 10:41:54 +01:00
ebriney eecc09c974 mac: delete credentials before adding them to avoid already exist error (fixes #37)
Signed-off-by: ebriney <emmanuel.briney@docker.com>
2017-02-14 22:50:44 +01:00
Jake Sanders c45d9e9e28 Implement client.List, change list API
[]string, []string -> map[string]string because the other APIs assume a
1:1 correspondence

Signed-off-by: Jake Sanders <jsand@google.com>
2016-09-02 15:15:12 -07:00
avaid96 f1498a0524 go fmt is all osx files and general files
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-16 12:19:47 -07:00
avaid96 b63a32e7a2 fixed another bug in the test for osx
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-15 17:46:46 -07:00
avaid96 173fe2dbc2 fixed a bug in the test for osx
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-15 17:43:52 -07:00
avaid96 b3ebaa455d trying to the OSX test to pass on Travis, it passes locally
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-15 17:32:47 -07:00
avaid96 029e094488 removed a semicolon and the placeholder for the error which we used to locate it. Seems like SecItemCopyMatching is giving an error for some reason- no error on local machine
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-13 14:36:14 -07:00
avaid96 887a66459a I think OSX tests were failing because it was a list against an empty keychain, checking whether that is the case by filling it first
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-12 10:52:06 -07:00
avaid96 9557dc3c3f fixing a vet issue
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-12 00:04:34 -07:00
avaid96 205e3b3056 cleaned up some of the osx code, added a better test for list
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-11 23:34:20 -07:00
Avi Vaid 7566a1e399 implemented freeing memory in secretservice and made minor edits to osxkeychain
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-11 19:45:37 -04:00
Avi Vaid 72661b3103 Implemented list functionality for secretservice- linux
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-11 19:33:35 -04:00
avaid96 5a8fb214ed Full implementation for OSX ready
Signed-off-by: avaid96 <avaid1996@gmail.com>
2016-07-11 10:50:44 -07:00
David Calavera c4fc9c07dd Add client functions to allow integrations within other CLIs.
This is a simplification of how the docker engine implements
this feature, but it will be ported there once this is merged.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-05-30 12:32:26 -07:00
David Calavera df8c7a02f1 Publish helper structs and methods.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-24 15:08:17 -07:00
David Calavera 2275377a31 Move away from password as a name. We store secrets.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-09 16:16:01 -05:00
David Calavera 0c4810e01f Cleanup imports and vendor dependencies.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-22 19:06:32 -05:00
David Calavera dd7a71bb12 Fix Fatal directive formatting.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-09 15:59:30 -08:00
David Calavera 4b716da070 Make sure missing credentials returns the right error.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-09 15:52:53 -08:00
David Calavera a701e3c310 Remove extra package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-09 13:03:40 -08:00
David Calavera f4a0e81b0b Implement credential programs reading from Stdin.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-09 10:53:34 -08:00
David Calavera 7033e1459e Fix go lint issues.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-08 09:18:57 -08:00
David Calavera b7ffbdb74f 🌅 complete OS X keychain implementation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-07 18:20:36 -08:00