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

@ -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,
}

View File

@ -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"
@ -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",
@ -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": []
}