Commit Graph

67 Commits

Author SHA1 Message Date
Ying Li 3aeae90290 storage/memory's UpdateMany should fail if versions are not higher
Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-19 15:14:14 -07:00
Riyaz Faizullabhoy db2e625341 Transaction-logic for rethink
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-18 17:41:06 -07:00
Riyaz Faizullabhoy db5d1b6fb8 Write ack and read mode for linearizability on tuf_files table
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-18 15:06:29 -07:00
Riyaz Faizullabhoy b04a5c00e0 Add more tests and restructure
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-15 10:25:22 -07:00
Riyaz Faizullabhoy f3854dc390 Add unit tests, remove auth key, cleanup
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:05 -07:00
David Lawrence edef1cd5c8 tweaking consistent store tests
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:04 -07:00
David Lawrence 92c17b754c make notary-signer tests work and add test for signer bootstrap
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:04 -07:00
Riyaz Faizullabhoy 29e5b7d449 Add docstrings to fix lint
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:04 -07:00
Riyaz Faizullabhoy 97dcdaf91f Use explicit string slices for secondary index lookup
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:04 -07:00
Riyaz Faizullabhoy 01a988a817 Empty result handling, and err checking
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:03 -07:00
David Lawrence 6ace616c34 bugfixes for rethink integration
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:03 -07:00
David Lawrence fbe14c1a35 rethinkdb doesn't actually support composite primary keys
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:03 -07:00
David Lawrence 33f5255c8d need a passthrough bootstrap on TufMetaStore
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:03 -07:00
Riyaz Faizullabhoy d95891e54f Caching logic for TufMetaStorage
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:02 -07:00
David Lawrence b196a803e2 updating use of indices and queries
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:02 -07:00
Riyaz Faizullabhoy 30f356f940 Use consistent meta storage for server binary
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:02 -07:00
Riyaz Faizullabhoy 6d3b017c56 Consistent metastore walks from current timestamp to checksums of snapshot/other roles
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-04-14 19:38:02 -07:00
David Lawrence b8c62731a6 adding bootstrapping and config update for notary server
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:02 -07:00
David Lawrence 045721250f rethink server implementation
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-04-14 19:38:02 -07:00
Ying Li 7404f4ff55 Embed SignedCommon in Root, Snapshot, and Timestamp, as it's already
embedded in Targets.  This way we can easily get a SignedCommon object
out after calling RootFromSigned, etc.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-07 17:27:13 -07:00
Ying Li 15908298bd Use require, not assert, in server/... tests.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-04 17:18:53 -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 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
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 adfbe6938e cleaning up logging
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-24 10:38:55 -08:00
David Lawrence 27961b010e negative tests for get by checksum
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-24 10:38:55 -08:00
David Lawrence 4738760794 get by checksum
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-24 10:38:55 -08:00
David Lawrence 5a9e06fe5c adding sha256 column to tuf_files database table
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2016-01-11 17:31:01 -08:00
David Lawrence 38d2175087 tests for new validation code
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-16 15:06:48 -08:00
David Lawrence 844c1872c4 adding tests for server/snapshot/snapshot.go
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-07 12:55:09 -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 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 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 f73560d839 creating concrete types for the various key ciphers
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-28 16:02:55 -07:00
David Lawrence 2833a88292 adding gotuf to notary
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-27 16:36:06 -07:00
Ying Li 272f442fee Use an anonymous interface instead, thanks @endophage
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 11:33:45 -07:00
Ying Li 79066c3403 Just drop the test tables when they should not exist
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 11:30:34 -07:00
Ying Li 7f0078d513 Define interface for iterating through gorm models by table name
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 11:30:04 -07:00
Ying Li e786d62f0f Check for duplicate key errors in both mysql and sqlite3 in server/db
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 17:04:24 -07:00
Ying Li ba4e596457 Move the testing.T module to be the first argument to helper functions.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 16:19:17 -07:00
Ying Li 09a041be14 Use more idiomatic go in if conditions.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 16:18:59 -07:00
Ying Li 9290507a1f In server/storage/database, do not panic, and also return the right error.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 15:56:45 -07:00
Ying Li 517dd4bbd0 Rename MySQL to SQL in server DB tests
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 11:28:57 -07:00
Ying Li df95dc4564 Add a DB health check to the server storage DB
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-13 11:28:14 -07:00
Ying Li 85a447f701 Clean up SQLStorage docstring to refer to the model
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 17:10:33 -07:00
Ying Li 7fa991c3ff Gormizes the server database and make it SQL-DB agnostic.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 16:45:41 -07:00
Ying Li e8528ec391 Attempt to match the model exactly up with the initial sql + the
migrate sql.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 15:44:00 -07:00
Ying Li 1bb1f1acd2 Refactor server/storage models to use gorm.Model and to be in their
file.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 14:28:20 -07:00
Ying Li 01f7adc80c Document the intended behavior of each function in the storage
interface.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-10 18:44:44 -07:00
Ying Li 99cac889b1 Add some more tests for storing TUF files in the db
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-09 22:48:21 -07:00