Commit Graph

1045 Commits

Author SHA1 Message Date
Ying Li d02f6f2686 Merge pull request #334 from docker/client-test-refactor
Refactor the client TestInitRepo test into reusable helper functions.
2015-12-07 12:52:04 -08:00
Ying Li 8417f6670b KeyDBStore refactor so that it just directly takes the DB arguments.
Rather than create an SQL DB, then create a gorm BD using the SQL
DB.  Also split the Create/Get test into two tests.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-04 10:05:31 -08:00
Ying Li 52aa55076b Merge pull request #333 from jfrazelle/update-maintainers
update maintainers file for parsing
2015-12-04 09:24:35 -08:00
Ying Li e3cee0cdbd Refactor the client TestInitRepo test into reusable helper functions.
Also, eliminate the timestamp JSON constant and just generate a new
one for the tests.

The client test now also uses KeyFileStore and certs.Manager to
verify the keys and certs on disk, rather than directly manipulating
the files themselves.  This way, if the exact implementation of
KeyFileStore or certs.Manager changes, this test won't fail so long
as KeyFileStore and certs.Manager are self-consistent.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-03 17:52:22 -08:00
David Lawrence 414aeb4c42 Merge pull request #329 from endophage/generalize_server_keys
Generalize server keys
2015-12-03 14:22:09 -08:00
Jessica Frazelle 132122a454
update maintainers file for parsing
update standard for dockerfiles so we can clean up dockers and parse
into one repo

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-03 14:01:40 -08:00
David Lawrence 064e37560e adding tests for role based key support on server
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 13:58:25 -08:00
David Lawrence c0a84c2508 update notarymysql/migrate.go to add role to timestamp_keys and update indexes
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:48:18 -08:00
David Lawrence 2dc2fe6738 set initial role value for existing records in timestamp_keys table
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:25:45 -08:00
David Lawrence e20773f2b1 renaming TimestampKey and ErrTimestampKeyExists to just Key and ErrKeyExists
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:25:45 -08:00
David Lawrence 76caa3d76a adding migrations for new timestamp_keys role column including key changes
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:25:45 -08:00
David Lawrence c2c474b9c6 generalize notary server key storage to be able to handle any role, not just timestamps
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:25:45 -08:00
David Lawrence 9b4f7ca599 Merge pull request #323 from endophage/mysql_parsetime
when using a mysql database, need to set parseTime=True in connection…
2015-12-03 11:05:27 -08:00
David Lawrence 77d72ba81c when using a mysql database, need to set parseTime=True in connection string query params
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 10:39:13 -08:00
David Lawrence 60fe3c48f6 Merge pull request #319 from endophage/migrations
initial database migration state
2015-12-02 16:22:11 -08:00
David Lawrence 44fe5bcaa4 initial database migration state
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-02 16:09:41 -08:00
David Lawrence 7c5563b7b2 Merge pull request #327 from endophage/unify_tuf_http_get
unify the timestamp handler with the handler for getting other tuf metadata
2015-12-02 16:04:52 -08:00
David Lawrence a1ec8c69e0 unify the timestamp handler with the handler for getting other tuf metadata
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-02 15:50:54 -08:00
Ying Li 5593112f85 Merge pull request #318 from docker/post-to-codecov
Re-enable pushing coverage reports to codecov.io
2015-12-02 15:45:51 -08:00
Ying Li 9c8e084e0d Run coverage merge and reporting on all parallel containers.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-02 15:30:22 -08:00
Ying Li 555a46d8f8 Re-enable pushing coverage reports to codecov.io
Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-02 15:30:22 -08:00
Ying Li cb2b2951e0 Merge pull request #325 from mbentley/db-exist-check
Added check to skip db import if exists
2015-12-02 15:27:46 -08:00
Matt Bentley 3b02384a0a
Added check to skip db import if exists
Signed-off-by: Matt Bentley <matt@docker.com>
2015-12-02 17:05:24 -05:00
Ying Li d131a7a7fd Merge pull request #320 from HuKeping/tiny
Tiny refactor
2015-12-02 09:58:49 -08:00
HuKeping 9ad415e0b5 Tiny refactor
It's no need to keep the `err` after asserting it should be `nil`, and
we can merge these two logs into one I suppose.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-12-02 19:22:56 +08:00
David Lawrence 8292d1866d Merge pull request #299 from docker/server-parsing-trust
Fixed bug parsing trust service info in notary server.
2015-11-30 19:31:13 -08:00
Ying Li 870fe0fd01 Define injected function types for notary-server/main.getTrustService
Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:24:28 -08:00
Ying Li 1dd04d4e5d trust_service is now a required section of the notary-server config.
The type must either be "local" or "remote".  Previously, any invalid
configuration would default to a local signing service, but since
a remote signing service is recommended, the user has to specifically
configure a local signing service.  We don't want it to be the
fallback.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:23:53 -08:00
Ying Li d62ac788a3 Fixed bug parsing trust service info in notary server.
Previously, if it wasn't a remote service, the config parser was
still setting the key algorithm to be whatever was configured.
Now, if we are using a local trust service, the algorithm is always
ED25519.

