Commit Graph

36 Commits

Author SHA1 Message Date
Aaron Lehmann a833f055e2 Change logging to use contexts effectively
Use the github.com/docker/distribution/context package to get a logger
that adds a unique ID and useful information about each HTTP request.

Use this logger in HTTP handlers instead of using logrus or the log
package directly.

Remove [Notary Server] and [Notary Signer] prefixes from log messages.

The distribution/context package was already vendored, so there are no
Godeps changes necessary.

Sample output:

    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="retrieving timestamp key for docker.com/docker"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated ECDSA key with keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated new ecdsa key for role:  and keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=info msg="CreateKey: Created KeyID ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Creating new timestamp key for docker.com/docker. With algo: ecdsa"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Inserting timestamp key for docker.com/docker"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="200 GET timestamp key" docker.com/docker=gun http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=info msg="response completed" http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http" http.response.duration=29.703624ms http.response.status=200 http.response.written=181

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 16:06:56 -07:00
David Lawrence efda5034d9 can't be so restrictive on notary's GUN matching in URLs
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-31 14:38:24 -07:00
David Lawrence e7fa1951ab hard fail if TLS is only partially configured
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-31 10:49:42 -07:00
David Lawrence f7ca3ef62e make key algorithm configurable for local development with in memory ed25519 crypto service
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-30 11:53:39 -07:00
Aaron Lehmann 02dfdaf197 Use correct regular expression for repository names in HTTP handlers
Import github.com/docker/distribution/registry/api/v2 to share the
regexps that the registry API uses.

Remove ErrUnauthorized in errors package, since it conflicts with one
defined in v2.

Fixes #92

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-27 14:51:59 -07:00
David Lawrence b44e835275 update default expiry times to those agreed on
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-20 14:59:19 -07:00
Diogo Monica 3b261e8972 Removing comments
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-20 10:08:15 -07:00
David Lawrence b561f347ed updating errors to use distribution's errcode package
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-17 18:02:56 -07:00
David Lawrence c39a218a40 Merge pull request #51 from dmcgowan/add-ping-endpoint
Add ping endpoint
2015-07-17 17:55:22 -07:00
Aaron Lehmann afc331b930 Add a unit test for publish
This instantiates a temporary server, publishes some targets to it, and
makes sure we can pull back the correct targets from the server.

Also fixes a few problems with the client unit tests, error reporting in
the client, and logging in the server.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-17 16:27:31 -07:00
Derek McGowan 93dc0285bc Add ping endpoint
Ping endpoint added so clients can get the list of authentication challenges before making an initial request.
Updated MainHandler to return JSON object instead of a string.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-14 14:08:12 -07:00
David Lawrence ec08d28610 provide an additional handler to allow clients to update any set of TUF metadata atomically
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-13 18:18:33 -07:00
David Lawrence da59198191 adding htpasswd auth to support the same set of mechanisms as distribution
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-13 14:17:24 -07:00
Diogo Monica 682e7ea00b Fixing lint
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-09 17:58:55 -07:00
David Lawrence 89379a728c adding timestamping and some general cleanup
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-03 15:38:09 -07:00
David Lawrence 0f1e8b0134 adding delete to server
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-06-21 16:37:30 -07:00
Nathan McCauley 518d0a2702 Notary Server in server log messages
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-06-19 11:17:06 -07:00
Nathan McCauley e46a95227c rename vetinari to notary
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-06-19 11:01:19 -07:00
David Lawrence 322f60b1ba tuf push working 2015-06-17 22:10:07 -07:00
David Lawrence 801dd397ff runs with basic setup for demo 2015-06-16 12:17:40 -07:00
David Lawrence cc0782d3d2 rewriting imports to 'gotuf', adding config to set log level, making
restart/shutdown cleanup connections after timeout, updating godeps
2015-06-11 16:30:25 -07:00
David Lawrence 4508a1db9a fixing server tests 2015-05-12 16:06:30 -07:00
David Lawrence 4b39bf0c97 changing over logging to logrus 2015-05-12 11:11:39 -07:00
Diogo Monica 0f6c4799aa Changing compose and logging 2015-04-28 22:53:09 -07:00
David Lawrence b858e939a3 couple of fixes for demo 2015-04-28 13:47:50 -07:00
Nathan McCauley 2106645af9 gofmt updates 2015-04-28 11:28:30 -07:00
Nathan McCauley faeed37c22 print debugging on failure to load keys, correct cert paths 2015-04-28 11:22:10 -07:00
Nathan McCauley 95adc15e36 debugging stuffz 2015-04-28 11:22:10 -07:00
Nathan McCauley 5938d9e09c add CA config option 2015-04-28 11:22:10 -07:00
Nathan McCauley c043e6d5a3 Initial docker-compose config for rufus/vetinari integration 2015-04-28 11:22:09 -07:00
Nathan McCauley 8403c09c1f Hook up SigningService to server, add config 2015-04-27 11:14:12 -07:00
David Lawrence 929828ba52 token authorizer with passing tests 2015-04-24 11:12:05 -07:00
David Lawrence 70b749bb46 renaming interfaces to be more go-like now that arch is settling down 2015-04-21 15:01:09 -07:00
David Lawrence 52505d36e1 cleanup work and updating godeps 2015-04-20 11:30:58 -07:00
David Lawrence b2e089c6ee adding tests to utils package 2015-04-16 15:37:08 -07:00
David Lawrence 201546b2d8 interfaces all work together now and it builds 2015-04-13 09:51:02 -07:00