Commit Graph

1206 Commits

Author SHA1 Message Date
David Lawrence d52dbde683 removing the ability to configure role names. It adds a lot of complexity without adding much value. If somebody wants custom role names they can implement it at the display level
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-07 17:38:05 -08:00
David Lawrence 160980db89 Merge pull request #428 from docker/merge-bootstrap-and-update
Combine bootstrapClient and tuf/client's Client.Update into a single Update function
2016-01-07 17:31:55 -08:00
Ying Li c1c0ccf4be Combine bootstrapClient and tuf/client's Client.Update into NotaryRepository.Update.
- it is easier to understand what's going on in the online functions of NotaryRepository
- we can test NotaryRepository.Update independently (although it'd be nice to have some way
  of ensuring that the actual public functions of NotaryRepository like ListTargets,
  GetTargetByName, and Publish actually calls Update.
- distinct error if the remote repo doesn't exist.

This also stops wrapping signed.ErrExpired in client.ErrExpired, and just passes
signed.ErrExpired on directly.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-07 16:58:46 -08:00
David Lawrence cf57eaa511 Merge pull request #419 from docker/errmeta-message
improve message for ErrMetaNotFound
2016-01-07 16:47:01 -08:00
David Lawrence 7992a7da3d Merge pull request #429 from endophage/json_logs
using JSON logging format
2016-01-07 11:53:48 -08:00
David Lawrence 13eaaf1a22 Merge pull request #426 from endophage/canonical_json
use canonical json for all marshalling of TUF data
2016-01-07 11:36:02 -08:00
Riyaz Faizullabhoy 320d565f3b Merge pull request #427 from docker/delegation-var
Move regex compilation to outside var for optimization
2016-01-07 09:50:47 -08:00
Riyaz Faizullabhoy a64ffd4ae9 Move regex compilation to outside var for optimization
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-07 09:26:04 -08:00
Ying Li aff9eb929a Merge pull request #430 from HuKeping/dockerfile
Fix the exposed port in Dockerfile
2016-01-07 09:16:43 -08:00
Ying Li e920e90b1f Merge pull request #432 from useidel/master
added /usr/lib64 to search paths
2016-01-07 09:10:44 -08:00
Udo Seidel f1067998f6 added /usr/lib64 to search paths
Signed-off-by: Udo Seidel <udoseidel@gmx.de>
2016-01-07 11:56:22 +01:00
HuKeping 9822c6d9be Fix the exposed port in Dockerfile
4443 is default used by Server and 4444 is for Signer.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-01-07 09:42:28 +08:00
David Lawrence b56372a1d8 using JSON logging format for notary server and signer for easier integration with backend metrics platforms
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-06 17:09:38 -08:00
Riyaz Faizullabhoy c826329d66 improve message for ErrMetaNotFound
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-06 11:50:43 -08:00
David Lawrence 02ec86cd1b adding testify/require dependency
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-06 11:39:55 -08:00
David Lawrence f417c834c4 switching out to consistently use canonical json for all marshalling of TUF data
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-06 11:15:27 -08:00
Ying Li cc03297c77 Merge pull request #418 from HuKeping/prompt
Fix here document
2016-01-06 11:04:21 -08:00
Ying Li f211b1826d Merge pull request #421 from justincormack/arm
Update jose2go to latest to fix #239
2016-01-06 08:39:37 -08:00
Justin Cormack 00efd4a4c9 Update jose2go to latest to fix #239
This seems to have never been applied; fixes Arm build

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2016-01-06 14:04:25 +00:00
HuKeping 39701bc858 Fix here document
It seems the prompt doesn't work here.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-01-06 14:46:06 +08:00
Diogo Mónica 30c488b3b4 Merge pull request #393 from docker/path-fix
use path instead of filepath to express TUF roles
2016-01-04 19:26:13 -08:00
Diogo Mónica 2dfd22dbef Merge pull request #401 from cyli/list-targets-lists-role
When listing targets, the role the target belongs to is also listed
2016-01-04 19:18:38 -08:00
Ying Li 61bbf7be49 Change ListTargetes and GetTargetsByName to return TargetWithRole.
This object has both the target and the role in which the target was found.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-04 17:15:44 -08:00
Riyaz Faizullabhoy 53bf7a943f Merge pull request #394 from docker/style-cleanup
fix up style according to comments
2016-01-04 16:35:41 -08:00
Riyaz Faizullabhoy 077c28b65d Use path operation for delegation role check, update RoleTargetsPath to
use path for role name URL

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-04 16:23:02 -08:00
Riyaz Faizullabhoy dbb8c1065f use path instead of filepath to express TUF roles
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-04 16:23:02 -08:00
Riyaz Faizullabhoy a1178bfc96 improved slice copying and appending
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-04 16:20:19 -08:00
Riyaz Faizullabhoy 385bd5aa11 fix up style according to comments
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-04 16:20:19 -08:00
Ying Li 2f2a0b9c9f Display the role when listing targets using the Notary CLI.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-04 15:20:06 -08:00
Ying Li ecd96c8218 Fix potential infinite loop in tuf/Client.TargetMeta
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-04 10:50:35 -08:00
Ying Li 9252d9d892 Update client.Target to include a RoleName, so we know where the target is when listed.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-04 10:49:54 -08:00
Ying Li 0014348991 Merge pull request #390 from HuKeping/injecting
Stop injecting to the helper function
2016-01-04 09:07:28 -08:00
HuKeping 74d4af37a3 Stop injecting to the helper function
GetCryptoService is a helper function and we have injected a specific
http.ResponseWriter object for it to write back error message. Meanwhile
the caller for that function checks whether the cryptoService is nil
or not and return immediately if it is nil.

I think it's not a good idea to write back HTTP response in the helper function,
it's the caller's work and thus there is no need to inject the specific
ResponseWriter object into it.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-12-30 09:42:51 +08:00
David Lawrence 0c11a97082 Merge pull request #392 from hqhq/update_panicwrap
Update github.com/bugsnag/panicwrap
2015-12-28 20:14:57 -08:00
Diogo Mónica fc4fae6b8a Merge pull request #391 from hqhq/dont_use_strings_compare
Do not use strings.Compare
2015-12-28 12:02:53 -08:00
Qiang Huang f8ef61fe82 Update github.com/bugsnag/panicwrap
With this, we can build notary on ARM64.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-26 15:28:43 +00:00
Qiang Huang a7cc3926dd Do not use strings.Compare
According to https://golang.org/src/strings/compare.go?s=491:520#L3
It's suggested to use the built-in string comparison operators.

And also, seems like this function does not exist in some arch
such as arm64. So we better not use it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-26 13:50:52 +00:00
Ying Li 6028de0dd1 Merge pull request #387 from docker/backwards-compatibility
Tests for backwards-compatibility reading/writing/exporting/importing old repo format
2015-12-23 12:15:03 -08:00
Ying Li 785b2527b1 Test import/export of old repo format.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-23 11:47:37 -08:00
Diogo Mónica ffca6fb522 Merge pull request #388 from docker/cleanup
Rebased cleanup/remove PEM headers
2015-12-23 11:36:25 -08:00
Diogo Mónica e87d2aa196 Merge pull request #386 from docker/errors-fix
fixes errors in notary for testing
2015-12-23 11:32:50 -08:00
Ying Li 0465365fb6 Return an error if unable to encrypt a key as a valid PEM file
Also address review comments and fix semantic conflict after rebase.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-23 09:44:51 -08:00
David Lawrence fa788cb2a9 make x509 certs viable as delegated public key object
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence 2bf5d4b09a test for legacy keys and some bugfixes for same
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence e516dd88f2 cleaning up tests by converting t.Fatal to assert.___
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence f2ec72b5b6 aliases removed from file names
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence 6d5b8ff54a add role into PEM headers
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence 1f329868e8 making filestores consistent so you can Get, Remove, etc... the paths returned by ListFiles
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
David Lawrence 8f7fddd5d5 breaking up low level storage into logical files
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-23 09:41:03 -08:00
Ying Li 9573252ace Add backwards-compatbility test for client reading-writing 0.1-style repos.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-22 18:01:36 -08:00