diff --git a/config/routes.php b/config/routes.php index d51121a..ac1ab26 100644 --- a/config/routes.php +++ b/config/routes.php @@ -92,27 +92,14 @@ $routes->prefix('Open', function (RouteBuilder $routes) { $routes->fallbacks(DashedRoute::class); }); -// API routes -$routes->scope('/api', function (RouteBuilder $routes) { - // $routes->applyMiddleware('ratelimit', 'auth.api'); - $routes->scope('/v1', function (RouteBuilder $routes) { - // $routes->applyMiddleware('v1compat'); - $routes->setExtensions(['json']); - - // Generic API route - $routes->connect('/{controller}/{action}/*'); - - // Tags plugin routes - $routes->plugin( - 'tags', - ['path' => '/tags'], - function ($routes) { - $routes->setRouteClass(DashedRoute::class); - $routes->connect( - '/{action}/*', - ['controller' => 'Tags'] - ); - } - ); - }); -}); +/* + * If you need a different set of middleware or none at all, + * open new scope and define routes there. + * + * ``` + * $routes->scope('/api', function (RouteBuilder $builder) { + * // No $builder->applyMiddleware() here. + * // Connect API actions here. + * }); + * ``` + */ diff --git a/tests/TestCase/Api/AuthKeys/AddAuthKeyApiTest.php b/tests/TestCase/Api/AuthKeys/AddAuthKeyApiTest.php index 32a79c4..ca305e8 100644 --- a/tests/TestCase/Api/AuthKeys/AddAuthKeyApiTest.php +++ b/tests/TestCase/Api/AuthKeys/AddAuthKeyApiTest.php @@ -13,7 +13,7 @@ class AddAuthKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/authKeys/add'; + protected const ENDPOINT = '/authKeys/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/AuthKeys/DeleteAuthKeyApiTest.php b/tests/TestCase/Api/AuthKeys/DeleteAuthKeyApiTest.php index 539ab29..a621f37 100644 --- a/tests/TestCase/Api/AuthKeys/DeleteAuthKeyApiTest.php +++ b/tests/TestCase/Api/AuthKeys/DeleteAuthKeyApiTest.php @@ -12,7 +12,7 @@ class DeleteAuthKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/authKeys/delete'; + protected const ENDPOINT = '/authKeys/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/AuthKeys/IndexAuthKeysApiTest.php b/tests/TestCase/Api/AuthKeys/IndexAuthKeysApiTest.php index 43a3390..0712480 100644 --- a/tests/TestCase/Api/AuthKeys/IndexAuthKeysApiTest.php +++ b/tests/TestCase/Api/AuthKeys/IndexAuthKeysApiTest.php @@ -12,7 +12,7 @@ class IndexAuthKeysApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/authKeys/index'; + protected const ENDPOINT = '/authKeys/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/AddBroodApiTest.php b/tests/TestCase/Api/Broods/AddBroodApiTest.php index 3da884c..f064f61 100644 --- a/tests/TestCase/Api/Broods/AddBroodApiTest.php +++ b/tests/TestCase/Api/Broods/AddBroodApiTest.php @@ -13,7 +13,7 @@ class AddBroodApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/broods/add'; + protected const ENDPOINT = '/broods/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/DeleteBroodApiTest.php b/tests/TestCase/Api/Broods/DeleteBroodApiTest.php index c54e47a..420bf01 100644 --- a/tests/TestCase/Api/Broods/DeleteBroodApiTest.php +++ b/tests/TestCase/Api/Broods/DeleteBroodApiTest.php @@ -13,7 +13,7 @@ class DeleteBroodApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/broods/delete'; + protected const ENDPOINT = '/broods/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/EditBroodApiTest.php b/tests/TestCase/Api/Broods/EditBroodApiTest.php index 9bf3077..ad5d70b 100644 --- a/tests/TestCase/Api/Broods/EditBroodApiTest.php +++ b/tests/TestCase/Api/Broods/EditBroodApiTest.php @@ -14,7 +14,7 @@ class EditBroodApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/broods/edit'; + protected const ENDPOINT = '/broods/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/IndexBroodsApiTest.php b/tests/TestCase/Api/Broods/IndexBroodsApiTest.php index 598898d..d70bc53 100644 --- a/tests/TestCase/Api/Broods/IndexBroodsApiTest.php +++ b/tests/TestCase/Api/Broods/IndexBroodsApiTest.php @@ -13,7 +13,7 @@ class IndexBroodsApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/index'; + protected const ENDPOINT = '/users/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/TestBroodConnectionApiTest.php b/tests/TestCase/Api/Broods/TestBroodConnectionApiTest.php index 31c2d48..ee1117f 100644 --- a/tests/TestCase/Api/Broods/TestBroodConnectionApiTest.php +++ b/tests/TestCase/Api/Broods/TestBroodConnectionApiTest.php @@ -16,7 +16,7 @@ class TestBroodConnectionApiTest extends TestCase use ApiTestTrait; use WireMockTestTrait; - protected const ENDPOINT = '/api/v1/broods/testConnection'; + protected const ENDPOINT = '/broods/testConnection'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Broods/ViewBroodApiTest.php b/tests/TestCase/Api/Broods/ViewBroodApiTest.php index c357d90..bd9e5a7 100644 --- a/tests/TestCase/Api/Broods/ViewBroodApiTest.php +++ b/tests/TestCase/Api/Broods/ViewBroodApiTest.php @@ -13,7 +13,7 @@ class ViewBroodApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/broods/view'; + protected const ENDPOINT = '/broods/view'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/EncryptionKeys/AddEncryptionKeyApiTest.php b/tests/TestCase/Api/EncryptionKeys/AddEncryptionKeyApiTest.php index 1adf5d9..00cc377 100644 --- a/tests/TestCase/Api/EncryptionKeys/AddEncryptionKeyApiTest.php +++ b/tests/TestCase/Api/EncryptionKeys/AddEncryptionKeyApiTest.php @@ -14,7 +14,7 @@ class AddEncryptionKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/encryptionKeys/add'; + protected const ENDPOINT = '/encryptionKeys/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/EncryptionKeys/DeleteEncryptionKeyApiTest.php b/tests/TestCase/Api/EncryptionKeys/DeleteEncryptionKeyApiTest.php index b089c91..6ae8143 100644 --- a/tests/TestCase/Api/EncryptionKeys/DeleteEncryptionKeyApiTest.php +++ b/tests/TestCase/Api/EncryptionKeys/DeleteEncryptionKeyApiTest.php @@ -13,7 +13,7 @@ class DeleteEncryptionKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/encryptionKeys/delete'; + protected const ENDPOINT = '/encryptionKeys/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/EncryptionKeys/EditEncryptionKeyApiTest.php b/tests/TestCase/Api/EncryptionKeys/EditEncryptionKeyApiTest.php index 300a969..2636fc1 100644 --- a/tests/TestCase/Api/EncryptionKeys/EditEncryptionKeyApiTest.php +++ b/tests/TestCase/Api/EncryptionKeys/EditEncryptionKeyApiTest.php @@ -13,7 +13,7 @@ class EditEncryptionKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/encryptionKeys/edit'; + protected const ENDPOINT = '/encryptionKeys/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/EncryptionKeys/IndexEncryptionKeysApiTest.php b/tests/TestCase/Api/EncryptionKeys/IndexEncryptionKeysApiTest.php index 9aec4c5..844336d 100644 --- a/tests/TestCase/Api/EncryptionKeys/IndexEncryptionKeysApiTest.php +++ b/tests/TestCase/Api/EncryptionKeys/IndexEncryptionKeysApiTest.php @@ -13,7 +13,7 @@ class IndexEncryptionKeysApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/encryptionKeys/index'; + protected const ENDPOINT = '/encryptionKeys/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/EncryptionKeys/ViewEncryptionKeyApiTest.php b/tests/TestCase/Api/EncryptionKeys/ViewEncryptionKeyApiTest.php index 39c6519..de324fb 100644 --- a/tests/TestCase/Api/EncryptionKeys/ViewEncryptionKeyApiTest.php +++ b/tests/TestCase/Api/EncryptionKeys/ViewEncryptionKeyApiTest.php @@ -13,7 +13,7 @@ class ViewEncryptionKeyApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/encryptionKeys/view'; + protected const ENDPOINT = '/encryptionKeys/view'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Inbox/CreateInboxEntryApiTest.php b/tests/TestCase/Api/Inbox/CreateInboxEntryApiTest.php index 9c34aa0..8434d62 100644 --- a/tests/TestCase/Api/Inbox/CreateInboxEntryApiTest.php +++ b/tests/TestCase/Api/Inbox/CreateInboxEntryApiTest.php @@ -12,7 +12,7 @@ class CreateInboxEntryApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/inbox/createEntry'; + protected const ENDPOINT = '/inbox/createEntry'; protected $fixtures = [ 'app.Inbox', diff --git a/tests/TestCase/Api/Inbox/IndexInboxApiTest.php b/tests/TestCase/Api/Inbox/IndexInboxApiTest.php index da99710..ae9c039 100644 --- a/tests/TestCase/Api/Inbox/IndexInboxApiTest.php +++ b/tests/TestCase/Api/Inbox/IndexInboxApiTest.php @@ -13,7 +13,7 @@ class IndexInboxApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/inbox/index'; + protected const ENDPOINT = '/inbox/index'; protected $fixtures = [ 'app.Inbox', diff --git a/tests/TestCase/Api/Individuals/AddIndividualApiTest.php b/tests/TestCase/Api/Individuals/AddIndividualApiTest.php index cced4e4..fcff319 100644 --- a/tests/TestCase/Api/Individuals/AddIndividualApiTest.php +++ b/tests/TestCase/Api/Individuals/AddIndividualApiTest.php @@ -12,7 +12,7 @@ class AddIndividualApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/individuals/add'; + protected const ENDPOINT = '/individuals/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Individuals/DeleteIndividualApiTest.php b/tests/TestCase/Api/Individuals/DeleteIndividualApiTest.php index 0768b59..e5657aa 100644 --- a/tests/TestCase/Api/Individuals/DeleteIndividualApiTest.php +++ b/tests/TestCase/Api/Individuals/DeleteIndividualApiTest.php @@ -13,7 +13,7 @@ class DeleteIndividualApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/individuals/delete'; + protected const ENDPOINT = '/individuals/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Individuals/EditIndividualApiTest.php b/tests/TestCase/Api/Individuals/EditIndividualApiTest.php index cdff2d9..c888bba 100644 --- a/tests/TestCase/Api/Individuals/EditIndividualApiTest.php +++ b/tests/TestCase/Api/Individuals/EditIndividualApiTest.php @@ -13,7 +13,7 @@ class EditIndividualApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/individuals/edit'; + protected const ENDPOINT = '/individuals/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Individuals/IndexIndividualsApiTest.php b/tests/TestCase/Api/Individuals/IndexIndividualsApiTest.php index 29da85f..e5c92ce 100644 --- a/tests/TestCase/Api/Individuals/IndexIndividualsApiTest.php +++ b/tests/TestCase/Api/Individuals/IndexIndividualsApiTest.php @@ -13,7 +13,7 @@ class IndexIndividualsApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/individuals/index'; + protected const ENDPOINT = '/individuals/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Individuals/ViewIndividualApiTest.php b/tests/TestCase/Api/Individuals/ViewIndividualApiTest.php index 8589f1f..d4b94d9 100644 --- a/tests/TestCase/Api/Individuals/ViewIndividualApiTest.php +++ b/tests/TestCase/Api/Individuals/ViewIndividualApiTest.php @@ -13,7 +13,7 @@ class ViewIndividualApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/individuals/view'; + protected const ENDPOINT = '/individuals/view'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Organisations/AddOrganisationApiTest.php b/tests/TestCase/Api/Organisations/AddOrganisationApiTest.php index bde14a0..5a47554 100644 --- a/tests/TestCase/Api/Organisations/AddOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/AddOrganisationApiTest.php @@ -12,7 +12,7 @@ class AddOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/add'; + protected const ENDPOINT = '/organisations/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Organisations/DeleteOrganisationApiTest.php b/tests/TestCase/Api/Organisations/DeleteOrganisationApiTest.php index 9e3ae3c..efdaa5c 100644 --- a/tests/TestCase/Api/Organisations/DeleteOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/DeleteOrganisationApiTest.php @@ -14,7 +14,7 @@ class DeleteOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/delete'; + protected const ENDPOINT = '/organisations/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Organisations/EditOrganisationApiTest.php b/tests/TestCase/Api/Organisations/EditOrganisationApiTest.php index 4587808..6d14f3c 100644 --- a/tests/TestCase/Api/Organisations/EditOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/EditOrganisationApiTest.php @@ -13,7 +13,7 @@ class EditOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/edit'; + protected const ENDPOINT = '/organisations/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Organisations/IndexOrganisationsApiTest.php b/tests/TestCase/Api/Organisations/IndexOrganisationsApiTest.php index 23a68c9..a22e0f4 100644 --- a/tests/TestCase/Api/Organisations/IndexOrganisationsApiTest.php +++ b/tests/TestCase/Api/Organisations/IndexOrganisationsApiTest.php @@ -13,7 +13,7 @@ class IndexOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/index'; + protected const ENDPOINT = '/organisations/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Organisations/TagOrganisationApiTest.php b/tests/TestCase/Api/Organisations/TagOrganisationApiTest.php index d22f31a..f8bd194 100644 --- a/tests/TestCase/Api/Organisations/TagOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/TagOrganisationApiTest.php @@ -14,7 +14,7 @@ class TagOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/tag'; + protected const ENDPOINT = '/organisations/tag'; protected $fixtures = [ 'app.TagsTags', diff --git a/tests/TestCase/Api/Organisations/UntagOrganisationApiTest.php b/tests/TestCase/Api/Organisations/UntagOrganisationApiTest.php index 6cbb55d..59f1bea 100644 --- a/tests/TestCase/Api/Organisations/UntagOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/UntagOrganisationApiTest.php @@ -14,7 +14,7 @@ class UntagOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/untag'; + protected const ENDPOINT = '/organisations/untag'; protected $fixtures = [ 'app.TagsTags', diff --git a/tests/TestCase/Api/Organisations/ViewOrganisationApiTest.php b/tests/TestCase/Api/Organisations/ViewOrganisationApiTest.php index 5e51698..a9a728b 100644 --- a/tests/TestCase/Api/Organisations/ViewOrganisationApiTest.php +++ b/tests/TestCase/Api/Organisations/ViewOrganisationApiTest.php @@ -13,7 +13,7 @@ class ViewOrganisationApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/organisations/view'; + protected const ENDPOINT = '/organisations/view'; protected $fixtures = [ 'app.TagsTags', diff --git a/tests/TestCase/Api/SharingGroups/AddSharingGroupApiTest.php b/tests/TestCase/Api/SharingGroups/AddSharingGroupApiTest.php index 2843687..cbfebbb 100644 --- a/tests/TestCase/Api/SharingGroups/AddSharingGroupApiTest.php +++ b/tests/TestCase/Api/SharingGroups/AddSharingGroupApiTest.php @@ -14,7 +14,7 @@ class AddSharingGroupApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/sharingGroups/add'; + protected const ENDPOINT = '/sharingGroups/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/SharingGroups/DeleteSharingGroupApiTest.php b/tests/TestCase/Api/SharingGroups/DeleteSharingGroupApiTest.php index b9d4a0c..e2d1dc5 100644 --- a/tests/TestCase/Api/SharingGroups/DeleteSharingGroupApiTest.php +++ b/tests/TestCase/Api/SharingGroups/DeleteSharingGroupApiTest.php @@ -13,7 +13,7 @@ class DeleteSharingGroupApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/sharingGroups/delete'; + protected const ENDPOINT = '/sharingGroups/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/SharingGroups/EditSharingGroupApiTest.php b/tests/TestCase/Api/SharingGroups/EditSharingGroupApiTest.php index 9f861e8..07dff5b 100644 --- a/tests/TestCase/Api/SharingGroups/EditSharingGroupApiTest.php +++ b/tests/TestCase/Api/SharingGroups/EditSharingGroupApiTest.php @@ -13,7 +13,7 @@ class EditSharingGroupApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/sharingGroups/edit'; + protected const ENDPOINT = '/sharingGroups/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/SharingGroups/IndexSharingGroupsApiTest.php b/tests/TestCase/Api/SharingGroups/IndexSharingGroupsApiTest.php index 2cbded2..5286af2 100644 --- a/tests/TestCase/Api/SharingGroups/IndexSharingGroupsApiTest.php +++ b/tests/TestCase/Api/SharingGroups/IndexSharingGroupsApiTest.php @@ -13,7 +13,7 @@ class IndexSharingGroupsApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/sharingGroups/index'; + protected const ENDPOINT = '/sharingGroups/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/SharingGroups/ViewSharingGroupApiTest.php b/tests/TestCase/Api/SharingGroups/ViewSharingGroupApiTest.php index 0bbfbf5..06ceb93 100644 --- a/tests/TestCase/Api/SharingGroups/ViewSharingGroupApiTest.php +++ b/tests/TestCase/Api/SharingGroups/ViewSharingGroupApiTest.php @@ -13,7 +13,7 @@ class ViewSharingGroupApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/sharingGroups/view'; + protected const ENDPOINT = '/sharingGroups/view'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Tags/IndexTagsApiTest.php b/tests/TestCase/Api/Tags/IndexTagsApiTest.php index 962750f..4b13b67 100644 --- a/tests/TestCase/Api/Tags/IndexTagsApiTest.php +++ b/tests/TestCase/Api/Tags/IndexTagsApiTest.php @@ -12,7 +12,7 @@ class IndexTagsApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/tags/index'; + protected const ENDPOINT = '/tags/index'; protected $fixtures = [ 'app.TagsTags', diff --git a/tests/TestCase/Api/Users/AddUserApiTest.php b/tests/TestCase/Api/Users/AddUserApiTest.php index 6741b9b..3437d29 100644 --- a/tests/TestCase/Api/Users/AddUserApiTest.php +++ b/tests/TestCase/Api/Users/AddUserApiTest.php @@ -15,7 +15,7 @@ class AddUserApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/add'; + protected const ENDPOINT = '/users/add'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Users/ChangePasswordApiTest.php b/tests/TestCase/Api/Users/ChangePasswordApiTest.php index 8dcd517..201cb74 100644 --- a/tests/TestCase/Api/Users/ChangePasswordApiTest.php +++ b/tests/TestCase/Api/Users/ChangePasswordApiTest.php @@ -17,7 +17,7 @@ class ChangePasswordApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/edit'; + protected const ENDPOINT = '/users/edit'; /** @var \Cake\Auth\FormAuthenticate */ protected $auth; diff --git a/tests/TestCase/Api/Users/DeleteUserApiTest.php b/tests/TestCase/Api/Users/DeleteUserApiTest.php index 4e99963..9288b9a 100644 --- a/tests/TestCase/Api/Users/DeleteUserApiTest.php +++ b/tests/TestCase/Api/Users/DeleteUserApiTest.php @@ -13,7 +13,7 @@ class DeleteUserApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/delete'; + protected const ENDPOINT = '/users/delete'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Users/EditUserApiTest.php b/tests/TestCase/Api/Users/EditUserApiTest.php index 93a0df8..dd685b9 100644 --- a/tests/TestCase/Api/Users/EditUserApiTest.php +++ b/tests/TestCase/Api/Users/EditUserApiTest.php @@ -14,7 +14,7 @@ class EditUserApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/edit'; + protected const ENDPOINT = '/users/edit'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Users/IndexUsersApiTest.php b/tests/TestCase/Api/Users/IndexUsersApiTest.php index 7303224..c30462b 100644 --- a/tests/TestCase/Api/Users/IndexUsersApiTest.php +++ b/tests/TestCase/Api/Users/IndexUsersApiTest.php @@ -13,7 +13,7 @@ class IndexUsersApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/index'; + protected const ENDPOINT = '/users/index'; protected $fixtures = [ 'app.Organisations', diff --git a/tests/TestCase/Api/Users/ViewUserApiTest.php b/tests/TestCase/Api/Users/ViewUserApiTest.php index 576f2f8..e3ab847 100644 --- a/tests/TestCase/Api/Users/ViewUserApiTest.php +++ b/tests/TestCase/Api/Users/ViewUserApiTest.php @@ -13,7 +13,7 @@ class ViewUserApiTest extends TestCase { use ApiTestTrait; - protected const ENDPOINT = '/api/v1/users/view'; + protected const ENDPOINT = '/users/view'; protected $fixtures = [ 'app.Organisations', diff --git a/webroot/docs/openapi.yaml b/webroot/docs/openapi.yaml index b584bfc..8077ce7 100644 --- a/webroot/docs/openapi.yaml +++ b/webroot/docs/openapi.yaml @@ -29,7 +29,7 @@ tags: description: "Authkeys are used for API access. A user can have more than one authkey, so if you would like to use separate keys per tool that queries Cerebrate, add additional keys. Use the comment field to make identifying your keys easier." paths: - /api/v1/individuals/index: + /individuals/index: get: summary: "Get individuals list" operationId: getIndividuals @@ -47,7 +47,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/individuals/view/{individualId}: + /individuals/view/{individualId}: get: summary: "Get individual by ID" operationId: getIndividualById @@ -65,7 +65,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/individuals/add: + /individuals/add: post: summary: "Add individual" operationId: addIndividual @@ -83,7 +83,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/individuals/edit/{individualId}: + /individuals/edit/{individualId}: put: summary: "Edit individual" operationId: editIndividual @@ -103,7 +103,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/individuals/delete/{individualId}: + /individuals/delete/{individualId}: delete: summary: "Delete individual by ID" operationId: deleteIndividualById @@ -121,7 +121,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/index: + /users/index: get: summary: "Get users list" operationId: getUsers @@ -139,7 +139,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/view: + /users/view: get: summary: "Get information about the current user" operationId: viewUserMe @@ -155,7 +155,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/view/{userId}: + /users/view/{userId}: get: summary: "Get information of a user by ID" operationId: viewUserById @@ -173,7 +173,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/add: + /users/add: post: summary: "Add user" operationId: addUser @@ -191,7 +191,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/edit: + /users/edit: put: summary: "Edit current user" operationId: editUser @@ -209,7 +209,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/edit/{userId}: + /users/edit/{userId}: put: summary: "Edit current user" operationId: editUserById @@ -229,7 +229,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/users/delete/{userId}: + /users/delete/{userId}: delete: summary: "Delete user by ID" operationId: deleteUserById @@ -247,7 +247,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/add: + /organisations/add: post: summary: "Add organisation" operationId: addOrganisation @@ -265,7 +265,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/edit/{organisationId}: + /organisations/edit/{organisationId}: put: summary: "Edit organisation" operationId: editOrganisation @@ -285,7 +285,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/index: + /organisations/index: get: summary: "Get organisations" operationId: getOrganisations @@ -303,7 +303,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/view/{organisationId}: + /organisations/view/{organisationId}: get: summary: "View organisation by ID" operationId: getOrganisationById @@ -321,7 +321,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/delete/{organisationId}: + /organisations/delete/{organisationId}: delete: summary: "Delete organisation by ID" operationId: deleteOrganisationById @@ -339,7 +339,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/tag/{organisationId}: + /organisations/tag/{organisationId}: post: summary: "Tag organisation by ID" operationId: tagOrganisationById @@ -359,7 +359,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/organisations/untag/{organisationId}: + /organisations/untag/{organisationId}: post: summary: "Remove organisation tag by ID" operationId: untagOrganisationById @@ -379,7 +379,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/tags/index: + /tags/index: get: summary: "Get tags list" operationId: getTags @@ -397,7 +397,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/inbox/index: + /inbox/index: get: summary: "Get inbox list" operationId: getinbox @@ -415,7 +415,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/inbox/createEntry/User/Registration: + /inbox/createEntry/User/Registration: post: summary: "Create user registration inbox entry" operationId: createInboxEntry @@ -433,7 +433,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/sharingGroups/index: + /sharingGroups/index: get: summary: "Get a sharing groups list" operationId: getSharingGroups @@ -451,7 +451,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/sharingGroups/add: + /sharingGroups/add: post: summary: "Add sharing group" operationId: addSharingGroup @@ -469,7 +469,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/sharingGroups/view/{sharingGroupId}: + /sharingGroups/view/{sharingGroupId}: get: summary: "Get sharing group by ID" operationId: getSharingGroupById @@ -487,7 +487,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/sharingGroups/delete/{sharingGroupId}: + /sharingGroups/delete/{sharingGroupId}: delete: summary: "Delete sharing group by ID" operationId: deleteSharingGroupById @@ -505,7 +505,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/sharingGroups/edit/{sharingGroupId}: + /sharingGroups/edit/{sharingGroupId}: put: summary: "Edit sharing group" operationId: editSharingGroup @@ -525,7 +525,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/index: + /broods/index: get: summary: "Get broods list" operationId: getBroods @@ -543,7 +543,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/view/{broodId}: + /broods/view/{broodId}: get: summary: "Get brood by ID" operationId: getBroodById @@ -561,7 +561,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/add: + /broods/add: post: summary: "Add brood" operationId: addBrood @@ -579,7 +579,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/edit/{broodId}: + /broods/edit/{broodId}: put: summary: "Edit brood" operationId: editBrood @@ -599,7 +599,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/delete/{broodId}: + /broods/delete/{broodId}: delete: summary: "Delete brood by ID" operationId: deleteBroodById @@ -617,7 +617,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/broods/testConnection/{broodId}: + /broods/testConnection/{broodId}: get: summary: "Test brood connection by ID" operationId: testBroodConnectionById @@ -636,7 +636,7 @@ paths: $ref: "#/components/responses/ApiErrorResponse" # EncryptionKeys - /api/v1/encryptionKeys/index: + /encryptionKeys/index: get: summary: "Get encryption keys list" operationId: getEncryptionKeys @@ -654,7 +654,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/encryptionKeys/view/{encryptionKeyId}: + /encryptionKeys/view/{encryptionKeyId}: get: summary: "Get encryption key by ID" operationId: getEncryptionKeyId @@ -672,7 +672,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/encryptionKeys/add: + /encryptionKeys/add: post: summary: "Add encryption key" operationId: addEncryptionKey @@ -690,7 +690,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/encryptionKeys/edit/{encryptionKeyId}: + /encryptionKeys/edit/{encryptionKeyId}: put: summary: "Edit encryption key" operationId: editEncryptionKey @@ -710,7 +710,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/encryptionKeys/delete/{encryptionKeyId}: + /encryptionKeys/delete/{encryptionKeyId}: delete: summary: "Delete encryption key by ID" operationId: deleteEncryptionKeyById @@ -729,7 +729,7 @@ paths: $ref: "#/components/responses/ApiErrorResponse" # AuthKeys - /api/v1/authKeys/index: + /authKeys/index: get: summary: "Get auth keys list" operationId: getAuthKeys @@ -747,7 +747,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/authKeys/add: + /authKeys/add: post: summary: "Add auth keys" operationId: addAuthKey @@ -765,7 +765,7 @@ paths: default: $ref: "#/components/responses/ApiErrorResponse" - /api/v1/authKeys/delete/{authKeyId}: + /authKeys/delete/{authKeyId}: delete: summary: "Delete auth key by ID" operationId: deleteAuthKeyById @@ -1374,7 +1374,7 @@ components: type: string url: type: string - example: "/api/v1/users" + example: "/users" code: type: integer example: 500 @@ -1391,7 +1391,7 @@ components: example: "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header." url: type: string - example: "/api/v1/users" + example: "/users" code: type: integer example: 403 @@ -1408,7 +1408,7 @@ components: example: "You do not have permission to use this functionality." url: type: string - example: "/api/v1/users/index" + example: "/users/index" code: type: integer example: 405 @@ -1425,7 +1425,7 @@ components: example: "Invalid user" url: type: string - example: "/api/v1/users/users/view/1234" + example: "/users/users/view/1234" code: type: integer example: 404