Skip to content

Commit

Permalink
Merge pull request #4111 from LibreSign/chore/bump-dependencies
Browse files Browse the repository at this point in the history
chore: bump dependencies
  • Loading branch information
vitormattos authored Dec 9, 2024
2 parents 1da49de + cb5c04d commit 128cf57
Show file tree
Hide file tree
Showing 15 changed files with 260 additions and 251 deletions.
55 changes: 33 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/Api/ApiTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ApiTestCase extends TestCase {
public function setUp(): void {
parent::setUp();
$data = json_decode(file_get_contents('openapi-full.json'), true);
$data['servers'][] = ['url' => '/ocs/v2.php/ocsapp/apps/libresign/api/v1'];
$data['servers'][] = ['url' => '/ocs/v2.php/ocsapp/apps/libresign'];
$data = $this->removeBasePath($data);
/** @var OpenApiSchema */
$schema = \ByJG\ApiTools\Base\Schema::getInstance($data);
Expand All @@ -61,7 +61,7 @@ public function setUp(): void {
private function removeBasePath(array $data): array {
$cleaned = [];
foreach ($data['paths'] as $key => $value) {
$key = preg_replace('~^' . '/ocs/v2.php/apps/libresign/api/{apiVersion}' . '~', '', $key);
$key = preg_replace('~^/ocs/v2.php/apps/libresign~', '', $key);
$cleaned[$key] = $value;
}
$data['paths'] = $cleaned;
Expand Down
14 changes: 7 additions & 7 deletions tests/Api/Controller/AccountControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testAccountCreateWithInvalidUuid():void {
'password' => 'secret',
'signPassword' => 'secretToSign'
])
->withPath('/account/create/1234564789')
->withPath('/api/v1/account/create/1234564789')
->assertResponseCode(422);

$response = $this->assertRequest();
Expand Down Expand Up @@ -84,7 +84,7 @@ public function testAccountCreateWithSuccess():void {
'password' => 'secret',
'signPassword' => 'secretToSign'
])
->withPath('/account/create/' . $signers[0]->getUuid());
->withPath('/api/v1/account/create/' . $signers[0]->getUuid());
$this->markUserExists('[email protected]');

$this->assertRequest();
Expand Down Expand Up @@ -112,7 +112,7 @@ public function testPostProfileFilesWithInvalidData():void {
]
]
])
->withPath('/account/files')
->withPath('/api/v1/account/files')
->assertResponseCode(401);

$this->assertRequest();
Expand Down Expand Up @@ -140,7 +140,7 @@ public function testPostAccountAddFilesWithSuccess():void {
]
]
])
->withPath('/account/files');
->withPath('/api/v1/account/files');

$this->assertRequest();
}
Expand All @@ -150,7 +150,7 @@ public function testPostAccountAddFilesWithSuccess():void {
*/
public function testMeWithoutAuthenticatedUser():void {
$this->request
->withPath('/account/me')
->withPath('/api/v1/account/me')
->assertResponseCode(404);

$this->assertRequest();
Expand All @@ -162,7 +162,7 @@ public function testMeWithoutAuthenticatedUser():void {
public function testMeWithAuthenticatedUser():void {
$this->createAccount('username', 'password');
$this->request
->withPath('/account/me')
->withPath('/api/v1/account/me')
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password')
]);
Expand All @@ -181,7 +181,7 @@ public function testApprovalListWithSuccess():void {
]);

$this->request
->withPath('/account/files/approval/list')
->withPath('/api/v1/account/files/approval/list')
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('allowapprove:password')
]);
Expand Down
6 changes: 3 additions & 3 deletions tests/Api/Controller/AdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testLoadCertificate():void {
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('admintest:password')
])
->withPath('/admin/certificate');
->withPath('/api/v1/admin/certificate');

$this->assertRequest();
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testGenerateCertificateWithSuccess():void {
'Authorization' => 'Basic ' . base64_encode('admintest:password'),
'Content-Type' => 'application/json'
])
->withPath('/admin/certificate/cfssl')
->withPath('/api/v1/admin/certificate/cfssl')
->withRequestBody($cfsslConfig);

