Permalink
Browse files

API: Rename Epoch to Revision (#1104)

* Rename Epoch -> Revision

git ls-files | xargs | sed -i 's/Epoch/Revision/g'
git ls-files | xargs | sed -i 's/epoch/revision/g'
go generate ./core/api
gofmt -w .

* Initialisms
  • Loading branch information...
gdbelvin committed Nov 8, 2018
1 parent ac84fc9 commit 3d27c7efc5f89c1c71566e8b75dee93d203681a8
Showing with 687 additions and 686 deletions.
  1. +2 −2 README.md
  2. +6 −6 cmd/keytransparency-client/cmd/history.go
  3. +11 −11 core/api/monitor/v1/monitor.proto
  4. +45 −45 core/api/monitor/v1/monitor_go_proto/monitor.pb.go
  5. +5 −5 core/api/monitor/v1/monitor_go_proto/monitor.pb.gw.go
  6. +2 −2 core/api/v1/admin.proto
  7. +46 −46 core/api/v1/keytransparency.proto
  8. +2 −2 core/api/v1/keytransparency_go_proto/admin.pb.go
  9. +236 −235 core/api/v1/keytransparency_go_proto/keytransparency.pb.go
  10. +46 −46 core/api/v1/keytransparency_go_proto/keytransparency.pb.gw.go
  11. +25 −25 core/client/client.go
  12. +20 −20 core/client/client_test.go
  13. +12 −12 core/client/get_and_verify.go
  14. +22 −22 core/client/mutations.go
  15. +5 −5 core/client/verify.go
  16. +9 −9 core/fake/monitorstorage.go
  17. +2 −2 core/integration/client_tests.go
  18. +9 −9 core/integration/monitor_tests.go
  19. +30 −30 core/keyserver/epochs.go
  20. +4 −4 core/keyserver/epochs_test.go
  21. +14 −14 core/keyserver/keyserver.go
  22. +15 −15 core/keyserver/validate.go
  23. +23 −23 core/monitor/monitor.go
  24. +7 −7 core/monitor/monitor_test.go
  25. +2 −2 core/monitor/verify.go
  26. +11 −11 core/monitorserver/server.go
  27. +9 −9 core/monitorstorage/storage.go
  28. +1 −1 core/mutator/mutator.go
  29. +6 −6 core/sequencer/sequencer_api.proto
  30. +36 −36 core/sequencer/sequencer_go_proto/sequencer_api.pb.go
  31. +7 −7 core/sequencer/server.go
  32. +5 −5 core/testdata/getentryresponse.json
  33. +2 −2 docs/architecture.md
  34. +7 −7 docs/design.md
  35. +2 −2 docs/http_apis.md
  36. +1 −1 impl/integration/env.go
@@ -70,8 +70,8 @@ development.
#### Verify key history
```
keytransparency-client history <email> --insecure
Epoch |Timestamp |Profile
4 |Mon Sep 12 22:23:54 UTC 2016 |keys:<key:"app1" value:"test" >
Revision |Timestamp |Profile
4 |Mon Sep 12 22:23:54 UTC 2016 |keys:<key:"app1" value:"test" >
```
@@ -51,13 +51,13 @@ and verify that the results are consistent.`,
return fmt.Errorf("error connecting: %v", err)
}
if end == 0 {
// Get the current epoch.
slr, smr, err := c.VerifiedGetLatestEpoch(ctx)
// Get the current revision.
slr, smr, err := c.VerifiedGetLatestRevision(ctx)
if err != nil {
return fmt.Errorf("failed to get user: %v", err)
}
if verbose {
fmt.Printf("Got current epoch: %v\n", slr.TreeSize-1)
fmt.Printf("Got current revision: %v\n", slr.TreeSize-1)
}
end = int64(smr.Revision)
}
@@ -78,7 +78,7 @@ and verify that the results are consistent.`,
}
sort.Sort(keys)
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.Debug)
fmt.Fprintln(w, "Epoch\tTimestamp\tProfile")
fmt.Fprintln(w, "Revision\tTimestamp\tProfile")
for _, e := range keys {
mapRoot := roots[e]
t := time.Unix(0, int64(mapRoot.TimestampNanos))
@@ -102,6 +102,6 @@ func (m uint64Slice) Less(i, j int) bool { return m[i] < m[j] }
func init() {
RootCmd.AddCommand(histCmd)
histCmd.PersistentFlags().Int64Var(&start, "start", 1, "Start epoch")
histCmd.PersistentFlags().Int64Var(&end, "end", 0, "End epoch")
histCmd.PersistentFlags().Int64Var(&start, "start", 1, "Start revision")
histCmd.PersistentFlags().Int64Var(&end, "end", 0, "End revision")
}
@@ -37,17 +37,17 @@ message GetStateRequest {
// directory_id identifies the merkle tree being monitored.
string directory_id = 3;
// epoch specifies the revision for which the monitoring results will
// be returned (epochs start at 0).
int64 epoch = 1;
// revision specifies the revision for which the monitoring results will
// be returned (revisions start at 0).
int64 revision = 1;
}
// State represents the monitor's evaluation of a Key Transparency directory
// at a particular epoch.
// at a particular revision.
message State {
// smr contains the map root for the sparse Merkle Tree signed with the
// monitor's key on success. If the checks were not successful the
// smr will be empty. The epochs are encoded into the smr map_revision.
// smr will be empty. The revisions are encoded into the smr map_revision.
trillian.SignedMapRoot smr = 1;
// seen_time contains the time when this particular signed map root was
@@ -64,17 +64,17 @@ message State {
//
// - Signed Map Roots can be collected using the GetSignedMapRoot APIs.
// - Monitor resources are named:
// - /monitor/v1/servers/{kt_url}/directories/{directory_id}/states/{epoch}
// - /monitor/v1/servers/{kt_url}/directories/{directory_id}/states/{revision}
// - /monitor/v1/servers/{kt_url}/directories/{directory_id}/states:latest
//
service Monitor {
// GetSignedMapRoot returns the latest valid signed map root the monitor
// observed. Additionally, the response contains extra data necessary to
// reproduce errors on failure.
//
// Returns the signed map root for the latest epoch the monitor observed. If
// Returns the signed map root for the latest revision the monitor observed. If
// the monitor could not reconstruct the map root given the set of mutations
// from the previous to the current epoch it won't sign the map root and
// from the previous to the current revision it won't sign the map root and
// additional data will be provided to reproduce the failure.
rpc GetState(GetStateRequest) returns (State) {
option (google.api.http) = {
@@ -85,13 +85,13 @@ service Monitor {
// GetSignedMapRootByRevision returns the monitor's result for a specific map
// revision.
//
// Returns the signed map root for the specified epoch the monitor observed.
// Returns the signed map root for the specified revision the monitor observed.
// If the monitor could not reconstruct the map root given the set of
// mutations from the previous to the current epoch it won't sign the map
// mutations from the previous to the current revision it won't sign the map
// root and additional data will be provided to reproduce the failure.
rpc GetStateByRevision(GetStateRequest) returns (State) {
option (google.api.http) = {
get: "/monitor/v1/servers/{kt_url}/directories/{directory_id}/states/{epoch}"
get: "/monitor/v1/servers/{kt_url}/directories/{directory_id}/states/{revision}"
};
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -41,9 +41,9 @@ message Directory {
trillian.Tree map = 3;
// Vrf contains the VRF public key.
keyspb.PublicKey vrf = 4;
// min_interval is the minimum time between epochs.
// min_interval is the minimum time between revisions.
google.protobuf.Duration min_interval = 5;
// max_interval is the maximum time between epochs.
// max_interval is the maximum time between revisions.
google.protobuf.Duration max_interval = 6;
// Deleted indicates whether the directory has been marked as deleted.
// By its presence in a response, this directory has not been garbage
Oops, something went wrong.

0 comments on commit 3d27c7e

Please sign in to comment.