Skip to content

Commit

Permalink
fix(http): change secrets to match swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
kelwang committed Mar 13, 2019
1 parent ab2fd3b commit 44f5ade
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions http/org_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ type secretsResponse struct {
func newSecretsResponse(orgID influxdb.ID, ks []string) *secretsResponse {
return &secretsResponse{
Links: map[string]string{
"org": fmt.Sprintf("/api/v2/orgs/%s", orgID),
"secrets": fmt.Sprintf("/api/v2/orgs/%s/secrets", orgID),
"org": fmt.Sprintf("/api/v2/orgs/%s", orgID),
"self": fmt.Sprintf("/api/v2/orgs/%s/secrets", orgID),
},
Secrets: ks,
}
Expand Down
7 changes: 4 additions & 3 deletions http/org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"context"
"encoding/json"
"fmt"
"go.uber.org/zap"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"

"go.uber.org/zap"

platform "github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/inmem"
"github.com/influxdata/influxdb/mock"
Expand Down Expand Up @@ -98,7 +99,7 @@ func TestSecretService_handleGetSecrets(t *testing.T) {
{
"links": {
"org": "/api/v2/orgs/0000000000000001",
"secrets": "/api/v2/orgs/0000000000000001/secrets"
"self": "/api/v2/orgs/0000000000000001/secrets"
},
"secrets": [
"hello",
Expand Down Expand Up @@ -127,7 +128,7 @@ func TestSecretService_handleGetSecrets(t *testing.T) {
{
"links": {
"org": "/api/v2/orgs/0000000000000001",
"secrets": "/api/v2/orgs/0000000000000001/secrets"
"self": "/api/v2/orgs/0000000000000001/secrets"
},
"secrets": []
}
Expand Down

0 comments on commit 44f5ade

Please sign in to comment.