// Make and test request mach with schema
Expand Down Expand Up @@ -103,7 +103,7 @@ public function testGenerateCertificateWithFailure():void {
'Authorization' => 'Basic ' . base64_encode('admintest:password'),
'Content-Type' => 'application/json'
])
->withPath('/admin/certificate/openssl')
->withPath('/api/v1/admin/certificate/openssl')
->withRequestBody([
'rootCert' => [
'commonName' => 'CommonName',
Expand Down
12 changes: 6 additions & 6 deletions tests/Api/Controller/FileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testValidateUsignUuidWithInvalidData():void {
$this->mockAppConfig([]);

$this->request
->withPath('/file/validate/uuid/invalid')
->withPath('/api/v1/file/validate/uuid/invalid')
->assertResponseCode(404);

$response = $this->assertRequest();
Expand All @@ -35,7 +35,7 @@ public function testValidateUsignUuidWithInvalidData():void {
*/
public function testValidateUsignFileIdWithInvalidData():void {
$this->request
->withPath('/file/validate/file_id/171')
->withPath('/api/v1/file/validate/file_id/171')
->assertResponseCode(404);

$response = $this->assertRequest();
Expand Down Expand Up @@ -64,7 +64,7 @@ public function testValidateWithSuccessUsingUnloggedUser():void {
]);

$this->request
->withPath('/file/validate/uuid/' . $file->getUuid());
->withPath('/api/v1/file/validate/uuid/' . $file->getUuid());

$response = $this->assertRequest();
$body = json_decode($response->getBody()->getContents(), true);
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testValidateWithSuccessUsingSigner():void {
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password')
])
->withPath('/file/validate/uuid/' . $file->getUuid());
->withPath('/api/v1/file/validate/uuid/' . $file->getUuid());

$response = $this->assertRequest();
$body = json_decode($response->getBody()->getContents(), true);
Expand All @@ -124,7 +124,7 @@ public function testControllerListWithEmptyData():void {
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password')
])
->withPath('/file/list');
->withPath('/api/v1/file/list');

$response = $this->assertRequest();
$body = json_decode($response->getBody()->getContents(), true);
Expand All @@ -144,7 +144,7 @@ public function testSendNewFile():void {
'Authorization' => 'Basic ' . base64_encode('allowrequestsign:password'),
'Content-Type' => 'application/json',
])
->withPath('/file')
->withPath('/api/v1/file')
->withMethod('POST')
->withRequestBody([
'name' => 'test',
Expand Down
6 changes: 3 additions & 3 deletions tests/Api/Controller/FileElementControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testPostSuccess():array {

$this->mockAppConfig([]);
$this->request
->withPath('/file-element/' . $file->getUuid())
->withPath('/api/v1/file-element/' . $file->getUuid())
->withMethod('POST')
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password'),
Expand Down Expand Up @@ -72,7 +72,7 @@ public function testPatchSuccess($params):array {
extract($params);
$signers = $this->getSignersFromFileId($file->getId());
$this->request
->withPath('/file-element/' . $file->getUuid() . '/' . $fileElementId)
->withPath('/api/v1/file-element/' . $file->getUuid() . '/' . $fileElementId)
->withMethod('PATCH')
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password'),
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testDeleteSuccess($params):void {
$this->createAccount('username', 'password');
extract($params);
$this->request
->withPath('/file-element/' . $file->getUuid() . '/' . $fileElementId)
->withPath('/api/v1/file-element/' . $file->getUuid() . '/' . $fileElementId)
->withMethod('DELETE')
->withRequestHeader([
'Authorization' => 'Basic ' . base64_encode('username:password'),
Expand Down
4 changes: 2 additions & 2 deletions tests/Api/Controller/NotifyControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testNotifySignersWithError():void {
]
]
])
->withPath('/notify/signers')
->withPath('/api/v1/notify/signers')
->assertResponseCode(401);

$this->assertRequest();
Expand Down Expand Up @@ -74,7 +74,7 @@ public function testNotifySignersWithSuccess():void {
]
]
])
->withPath('/notify/signers');
->withPath('/api/v1/notify/signers');

$this->assertRequest();
}
Expand Down
Loading

0 comments on commit 128cf57

Please sign in to comment.