feat: strengthen risk controls and review workflows
This commit is contained in:
@@ -173,6 +173,32 @@ func TestDisconnectChannelStopsSupplierPool(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDisconnectDownstreamAccountEndpointIsAccountScoped(t *testing.T) {
|
||||
handler := handlerWithServer(Server{})
|
||||
resp := httptest.NewRecorder()
|
||||
req := httptest.NewRequest(
|
||||
http.MethodPost,
|
||||
"/downstream/connections/disconnect",
|
||||
strings.NewReader(`{"account":"100001","reason":"application_disabled"}`),
|
||||
)
|
||||
|
||||
handler.ServeHTTP(resp, req)
|
||||
|
||||
if resp.Code != http.StatusOK {
|
||||
t.Fatalf("unexpected response status: %d body=%s", resp.Code, resp.Body.String())
|
||||
}
|
||||
var payload struct {
|
||||
Account string `json:"account"`
|
||||
Disconnected int `json:"disconnected"`
|
||||
}
|
||||
if err := json.Unmarshal(resp.Body.Bytes(), &payload); err != nil {
|
||||
t.Fatalf("decode response: %v", err)
|
||||
}
|
||||
if payload.Account != "100001" || payload.Disconnected != 0 {
|
||||
t.Fatalf("unexpected downstream disconnect response: %+v", payload)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecoveryCandidatesEndpointReturnsView(t *testing.T) {
|
||||
handler := handlerWithServer(Server{
|
||||
RecoveryCandidates: func(context.Context) ([]inbound.DownstreamPresence, error) {
|
||||
|
||||
Reference in New Issue
Block a user