Commit Graph

1566 Commits

Author SHA1 Message Date
Miloslav Trmač
4898d252ee Don't silently ignore swizzler errors
These calls can fail, and errors would cause false failures later in the
tests.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-03-16 18:33:48 +01:00
Riyaz Faizullabhoy
75883b3d4c Merge pull request #630 from HuKeping/replace
Package replace
2016-03-16 09:54:45 -07:00
HuKeping
9cc5a7d9ea Package replace
Replace the use of the "assert" package with the "require" package.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-16 16:21:35 +08:00
Riyaz Faizullabhoy
d5671984cf Merge pull request #571 from docker/cli-server-rotate
Change the CLI to be able to rotate server managed keys
2016-03-15 18:50:37 -07:00
Ying Li
44cccbb4db Make all key rotations publish immediately, not just remote key rotations
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:35:30 -07:00
Ying Li
baaa703249 Update advanced usage documentation
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:19:13 -07:00
Ying Li
fa5edc40af Publish only the key rotation changes after a remote key rotation
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:17:27 -07:00
Ying Li
4e5e2f386a Clean up yubikeys between each cmd/notary/keys_test.go test
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:17:27 -07:00
Ying Li
b6c4840231 Update comments, and publish in the CLI after remote key rotation
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:17:27 -07:00
Ying Li
e3716f0be9 Change the CLI for rotate key to require a role type
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:17:27 -07:00
Ying Li
07b9f504e4 Update the CLI and client to no longer reject remote timestamp rotations.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 18:17:27 -07:00
David Lawrence
33eeb49c25 Merge pull request #626 from docker/use-requires
Use 'require' instead of 'assert' in client and TUF client tests
2016-03-15 17:44:22 -07:00
Ying Li
4022e97b08 Use 'require' instead of 'assert' in client and TUF client tests
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-15 13:52:48 -07:00
David Lawrence
c74fab9401 Merge pull request #601 from docker/cache-headers
Return cache control headers when returning metadata from server
2016-03-14 17:56:59 -07:00
David Lawrence
751f6b5a26 Merge pull request #622 from docker/snapshot-docs
Include note about docker1.11 default snapshot key behavior
2016-03-14 17:39:54 -07:00
Ying Li
e25746dac3 Use a CacheControlHandler that wraps other handlers instead
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:19:13 -07:00
Ying Li
84f5ed28d2 Move the configuration parsing for notary-server to its own file
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
Ying Li
e1397f4b03 Use updated-at for last modification date for getting current metadata
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
Ying Li
329b47d253 Parse for cache control options in the server config file
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
Ying Li
9b022a9cda Modify server handler to set cache headers based upon a cache configuration object
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
Ying Li
802673fc9d Add cache control headers to Getting metadata
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
Ying Li
8768c12901 Return the creation date for GetChecksum and GetCurrent from the server database store.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-14 17:18:18 -07:00
David Lawrence
cd0b43a6b8 Merge pull request #617 from docker/no-keys-canonical-id
Message canonical key ids on error
2016-03-14 15:18:46 -07:00
Riyaz Faizullabhoy
b5b3d7c7c8 Include note about docker1.11 default snapshot key behavior
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-14 11:44:23 -07:00
David Lawrence
ca90842799 Merge pull request #593 from HuKeping/add-sha512
Add SHA-512
2016-03-11 14:13:14 -08:00
Riyaz Faizullabhoy
571df4ba86 Merge pull request #618 from HuKeping/tiny
Tiny refactor
2016-03-11 11:28:27 -08:00
HuKeping
2136ca54ba [MISC 4/4] distinguish nil and empty map
Since the function len(X) will return 0 no matter X is nil or
an empty map.

We should distinguish that.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 17:24:47 +08:00
HuKeping
9501cddc1d [MISC 3/4] Refactor: move test helper function to test package
The helper function "GetSupportedHashes" is only used in tests,
it's better to move it to the relevant test file.

Since it's for the test, remove the origin test code for it.

