Skip to content

Commit 57e2150

Browse files
committed
Merge branch 'release' into 'master'
v4.9.1 See merge request passbolt/passbolt-ce-api!305
2 parents 8cb699d + 80f8f1a commit 57e2150

File tree

61 files changed

+1690
-393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1690
-393
lines changed

.github/workflows/release.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
build:
1010
name: Create release
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214
steps:
13-
- uses: actions/checkout@v3
14-
- env:
15-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
16-
name: Create Release
15+
- uses: actions/checkout@v4
16+
- name: Create Release
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1719
run: gh release create "${GITHUB_REF#refs/*/}" -t "$(grep name config/version.php | awk -F "'" '{print $4}')" --notes-file RELEASE_NOTES.md

.github/workflows/release_candidate.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
build:
1010
name: Create release candidate
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214
steps:
13-
- uses: actions/checkout@v3
14-
- env:
15-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
16-
name: Create Release candidate
15+
- uses: actions/checkout@v4
16+
- name: Create Release candidate
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1719
run: gh release create "${GITHUB_REF#refs/*/}" -t "$(grep name config/version.php | awk -F "'" '{print $4}')" -p --notes-file RELEASE_NOTES.md

.gitlab-ci/jobs/php_unit_tests/sequential/php_unit_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ seq-php8.0-mariadb8.0:
263263
# - if: '$TEST_DISABLED == null && $CI_COMMIT_BRANCH == "master"'
264264
# - if: '$TEST_DISABLED == null && $CI_COMMIT_BRANCH == "develop"'
265265

266-
seq-php8.3-mysql8:
266+
seq-php8.3-mariadb10.5:
267267
variables:
268268
PHP_VERSION: "8.3"
269-
DATABASE_ENGINE_VERSION: "${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mysql:8.0"
269+
DATABASE_ENGINE_VERSION: "${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mariadb:10.5"
270270
extends:
271271
- .mysql-template
272272
- .test-template

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.9.1] - 2024-08-13
6+
### Fixed
7+
- PB-34220 As a user I can search by users and groups case insensitively on PostgreSQL
8+
9+
### Improved
10+
- PB-34246 As an administrator purging the action logs table, I can set a limit option (100k per default)
11+
- PB-34247 Adds a set of actions to be purged by the passbolt action_logs_purge command
12+
- PB-33939 As an administrator when running bin/cake passbolt -h, I should see all the passbolt commands listed
13+
14+
### Maintenance
15+
- PB-32991 Optimizes CI pipeline run time on api repositories
16+
- PB-34219 Adds validation to retention days option in the action_logs_purge command
17+
- PB-33333 Refactor various tests to use fixture factories
18+
19+
## [4.9.1-test.1] - 2024-08-12
20+
### Fixed
21+
- PB-34220 As a user I can search by users and groups case insensitively on PostgreSQL
22+
23+
### Improved
24+
- PB-34246 As an administrator purging the action logs table, I can set a limit option (100k per default)
25+
- PB-34247 Adds a set of actions to be purged by the passbolt action_logs_purge command
26+
- PB-33939 As an administrator when running bin/cake passbolt -h, I should see all the passbolt commands listed
27+
28+
### Maintenance
29+
- PB-32991 Optimizes CI pipeline run time on api repositories
30+
- PB-34219 Adds validation to retention days option in the action_logs_purge command
31+
- PB-33333 Refactor various tests to use fixture factories
32+
533
## [4.9.0] - 2024-07-23
634
### Added
735
- PB-33690 Improves response times by adding an index to gpgkeys.user_id column

RELEASE_NOTES.md

+16-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
1-
Release song: https://youtu.be/zUzd9KyIDrM?si=bPS9Qu1t351eZEHH
1+
Release song: https://www.youtube.com/watch?v=W8PTWqE2SVw
22

3-
Passbolt v4.9.0 is a significant update that addresses long-standing user requests and enhances performance. In this release, a highly requested feature was introduced where the passwords workspace now displays the location of resources. This addition provides extra meta information to help users efficiently identify passwords and where they are located. Additionally, the search functionality has been improved to use resource locations as meta information. Users can now retrieve a resource by using the names of its parent folders, which can greatly simplify the process of finding passwords depending on your organisation's classification system.
3+
Passbolt is pleased to announce the immediate availability of version v4.9.1.
44

