MSP-7042 Add http_method to access_list
This commit is contained in:
1 parent
4932568c64
commit
e865549fdc
12 files changed
+251
-44
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package tests_test
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -196,3 +197,26 @@ func (s *SecureSuite) TestAuthorize_NotFound() {
|
||||
Authorized: false,
|
||||
}, result)
|
||||
}
|
||||
|
||||
func (s *SecureSuite) TestAuthorize_WithHttpMethod_Success_True() {
|
||||
InsertAccessList(s.testDb, entity.AccessList{
|
||||
AppId: 7,
|
||||
HttpMethod: http.MethodGet,
|
||||
Method: "endpoint/available_http",
|
||||
Value: true,
|
||||
})
|
||||
|
||||
result := domain.AuthorizeResponse{}
|
||||
err := s.api.Invoke("system/secure/authorize").
|
||||
JsonRequestBody(domain.AuthorizeRequest{
|
||||
ApplicationId: 7,
|
||||
HttpMethod: http.MethodGet,
|
||||
Endpoint: "endpoint/available_http",
|
||||
}).
|
||||
JsonResponseBody(&result).
|
||||
Do(s.T().Context())
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal(domain.AuthorizeResponse{
|
||||
Authorized: true,
|
||||
}, result)
|
||||
}
|
||||
Reference in new issue
Block a user