Skip to content

Commit

Permalink
Remove JSON struct field tags
Browse files Browse the repository at this point in the history
  • Loading branch information
vqhuy committed Mar 18, 2017
1 parent 1d94b2f commit 77350b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
21 changes: 10 additions & 11 deletions keyserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ var registrationMsg = `
{
"type": 0,
"request": {
"username": "alice@twitter",
"key": [0,1,2],
"allow_unsigned_key_change": true,
"allow_public_lookup": true
"Username": "alice@twitter",
"Key": [0,1,2],
"AllowUnsignedKeychange": true,
"AllowPublicLookup": true
}
}
`
Expand All @@ -31,7 +31,7 @@ var keylookupMsg = `
{
"type": 1,
"request": {
"username": "alice@twitter"
"Username": "alice@twitter"
}
}
`
Expand Down Expand Up @@ -451,9 +451,8 @@ func TestKeyLookupInEpoch(t *testing.T) {
{
"type": 2,
"request": {
"username": "alice@twitter",
"epoch": 1,
"limit": 4
"Username": "alice@twitter",
"Epoch": 1
}
}
`
Expand Down Expand Up @@ -498,9 +497,9 @@ func TestMonitoring(t *testing.T) {
{
"type": 3,
"request": {
"username": "alice@twitter",
"start_epoch": 1,
"end_epoch": 5
"Username": "alice@twitter",
"StartEpoch": 1,
"EndEpoch": 5
}
}
`
Expand Down
20 changes: 10 additions & 10 deletions protocol/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ type Request struct {
// The response to a successful request is a DirectoryProof with a TB for
// the requested username and public key.
type RegistrationRequest struct {
Username string `json:"username"`
Key []byte `json:"key"`
AllowUnsignedKeychange bool `json:"allow_unsigned_key_change,omitempty"`
AllowPublicLookup bool `json:"allow_public_lookup,omitempty"`
Username string
Key []byte
AllowUnsignedKeychange bool `json:",omitempty"`
AllowPublicLookup bool `json:",omitempty"`
}

// A KeyLookupRequest is a message with a username as a string
Expand All @@ -47,7 +47,7 @@ type RegistrationRequest struct {
// the requested username was registered during the latest epoch (i.e.
// the new binding hasn't been committed to the directory).
type KeyLookupRequest struct {
Username string `json:"username"`
Username string
}

// A KeyLookupInEpochRequest is a message with a username as a string and
Expand All @@ -61,8 +61,8 @@ type KeyLookupRequest struct {
// of length 1 containing the auth path for the requested Epoch, and a list
// of STRs covering the epoch range [Epoch, d.LatestSTR().Epoch].
type KeyLookupInEpochRequest struct {
Username string `json:"username"`
Epoch uint64 `json:"epoch"`
Username string
Epoch uint64
}

// A MonitoringRequest is a message with a username as a string and the
Expand All @@ -85,9 +85,9 @@ type KeyLookupInEpochRequest struct {
// which can be used to verify the inclusion of the binding after
// registration.
type MonitoringRequest struct {
Username string `json:"username"`
StartEpoch uint64 `json:"start_epoch"`
EndEpoch uint64 `json:"end_epoch"`
Username string
StartEpoch uint64
EndEpoch uint64
}

// A Response message indicates the result of a CONIKS client request
Expand Down

0 comments on commit 77350b6

Please sign in to comment.