Merge pull request #12595 from influxdata/fix_secret_endpoint

fix(http): change secrets to match swagger
pull/12564/head
kelwang 2019-03-13 14:23:39 -04:00 committed by GitHub
commit bd952e8d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -189,7 +189,7 @@ func newSecretsResponse(orgID influxdb.ID, ks []string) *secretsResponse {
return &secretsResponse{ return &secretsResponse{
Links: map[string]string{ Links: map[string]string{
"org": fmt.Sprintf("/api/v2/orgs/%s", orgID), "org": fmt.Sprintf("/api/v2/orgs/%s", orgID),
"secrets": fmt.Sprintf("/api/v2/orgs/%s/secrets", orgID), "self": fmt.Sprintf("/api/v2/orgs/%s/secrets", orgID),
}, },
Secrets: ks, Secrets: ks,
} }

View File

@ -5,12 +5,13 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"go.uber.org/zap"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"testing" "testing"
"go.uber.org/zap"
platform "github.com/influxdata/influxdb" platform "github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/inmem" "github.com/influxdata/influxdb/inmem"
"github.com/influxdata/influxdb/mock" "github.com/influxdata/influxdb/mock"
@ -98,7 +99,7 @@ func TestSecretService_handleGetSecrets(t *testing.T) {
{ {
"links": { "links": {
"org": "/api/v2/orgs/0000000000000001", "org": "/api/v2/orgs/0000000000000001",
"secrets": "/api/v2/orgs/0000000000000001/secrets" "self": "/api/v2/orgs/0000000000000001/secrets"
}, },
"secrets": [ "secrets": [
"hello", "hello",
@ -127,7 +128,7 @@ func TestSecretService_handleGetSecrets(t *testing.T) {
{ {
"links": { "links": {
"org": "/api/v2/orgs/0000000000000001", "org": "/api/v2/orgs/0000000000000001",
"secrets": "/api/v2/orgs/0000000000000001/secrets" "self": "/api/v2/orgs/0000000000000001/secrets"
}, },
"secrets": [] "secrets": []
} }