|
|
|
@ -2172,8 +2172,8 @@ func TestAgentConnectAuthorize_idInvalidFormat(t *testing.T) {
|
|
|
|
|
defer a.Shutdown() |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: "web", |
|
|
|
|
ClientID: "tubes", |
|
|
|
|
Target: "web", |
|
|
|
|
ClientCertURI: "tubes", |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
@ -2195,8 +2195,8 @@ func TestAgentConnectAuthorize_idNotService(t *testing.T) {
|
|
|
|
|
defer a.Shutdown() |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: "web", |
|
|
|
|
ClientID: "spiffe://1234.consul", |
|
|
|
|
Target: "web", |
|
|
|
|
ClientCertURI: "spiffe://1234.consul", |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
@ -2237,8 +2237,8 @@ func TestAgentConnectAuthorize_allow(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: target, |
|
|
|
|
ClientID: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
Target: target, |
|
|
|
|
ClientCertURI: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
@ -2279,8 +2279,8 @@ func TestAgentConnectAuthorize_deny(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: target, |
|
|
|
|
ClientID: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
Target: target, |
|
|
|
|
ClientCertURI: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
@ -2320,8 +2320,8 @@ func TestAgentConnectAuthorize_serviceWrite(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientID: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientCertURI: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", |
|
|
|
|
"/v1/agent/connect/authorize?token="+token, jsonReader(args)) |
|
|
|
@ -2339,8 +2339,8 @@ func TestAgentConnectAuthorize_defaultDeny(t *testing.T) {
|
|
|
|
|
defer a.Shutdown() |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientID: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientCertURI: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize?token=root", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
@ -2369,8 +2369,8 @@ func TestAgentConnectAuthorize_defaultAllow(t *testing.T) {
|
|
|
|
|
defer a.Shutdown() |
|
|
|
|
|
|
|
|
|
args := &structs.ConnectAuthorizeRequest{ |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientID: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
Target: "foo", |
|
|
|
|
ClientCertURI: connect.TestSpiffeIDService(t, "web").URI().String(), |
|
|
|
|
} |
|
|
|
|
req, _ := http.NewRequest("POST", "/v1/agent/connect/authorize?token=root", jsonReader(args)) |
|
|
|
|
resp := httptest.NewRecorder() |
|
|
|
|