Commit Graph

1549 Commits

Author SHA1 Message Date
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
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
Riyaz Faizullabhoy
638d2f09c8 Replace repository with collection terminology where appropriate
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-01 15:45:02 -08:00
Riyaz Faizullabhoy
101b80cf19 formatting fixes
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-01 15:45:02 -08:00
Ying Li
4a0837b8ab Addressing more review comments from client docs
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-01 15:45:02 -08:00
Ying Li
9e6ead4f57 Remove extra tables, add links in full server/signer/client configuration files to the relevant sections
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-01 15:45:02 -08:00
Riyaz Faizullabhoy
2e331971de fix up docs from review
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-01 15:45:02 -08:00
David Lawrence
d7c93d7797 Merge pull request #607 from docker/move-sqlite-to-tests
Move all imports of sqlite3 to tests only
2016-03-01 13:26:22 -08:00
Ying Li
c720c56a70 Move all imports of sqlite3 to tests only
Signed-off-by: Ying Li <ying.li@docker.com>
2016-03-01 14:56:53 -05:00
David Lawrence
82079618b1 Merge pull request #603 from moxiegirl/carry-293
Rewritten Docs. Followup PR to be submitted to fix minor things caught here.
2016-02-29 17:00:29 -08:00
Diogo Monica
79c692a7c6 Cary and close #293
Signed-off-by: Mary Anthony <mary@docker.com>
2016-02-29 12:58:55 -08:00
Riyaz Faizullabhoy
d59c97a1f0 Merge pull request #594 from HuKeping/fix-bug
Bugfix: the actions should not always be pull and push
2016-02-29 11:52:16 -08:00
Riyaz Faizullabhoy
17a5689f0f Merge pull request #584 from docker/0.2-changelog
notary 0.2 changelog
2016-02-29 11:30:34 -08:00
Ying Li
2d8ff5fb36 Merge pull request #602 from HuKeping/cleanup
Kind of cleanup
2016-02-29 13:11:26 -05:00
HuKeping
8455f9fb5a Kind of cleanup
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-02-29 19:27:56 +08:00
HuKeping
08c0da745f Drop the actions
All the other code would not have to know about the exact auth mechanism.

Use "readOnly", we can just include "pull" when readonly is true,
and "push", "pull" when readonly is false.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-02-27 10:26:23 +08:00
Riyaz Faizullabhoy
1a668bb34d add links to release tags, merge copy
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-02-26 13:03:47 -08:00
HuKeping
af5ee13d8a Bugfix: the actions should not always be pull and push
The similiar fix in docker daemon:
- https://github.com/docker/docker/pull/20382

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-02-26 10:25:50 +08:00
Riyaz Faizullabhoy
c1c2ca1d6d Merge pull request #595 from HuKeping/cleanup
Cleanup: remove the unused function
2016-02-25 11:14:02 -08:00