Also broke the trust parsing into its own function for testing.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:22:33 -08:00
David Lawrence 5500c81cd9 Merge pull request #304 from docker/server-signer-config
Make the server/signer configurations more similar
2015-11-30 17:06:13 -08:00
David Lawrence a8b376ec0f Merge pull request #294 from endophage/remove_cryptoservice_sign
CryptoService.Sign is now dead code. Remove it and update tests
2015-11-30 17:04:39 -08:00
David Lawrence ae7459b5f2 updating commend and renaming test per comments
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-30 16:53:08 -08:00
David Lawrence 909260ff03 Merge pull request #308 from docker/pretty-print-certs
Pretty-print certificates from the notary CLI command `notary cert list`
2015-11-30 16:52:15 -08:00
Ying Li 7153dc7463 Fix bug with keystore not getting assigned in the signer in the DB case.
Thanks @endophage!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 16:41:07 -08:00
David Lawrence 1e091a0f56 CryptoService.Sign is now dead code. Remove it and update tests
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-30 16:36:34 -08:00
Ying Li 35b104beee Move all the pretty-print functions to their own file in cmd/notary.
Also add tests for pretty-printing and sorting targets.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 16:35:53 -08:00
Ying Li 1670b69a18 Pretty-print certificates from the notary CLI command `notary cert list`
Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 16:35:53 -08:00
David Lawrence 7c5382b256 Merge pull request #300 from docker/server-validate-timestamp-key
Server check that the root.json's timestamp key ID is valid.
2015-11-30 15:34:18 -08:00
Ying Li 3ce5d2527c Merge pull request #315 from SvenDowideit/move-to-docs-base-latest
Use FROM docs/base:latest again
2015-11-30 15:24:17 -08:00
Ying Li 56e8d864ce Add some standalone (does not require MySQL) configuration files for
server and signer, and set these to be the default configuration
files when running the images.

Compose specifies the configuration with MySQL.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 14:14:16 -08:00
Ying Li a94a47651f Adds specific memory backend support to server and signer.
The server already supported a memory backend, but now it must be
specified, rather than just being a fallback if no storage is
specified.  This also adds a signer backend to signer, which
previously required a MySQL backend.

Thanks @endophage for the excellent suggestion!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li f1bd28caf4 The TLS certificates are now relative to the config file used.
Previously, if a relative path was provided, it was relative to the
current working directory to wherever the binaries were run.  Now
it is relative to whatever config file was used.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li c43776d36f Use shared configuration parsing tools in notary-server.
This changes the 'addr' parameter of notary-server's config to
'http_addr', so we can add a GRPC server to notary-server if
necessary.  This also allows environment variables to override
the notary-server config file entries, as notary-signer already
does.

The bugsnag configuration has also been changed so that the
bugsnag parameters are under the "bugsnag" key.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li 9e5ac006ec Use the shared configuration parsing code in notary-signer's parsing.
Also add bugsnag support to notary-signer.

This also changes the 'server.cert_file' and 'server.key_file'
parameters to 'server.tls_cert_file' and 'server.tls_key_file',
respectively, to match notary-server.

Previously, the default alias, which was under the environment
variable NOTARY_SERVER_DEFAULT_ALIAS is now also available in
the config file in storage.default_alias.  The password has
not changed.

Finally, this removes some of the HSM references in notary-signer.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li b25f8546f8 Ensure that environment variables can override config file entries.
Also support parameterized allowed backends when parsing for
storage backends, so that a DB backend can be tested.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li b1fdea5b56 Add shared config file parsing to the utils package.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
David Lawrence c4636411bc Merge pull request #309 from docker/rename-keystoremanager
Renamed keystoremanager to certs, and KeyStoreManager to Manager.
2015-11-30 10:56:13 -08:00
David Lawrence 69dae91788 Merge pull request #314 from docker/mysql-user
Just connect to mysql as root, rather than as dockerdemo user.
2015-11-30 10:55:54 -08:00
Sven Dowideit e8dc2097a1 Use FROM docs/base:latest again
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-11-26 20:14:11 +10:00
Ying Li 9c3d87d5eb When validating root.json on the server, timestamp threshold must be 1.
This is because the server handles the timestamp key and timestamp signing.
So there can only ever be 1 key.  Thanks @mtrmac for pointing this out.

This change also refactors some of the test code somewhat.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-24 17:47:00 -05:00