5-
The team has also focused on various performance improvements to meet the growing needs of organisations managing an increasing number of passwords. These enhancements also prepare the way for the upcoming v5.0.0, which will support more content types and include an additional encryption layer. Both the API and the browser extension have been optimised, resulting in a 50% improvement in retrieving and treating collections of resources, according to our benchmarks.
5+
Passbolt v4.9.1 is a maintenance update that fixes issues reported by the community.
6+
Among other fixes, this version addresses a compatibility issue with the PostgreSQL database, where users encountered
7+
difficulties sharing passwords with users or groups when different cases were involved in their names.
68

7-
## [4.9.0] - 2024-07-23
8-
### Added
9-
- PB-33690 Improves response times by adding an index to gpgkeys.user_id column
10-
- PB-33639 Adds additional contain parameters to share/search-aros.json for enhanced performance
11-
- PB-33936 Adds a has-users filter to gpgkeys.json index endpoint
12-
- PB-33813 Adds a fixed limit to the search-aros.json endpoint
9+
Additionally, system administrator tools have been improved to better handle the purge of action logs on large datasets.
1310

11+
We would like to express our appreciation to the community for their assistance in improving Passbolt!
12+
13+
## [4.9.1] - 2024-08-13
1414
### Fixed
15-
- PB-33616 As a user creating a resource I should get a validation error if the secret is a string and not an array
16-
- PB-33664 Fix missing "is" in the database schema up to date sentence (GITHUB #517)
15+
- PB-34220 As a user I can search by users and groups case insensitively on PostgreSQL
1716

1817
### Improved
19-
- PB-33429 As a user I should retrieve resources and folders parent folders in a single query
20-
- PB-33826 Improves the performance of resources.json by improving the datetime fields processing
21-
- PB-24995 Improves last_logged_in property query performance to reduce response time of users.json endpoint
22-
- PB-33653 Improves is_mfa_enabled property query performance to reduce response time of users.json endpoint
23-
- PB-33702 Improves has-access filter performance on users.json
24-
- PB-32591 Validate passbolt.plugins.smtpSettings.security configuration values before passing it to SMTP server
25-
- PB-33214 Update sql export / improve mysql backup command compatibility with mariadb-dump
18+
- PB-34246 As an administrator purging the action logs table, I can set a limit option (100k per default)
19+
- PB-34247 Adds a set of actions to be purged by the passbolt action_logs_purge command
20+
- PB-33939 As an administrator when running bin/cake passbolt -h, I should see all the passbolt commands listed
2621

2722
### Maintenance
28-
- PB-33692 Bump enygma/yubikey to v3.8
29-
30-
### Security
31-
- PB-33747 Fix command injections vulnerabilities in composer/composer package
23+
- PB-32991 Optimizes CI pipeline run time on api repositories
24+
- PB-34219 Adds validation to retention days option in the action_logs_purge command
25+
- PB-33333 Refactor various tests to use fixture factories

config/version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
return [
33
'passbolt' => [
4-
'version' => '4.9.0',
5-
'name' => 'B.Y.O.B.',
4+
'version' => '4.9.1',
5+
'name' => 'Rebelion',
66
],
77
'php' => [
88
'minVersion' => '7.4',

plugins/PassboltCe/EmailDigest/src/Command/PreviewCommand.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,21 @@ class PreviewCommand extends PassboltCommand
3333
*/
3434
public const EMAIL_SEPARATOR = '------------------------';
3535

36+
/**
37+
* @inheritDoc
38+
*/
39+
public static function getCommandDescription(): string
40+
{
41+
return __('Preview a batch of queued emails as emails digests.');
42+
}
43+
3644
/**
3745
* @inheritDoc
3846
*/
3947
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
4048
{
49+
$parser = parent::buildOptionParser($parser);
4150
$parser
42-
->setDescription(__('Preview a batch of queued emails as emails digests.'))
4351
->addOption('limit', [
4452
'short' => 'l',
4553
'help' => __('How many emails should be in this batch?'),

plugins/PassboltCe/EmailDigest/src/Command/SenderCommand.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,21 @@
2727

2828
class SenderCommand extends PassboltCommand
2929
{
30+
/**
31+
* @inheritDoc
32+
*/
33+
public static function getCommandDescription(): string
34+
{
35+
return __('Sends a batch of queued emails as emails digests.');
36+
}
37+
3038
/**
3139
* @inheritDoc
3240
*/
3341
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
3442
{
43+
$parser = parent::buildOptionParser($parser);
3544
$parser
36-
->setDescription(__('Sends a batch of queued emails as emails digests.'))
3745
->addOption('limit', [
3846
'short' => 'l',
3947
'help' => __('How many emails should be sent in this batch?'),

plugins/PassboltCe/Folders/src/Model/Traits/Folders/FoldersFindersTrait.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
use App\Model\Table\AvatarsTable;
2121
use App\Model\Table\PermissionsTable;
22+
use App\Model\Traits\Query\CaseInsensitiveSearchQueryTrait;
2223
use Cake\Database\Expression\IdentifierExpression;
2324
use Cake\ORM\Query;
2425
use Cake\Validation\Validation;
@@ -34,6 +35,8 @@
3435
*/
3536
trait FoldersFindersTrait
3637
{
38+
use CaseInsensitiveSearchQueryTrait;
39+
3740
/**
3841
* Build the query that fetches data for folders index
3942
*
@@ -206,17 +209,16 @@ public function filterByIds(Query $query, array $folderIds)
206209
* $query = $Folders->find();
207210
* $Groups->_filterQueryBySearch($query, 'creative');
208211
*
209-
* Should filter all the groups with a name containing creative.
212+
* Should filter all the folders with a name containing creative.
213+
* Search should be case-insensitive
210214
*
211215
* @param \Cake\ORM\Query $query Query to filter
212216
* @param string $name Name to filter
213217
* @return \Cake\ORM\Query
214218
*/
215-
public function filterQueryBySearch(Query $query, string $name)
219+
public function filterQueryBySearch(Query $query, string $name): Query
216220
{
217-
return $query->where([
218-
['Folders.name LIKE' => '%' . $name . '%'],
219-
]);
221+
return $this->searchCaseInsensitiveOnField($query, 'Folders.name', $name);
220222
}
221223

222224
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Passbolt ~ Open source password manager for teams
6+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
7+
*
8+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
9+
* For full copyright and license information, please see the LICENSE.txt
10+
* Redistributions of files must retain the above copyright notice.
11+
*
12+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
13+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
14+
* @link https://www.passbolt.com Passbolt(tm)
15+
* @since 4.9.1
16+
*/
17+
18+
namespace Passbolt\Folders\Test\TestCase\Controller\Folders;
19+
20+
use Passbolt\Folders\Test\Factory\FolderFactory;
21+
use Passbolt\Folders\Test\Lib\FoldersIntegrationTestCase;
22+
23+
/**
24+
* @uses \Passbolt\Folders\Controller\Folders\FoldersIndexController
25+
*/
26+
class FoldersIndexControllerFactoriesTest extends FoldersIntegrationTestCase
27+
{
28+
public function testFoldersIndexController_FilterBySearchSuccess()
29+
{
30+
$user = $this->logInAsUser();
31+
FolderFactory::make(['foo', 'FOO', 'bar'])->withPermissionsFor([$user])->persist();
32+
33+
$this->getJson('/folders.json?filter[search]=O');
34+
$this->assertSuccess();
35+
$this->assertEquals(2, count($this->_responseJsonBody));
36+
$this->assertNotContains('bar', $this->_responseJsonBody);
37+
38+
$this->getJson('/folders.json?filter[search]=o');
39+
$this->assertSuccess();
40+
$this->assertEquals(2, count($this->_responseJsonBody));
41+
$this->assertNotContains('bar', $this->_responseJsonBody);
42+
}
43+
}

plugins/PassboltCe/Folders/tests/TestCase/Controller/Folders/FoldersIndexControllerTest.php

-52
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use App\Test\Lib\Model\GroupsUsersModelTrait;
3333
use App\Test\Lib\Model\PermissionsModelTrait;
3434
use App\Utility\UuidFactory;
35-
use Cake\Core\Configure;
3635
use Cake\Utility\Hash;
3736
use Passbolt\Folders\Test\Lib\FoldersIntegrationTestCase;
3837
use Passbolt\Folders\Test\Lib\Model\FoldersModelTrait;
@@ -63,57 +62,6 @@ class FoldersIndexControllerTest extends FoldersIntegrationTestCase
6362
GroupsFixture::class,
6463
];
6564

66-
public function setUp(): void
67-
{
68-
parent::setUp();
69-
Configure::write('passbolt.plugins.folders', ['enabled' => true]);
70-
}
71-
72-
private function insertFixtureCase1()
73-
{
74-
// Ada has access to folder Lovelace and Something as a OWNER
75-
// Lovelace (Ada:O) Something (Ada:O)
76-
$userId = UuidFactory::uuid('user.id.ada');
77-
$folderA = $this->addFolderFor(['name' => 'Lovelace'], [$userId => Permission::OWNER]);
78-
$this->addFolderFor(['name' => 'Something', 'folder_parent_id' => $folderA->id], [$userId => Permission::OWNER]);
79-
}
80-
81-
/**
82-
* @return void
83-
*/
84-
public function testFoldersIndexFilterBySearchSuccess()
85-
{
86-
$this->insertFixtureCase1();
87-
88-
$this->authenticateAs('ada');
89-
90-
$this->getJson('/folders.json?api-version=2&filter[search]=Love');
91-
$this->assertSuccess();
92-
$this->assertEquals(count($this->_responseJsonBody), 1);
93-
$this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace');
94-
$this->assertNotContains('Something', $this->_responseJsonBody);
95-
96-
$this->getJson('/folders.json?api-version=2&filter[search]=ovela');
97-
$this->assertSuccess();
98-
$this->assertEquals(count($this->_responseJsonBody), 1);
99-
$this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace');
100-
$this->assertNotContains('Something', $this->_responseJsonBody);
101-
102-
$this->getJson('/folders.json?api-version=2&filter[search]=ace');
103-
$this->assertSuccess();
104-
$this->assertEquals(count($this->_responseJsonBody), 1);
105-
$this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace');
106-
$this->assertNotContains('Something', $this->_responseJsonBody);
107-
108-
$this->getJson('/folders.json?api-version=2&filter[search]=Lovelace');
109-
$this->assertSuccess();
110-
$this->assertEquals(count($this->_responseJsonBody), 1);
111-
$this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace');
112-
$this->assertNotContains('Something', $this->_responseJsonBody);
113-
114-
$this->assertSuccess();
115-
}
116-
11765
private function insertFixtureCase2()
11866
{
11967
// Ada has access to folder Lovelace and Something as a OWNER

plugins/PassboltCe/Folders/tests/TestCase/Model/Table/Folders/FoldersTableTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public function testFindIndex_FilterBySearch()
265265
'SpecialName', // Ending Partial Match,
266266
'Folder', // Starting Partial Match,
267267
'WithSpecial', // Middle Partial Match
268+
'folderwithspecialname', // Lower case
268269
];
269270

270271
foreach ($matchingNames as $matchingName) {

plugins/PassboltCe/JwtAuthentication/src/Command/CreateAccessTokenCommand.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,21 @@ public function initialize(): void
4444
$this->Users = $this->fetchTable('Users');
4545
}
4646

47+
/**
48+
* @inheritDoc
49+
*/
50+
public static function getCommandDescription(): string
51+
{
52+
return __('Create a JSON Web Token.');
53+
}
54+
4755
/**
4856
* @inheritDoc
4957
*/
5058
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
5159
{
60+
$parser = parent::buildOptionParser($parser);
5261
$parser
53-
->setDescription(__('Create a JSON Web Token.'))
5462
->addOption('username', [
5563
'help' => 'The username to create a user for.',
5664
'short' => 'u',

plugins/PassboltCe/JwtAuthentication/src/Command/CreateJwtKeysCommand.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@
2525

2626
class CreateJwtKeysCommand extends PassboltCommand
2727
{
28+
/**
29+
* @inheritDoc
30+
*/
31+
public static function getCommandDescription(): string
32+
{
33+
return __('Create a JWT key pair.');
34+
}
35+
2836
/**
2937
* @inheritDoc
3038
*/
3139
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
3240
{
41+
$parser = parent::buildOptionParser($parser);
42+
3343
$parser
34-
->setDescription(__('Create a JWT key pair.'))
3544
->addOption('force', [
3645
'help' => 'Override the key files if found.',
3746
'default' => 'false',

0 commit comments

Comments
 (0)