[Alerting]: Require login for alerting API routes (#32688)
* [Alerting]: Require login for alerting API routes * Fix example requests * [Alerting]: Add /api prefix to all routes (#32716)
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
)
|
||||
|
||||
@@ -30,7 +31,7 @@ func (api *API) RegisterTestingApiEndpoints(srv TestingApiService) {
|
||||
api.RouteRegister.Group("", func(group routing.RouteRegister) {
|
||||
group.Post(toMacaronPath("/api/v1/receiver/test"), binding.Bind(apimodels.ExtendedReceiver{}), routing.Wrap(srv.RouteTestReceiverConfig))
|
||||
group.Post(toMacaronPath("/api/v1/rule/test"), binding.Bind(apimodels.TestRulePayload{}), routing.Wrap(srv.RouteTestRuleConfig))
|
||||
})
|
||||
}, middleware.ReqSignedIn)
|
||||
}
|
||||
|
||||
func (base TestingApiBase) RouteTestReceiverConfig(c *models.ReqContext, body apimodels.ExtendedReceiver) response.Response {
|
||||
|
||||
Reference in New Issue
Block a user