And it also a good idea to call "NewfileMeta" instead of implement
once again.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 17:24:43 +08:00
HuKeping
30c9cfc113 [MISC 2/4] Constant: use constant instead of some literal string
Replace the "sha256" by the constant defined in the notary-const file.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 16:44:14 +08:00
HuKeping
6cd6b4726c [MISC 1/4] Tiny refactor
Reduce function "snapshotExpired" in a simpler form and replace the
literal string by the constants defined in the data package.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 16:43:44 +08:00
HuKeping
7e1a9947de Tiny refactor
If we can use a simple name for the local variable.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 14:11:27 +08:00
HuKeping
2f61b0a445 [PATCH 8/8] Add some test
For the added functions of this patch set.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:45:05 +08:00
HuKeping
4d9e2e5e16 [PATCH 7/8] Update the server side
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:45:01 +08:00
HuKeping
bf97855897 [PATCH 6/8] Add sha512 check when downloading TUF roles
Since the timestamp role need not the hash checking during the downloading,
thi patch only includes:
- snapshot.json
- root.json
- target.json

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:56 +08:00
HuKeping
95ed108c12 [PATCH 5/8] Add sha512 check on CLI command
Include:
- verify

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:49 +08:00
HuKeping
206d02ab4d [PATCH 4/8] Add sha512 when updating
Actually there are two way to implement this.

One is check the present hash algorithm first and then only update
what we have.

The other is update/add both sha256 and sha512 no matter whether we
have the hash of sha512 or not.

Personally I prefer the latter, for it brings much less change of the
code and will also not affect the validate of the old clients.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:46 +08:00
HuKeping
6b96c7e56d [PATCH 3/8] Add sha512 when creating target, snapshot and timestamp
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:42 +08:00
HuKeping
30790aaa68 [PATCH 2/8] Add some helper functions
Include:
- A helper function to verify checksums generate by different hash algorithms.
- A helper function to generate checksums of all the supported hash algorithms.
- A helper fucntion to do a sanity check for every checksum.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:39 +08:00
HuKeping
7344f4e3da [PATCH 1/8] Create constants for sha256 and sha512
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-03-11 10:44:33 +08:00
Riyaz Faizullabhoy
06ba32ea47 Message canonical key ids on error
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-09 21:30:46 -08:00
David Lawrence
00cadc9734 Merge pull request #614 from docker/bump-dependencies
Bump go-connections and canonical go dependencies to the latest version
2016-03-09 18:03:47 -08:00
Ying Li
be91b3342c Fix Makefile to exclude the vendor directory from linting/vetting
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-08 14:54:29 -08:00
Ying Li
00c667a5b1 Update dockerfiles to be go 1.6 and to no longer set the GOPATH
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-08 11:38:39 -08:00
Ying Li
51dc1747e4 Move the godeps workspace to the vendor directory to be compliant with Go 1.6
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-08 11:28:04 -08:00
Ying Li
dc377b3ceb Bump go-connections and canonical go dependencies to the latest version
Logging bugfix for github.com/docker/go-connections
github.com/docker/go rebased to go 1.6

Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-08 11:16:59 -08:00
Riyaz Faizullabhoy
40a24c3793 Merge pull request #613 from docker/fix-mispell
Fix mispelling of 'occur'
2016-03-07 17:37:12 -08:00
Ying Li
d45b9f86ef Fix mispelling of 'occur'
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-07 17:22:41 -08:00
David Lawrence
d0256e2244 Merge pull request #610 from docker/finish-client-update-tests
Add test to check that if a key is rotated...
2016-03-07 17:04:21 -08:00
Ying Li
1bfafa0b77 Add test to check that if a key is rotated, but the requisite piece of
metadata hasn't been resigned, that an update fails because the
cached version is no longer valid.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-03 09:22:26 -08:00
David Lawrence
dfeb51f54f Merge pull request #606 from docker/doc-fixes
Documentation fixes
2016-03-02 17:10:46 -08:00