Skip to content

Commit

Permalink
Changed the keys post request for updated tags syntax in the keys api
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Meiring committed Sep 4, 2019
1 parent fd08dd8 commit 8d693ef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tacc-keys/tacc-services/post_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (

type payload struct {
KeyValue string `json:"key_value"`
Tags []payloadTags `json:"tags"`
Tags []payloadTag `json:"tags"`
}

type payloadTags struct {
Purpose string `json:"name"`
type payloadTag struct {
Name string `json:"name"`
Value string `json:"value"`
}

// PostUserPubKey posts a user's public key to the keys server.
Expand All @@ -27,7 +28,7 @@ func PostUserPubKey(baseURL, accessToken, user, pubkey string, tag string) error
// Request payload.
data := payload{
KeyValue: pubkey,
Tags: []payloadTags{{Purpose: tag}},
Tags: []payloadTag{{Name:"go-keys-client", Value: tag}},
}
payloadBytes, err := json.Marshal(data)
if err != nil {
Expand Down

0 comments on commit 8d693ef

Please sign in to comment.