Skip to content

Commit ca458e6

Browse files
committed
Merge branch 'feature/PB-37053_Merge-release-into-master' into 'master'
PB-37053 Merge release into master (v4.10.1) See merge request passbolt/passbolt-ce-api!318
2 parents 34336f1 + cfc7827 commit ca458e6

File tree

9 files changed

+147
-124
lines changed

9 files changed

+147
-124
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
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.10.1] - 2024-11-26
6+
### Fixed
7+
- PB-37010 Fix v5 resource types should not be returned if v5 flag is disabled
8+
- PB-37011 Fix session keys creation modified date validation to match ISO 8601 format
9+
10+
## [4.10.1-test.1] - 2024-11-25
11+
### Fixed
12+
- PB-37010 Fix v5 resource types should not be returned if v5 flag is disabled
13+
- PB-37011 Fix session keys creation modified date validation to match ISO 8601 format
14+
515
## [4.10.0] - 2024-11-20
616
### Added
717
- PB-34458 Add v5 config flag PASSBOLT_V5_ENABLED

RELEASE_NOTES.md

+6-117
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,10 @@
1-
Release song: https://www.youtube.com/watch?v=2YdC0GshApE
1+
Release song: https://youtu.be/649wWWkW_1o?si=rSKbGFqR8irz0OOG
22

3-
Passbolt v4.10.0 is a maintenance update that prepares for the upcoming v5 release, introducing beta support for the v5 resource type format within the v4 user interface and addressing reported issues.
3+
Passbolt is pleased to announce the immediate availability of version v4.10.1. This version notably fixes critical issue introduce in v4.10.0 where mobile applications was not showing any passwords after the passbolt API update.
44

5-
This release is particularly valuable for maintainers of clients or integrations, offering an early preview of the v5 resource type format to aid in planning for future adaptations. While previous content types will remain supported until version 6, the new content types expand functionality, empowering technical teams to manage a broader range of credentials. Stay tuned—a blog article will be released soon to explain how to enable v5 support and begin testing your integrations.
6-
7-
Thank you to our community for your continued support.
8-
9-
## [4.10.0] - 2024-11-20
10-
### Added
11-
- PB-34458 Add v5 config flag PASSBOLT_V5_ENABLED
12-
- PB-34459 Add metadata plugin
13-
- PB-34450 Update resources table with metadata fields
14-
- PB-34455 Update comments table with data field
15-
- PB-34452 Update folders table with metadata fields
16-
- PB-34454 Create metadata_private_keys table
17-
- PB-34453 Create metadata_session_keys table
18-
- PB-34456 Create metadata_keys table
19-
- PB-34446 Add new resource_types entries for v5 resource types
20-
- PB-34448 Update resource_types table to add deleted field
21-
- PB-34472 Add GET/POST /metadata/settings.json endpoints
22-
- PB-34465 Add MetadataPrivateKey entity
23-
- PB-34466 Add MetadataPrivateKeysTable table
24-
- PB-34460 Add MetadataKey entity
25-
- PB-34462 Add MetadataKeysTable table
26-
- PB-34461 As a logged-in user the settings.json provides information on the metadata plugin
27-
- PB-34464 Cache key info in public key validation service for a single request
28-
- PB-34467 Add POST /metadata/keys.json endpoint
29-
- PB-34471 Add GET /metadata/keys endpoint
30-
- PB-35259 Update support for created_by and modified_by for metadata keys
31-
- PB-35163 Update DELETE /groups/<uuid>.json to support v5 resource format
32-
- PB-35162 Update DELETE /users/<uuid>.json endpoint to clean up metadata private & session keys
33-
- PB-35119 Add setup complete controller test (v5 key sharing)
34-
- PB-35119 Start integration of user setup complete with v5 requirements
35-
- PB-35122 Add support for v5 create, update resource entities
36-
- PB-35152 Add DELETE /metadata/session-keys/<uuid>.json endpoint
37-
- PB-35151 Add POST /metadata/session-keys.json endpoint
38-
- PB-35150 Add GET /metadata/session-keys.json endpoint
39-
- PB-34611 Add DELETE/PUT /resource-types/<uuid>.json endpoint
40-
- PB-35365 Update POST /share/folders/<uuid>.json to support v5 logic
41-
- PB-35363 Update GET /folders/<uuid>.json to support v5 format
42-
- PB-35363 Update GET /folders.json to support v5 format
43-
- PB-35921 Add API endpoint PUT /metadata/session-keys/<uuid>.json
44-
- PB-35368 As a developer I can run a command to create metadata private key & share it with all users
45-
- PB-35362 Update PUT /folders/<uuid>.json to support v5 format
46-
- PB-35361 Update POST /folders.json to support v5 format
47-
- PB-35120 Add healthcheck to try to decrypt the server metadata private key entry for the shared key
48-
- PB-35165 Update POST /share/resources/<uuid>.json to support v5 logic
49-
- PB-35166 Update email notification template to not include metadata (name, uri, etc.)
50-
- PB-35166 Update POST /share/simulate/resources/<uuid>.json to support v5 logic
51-
- PB-35157 Email changes for resources changes for V5
52-
- PB-35157 Add validation for metadata fields
53-
- PB-35160 Update GET /resources.json endpoint to support v5 format
54-
- PB-35275 Add edit and create individual metadata private key endpoints
55-
- PB-35171 Create a Service and CLI task to migrate v4 to v5 resources
56-
- PB-35272 Add server settings to prevent edition of metadata settings and key
57-
- PB-35260 Add signature verification for metadata private key sharing service
58-
- PB-35277 As an administrator I must receive an email notification when a metadata key is added
59-
- PB-35276 As an administrator I must receive an email notification when the metadata settings are updated
60-
- PB-35751 As an administrators I can update the metadata settings using command line
61-
- PB-35748 As an administrator I can run a command to migrate all the items to v5 format
62-
- PB-35747 As an administrator I can run a command to migrate the folders to v5 format
63-
- PB-35756 Update resource create endpoint to throw an error if allow_usage_of_personal_keys is set to false and personal key is used
64-
- PB-35758 Update folders create/update endpoints to throw an error if allow_usage_of_personal_keys is set to false and personal key is used
65-
- PB-35928 Add allow_v5_v4_downgrade to metadata types settings
66-
- PB-35945 Add static method to cache and reuse MetadataTypesSettingsGetService results
67-
- PB-35946 Add static method to cache and reuse MetadataKeysSettingsGetService results
68-
- PB-35930 Update edit resource to support allow_v5_v4_downgrade settings
69-
- PB-35931 Update edit folders to support allow_v5_v4_downgrade settings
70-
- PB-35937 Add allow_v5_v4_downgrade settings to passbolt update_metadata_types_settings command
71-
- PB-35084 Add the distribution/gpg information in the health-check
72-
- PB-35866 Add OperatingSystemHealthcheck for 32 vs 64 bit
73-
- PB-36228 ResourceCreateController should populate empty metadata_key_id if key type is user_key
74-
- PB-36280 Add created_by and modified_by to metadata keys index service
75-
- PB-34080 As an admin running the passbolt cleanup, I should delete duplicate resources_tags entries
76-
- PB-36516 Add populatedMetadataUserKeyId request data massaging to folder create and update
77-
- PB-36515 Add populatedMetadataUserKeyId request data massaging to resource edit
78-
- PB-36558 Add baseline support for metadata key expiry
79-
- PB-35085 Add TimeSyncHealthcheck for system clock sync status
80-
- PB-36574 As a user I can delete a metadata key that is expired and not in use
81-
82-
### Improved
83-
- PB-34609 Adds is-deleted filter and resources_count contain to ResourceTypesIndexController.php
84-
85-
### Security
86-
- PB-35882 Bump cakephp/twig-view to 1.3.1 to get rid of twig security vulnerability warning
87-
- PB-36609 Bump twig/twig composer package to v3.11.2
88-
- PB-36609 Bump symfony/process composer package to v5.4.46
5+
We would like to express our appreciation to the community for raising the issue. Thank you for support & understanding.
896

7+
## [4.10.1] - 2024-11-26
908
### Fixed
91-
- PB-34189 Fix 500 on GET resources.json when passing 1 as parameter to some filters
92-
- PB-35173 As a logged-in user I should not get a 500 if the folder does not exist
93-
- PB-34481 Fix 500 error on /mfa/verify/{provider}.json on account with no 2FA set up
94-
- PB-35669 Fix GenerateOpenPGPKeyService should default to GNUPGHOME environment variable if set
95-
- PB-35724 Fix GenerateOpenPGPKeyService should generate key with empty passphrase
96-
- PB-35709 Fix theme back to default randomly after refresh or navigation
97-
- PB-35849 Fix API app does not update "Last logged in" time
98-
- PB-35980 Fix has-parent filter returning duplicate resources (GITHUB #523)
99-
- PB-36208 Fix LogFolderWritableHealthcheck help text paths
100-
101-
### Maintenance
102-
- PB-34399 Bump singpolyma/openpgp-php package to v0.7
103-
- PB-34305 Upgrade lockfile-lint library on passbolt_api package-lock.json
104-
- PB-34306 Upgrade openpgp library on passbolt_api package-lock.json
105-
- PB-33333 Refactor GroupUpdateControllerTest to use Fixture Factories
106-
- PB-33332 Refactor ResourcesDeleteControllerTest to use Fixture Factories
107-
- PB-33332 Refactor ResourcesUpdateControllerTest to use Fixture Factories
108-
- PB-33332 Refactor ResourcesViewControllerTest to use Fixture Factories
109-
- PB-33332 Refactor resource index controller test
110-
- PB-22603 Refactor resources share service test with factories
111-
- PB-33331 Add missing test cases for RecoverCompleteService
112-
- PB-35433 Fix phpcs config to allow per file fixing in IDE
113-
- PB-33330 Add missing test cases for SetupCompleteService
114-
- PB-33329 Add missing test cases for RecoverAbortService
115-
- PB-35777 Remove cloaking !empty() around method calls
116-
- PB-35856 Fix up editorconfig for composer.json editing
117-
- PB-35918 Bump composer/composer package to 2.8.1
118-
- PB-34234 CI changes to use downstream repo
119-
- PB-36605 Fix testVersionCommand_Compare_With_ChangeLogs failing test
120-
- PB-35763 Refactor resource tags add controller
121-
- PB-36607 Bump cakephp/cakephp composer package version to 4.5.7
9+
- PB-37010 Fix v5 resource types should not be returned if v5 flag is disabled
10+
- PB-37011 Fix session keys creation modified date validation to match ISO 8601 format
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
declare(strict_types=1);
3+
/**
4+
* Passbolt ~ Open source password manager for teams
5+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
6+
*
7+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
8+
* For full copyright and license information, please see the LICENSE.txt
9+
* Redistributions of files must retain the above copyright notice.
10+
*
11+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
12+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
13+
* @link https://www.passbolt.com Passbolt(tm)
14+
* @since 4.10.0
15+
*/
16+
// @codingStandardsIgnoreStart
17+
use App\Utility\UuidFactory;
18+
use Cake\I18n\FrozenTime;
19+
use Migrations\AbstractMigration;
20+
use Passbolt\ResourceTypes\Model\Entity\ResourceType;
21+
22+
class V4101ReAddV5ResourceTypes extends AbstractMigration
23+
{
24+
/**
25+
* Up Method.
26+
*
27+
* @link https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
28+
* @return void
29+
*/
30+
public function up(): void
31+
{
32+
$data = [
33+
'v5-password-string' => [
34+
'id' => UuidFactory::uuid('resource-types.id.v5-password-string'),
35+
'slug' => ResourceType::SLUG_V5_PASSWORD_STRING,
36+
'name' => 'Simple Password (Deprecated)',
37+
'description' => 'The original passbolt resource type, kept for backward compatibility reasons.',
38+
'definition' => json_encode([]),
39+
'created' => (new FrozenTime())->toDateTimeString(),
40+
'modified' => (new FrozenTime())->toDateTimeString(),
41+
],
42+
'v5-default' => [
43+
'id' => UuidFactory::uuid('resource-types.id.v5-default'),
44+
'slug' => ResourceType::SLUG_V5_DEFAULT,
45+
'name' => 'Default resource type',
46+
'description' => 'The new default resource type introduced with v5.',
47+
'definition' => json_encode([]),
48+
'created' => (new FrozenTime())->toDateTimeString(),
49+
'modified' => (new FrozenTime())->toDateTimeString(),
50+
],
51+
'v5-totp-standalone' => [
52+
'id' => UuidFactory::uuid('resource-types.id.v5-totp-standalone'),
53+
'slug' => ResourceType::SLUG_V5_TOTP_STANDALONE,
54+
'name' => 'Standalone TOTP',
55+
'description' => 'The new standalone TOTP resource type introduced with v5.',
56+
'definition' => json_encode([]),
57+
'created' => (new FrozenTime())->toDateTimeString(),
58+
'modified' => (new FrozenTime())->toDateTimeString(),
59+
],
60+
'v5-default-with-totp' => [
61+
'id' => UuidFactory::uuid('resource-types.id.v5-default-with-totp'),
62+
'slug' => ResourceType::SLUG_V5_DEFAULT_WITH_TOTP,
63+
'name' => 'Default resource type with TOTP',
64+
'description' => 'The new default resource type with a TOTP introduced with v5.',
65+
'definition' => json_encode([]),
66+
'created' => (new FrozenTime())->toDateTimeString(),
67+
'modified' => (new FrozenTime())->toDateTimeString(),
68+
],
69+
];
70+
71+
$stmt = $this->query("SELECT slug FROM resource_types WHERE slug IN ('v5-password-string', 'v5-default', 'v5-totp-standalone', 'v5-default-with-totp')");
72+
$rows = $stmt->fetchAll();
73+
foreach ($rows as $row) {
74+
// Do not insert if already present
75+
if ($row['slug'] === 'v5-password-string') {
76+
unset($data['v5-password-string']);
77+
} elseif ($row['slug'] === 'v5-default') {
78+
unset($data['v5-default']);
79+
} elseif ($row['slug'] === 'v5-totp-standalone') {
80+
unset($data['v5-totp-standalone']);
81+
} elseif ($row['slug'] === 'v5-default-with-totp') {
82+
unset($data['v5-default-with-totp']);
83+
}
84+
}
85+
86+
if (!empty($data)) {
87+
$resourceTypesTable = $this->table('resource_types');
88+
$resourceTypesTable->insert($data)->saveData();
89+
}
90+
}
91+
}
92+
// @codingStandardsIgnoreEnd

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.10.0',
5-
'name' => 'Baianá',
4+
'version' => '4.10.1',
5+
'name' => 'Strange Fruit',
66
],
77
'php' => [
88
'minVersion' => '7.4',

plugins/PassboltCe/Metadata/src/Form/MetadataSessionKeyUpdateForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use App\Model\Validation\ArmoredMessage\IsParsableMessageValidationRule;
2020
use Cake\Form\Form;
2121
use Cake\Form\Schema;
22+
use Cake\Validation\Validation;
2223
use Cake\Validation\Validator;
2324

2425
class MetadataSessionKeyUpdateForm extends Form
@@ -51,7 +52,7 @@ public function validationDefault(Validator $validator): Validator
5152
->add('data', 'isValidOpenPGPMessage', new IsParsableMessageValidationRule());
5253

5354
$validator
54-
->dateTime('modified', ['ymd'], __('The modified date should be a valid date.'))
55+
->dateTime('modified', [Validation::DATETIME_ISO8601], __('The modified date should be a valid ISO 80601 date.')) // phpcs:ignore;
5556
->requirePresence('modified', 'create', __('A modified date is required.'))
5657
->notEmptyDateTime('modified', __('The modified date should not be empty.'));
5758

plugins/PassboltCe/Metadata/tests/TestCase/Controller/MetadataSessionKeyUpdateControllerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @since 4.10.0
1616
*/
1717

18-
namespace Passbolt\Metadata\TestCase\Controller;
18+
namespace Passbolt\Metadata\Test\TestCase\Controller;
1919

2020
use App\Service\OpenPGP\OpenPGPCommonUserOperationsTrait;
2121
use App\Test\Factory\GpgkeyFactory;

plugins/PassboltCe/Metadata/tests/TestCase/Form/MetadataSessionKeyUpdateFormTest.php

+15-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @since 4.10.0
1616
*/
1717

18-
namespace Passbolt\Metadata\TestCase\Form;
18+
namespace Passbolt\Metadata\Test\TestCase\Form;
1919

2020
use Cake\TestSuite\TestCase;
2121
use Passbolt\Metadata\Form\MetadataSessionKeyUpdateForm;
@@ -58,10 +58,22 @@ public function testMetadataSessionKeyUpdateForm_Error_Empty(): void
5858
$this->assertTrue(isset($errors['data']['_empty']));
5959
}
6060

61-
public function testMetadataSessionKeyUpdateForm_Error_DataNotValidDateTime(): void
61+
public function metadataSessionKeyUpdateFormInvalidModifiedDateTimeProvider()
62+
{
63+
return [
64+
['🔥'],
65+
['20140619'],
66+
['2014-05-19'],
67+
];
68+
}
69+
70+
/**
71+
* @dataProvider metadataSessionKeyUpdateFormInvalidModifiedDateTimeProvider
72+
*/
73+
public function testMetadataSessionKeyUpdateForm_Error_DataNotValidDateTime(string $modified): void
6274
{
6375
$data = $this->getDefaultData();
64-
$data['modified'] = '🔥';
76+
$data['modified'] = $modified;
6577
$this->assertFalse($this->form->execute($data));
6678
$errors = $this->form->getErrors();
6779
$this->assertTrue(isset($errors['modified']['dateTime']));

plugins/PassboltCe/ResourceTypes/src/Controller/ResourceTypesIndexController.php

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use App\Controller\AppController;
2121
use App\Utility\Application\FeaturePluginAwareTrait;
2222
use Cake\Core\Configure;
23+
use Passbolt\ResourceTypes\Model\Entity\ResourceType;
2324
use Passbolt\ResourceTypes\Service\ResourceTypesFinderInterface;
2425

2526
class ResourceTypesIndexController extends AppController
@@ -46,6 +47,8 @@ public function index(ResourceTypesFinderInterface $resourceTypesFinder)
4647
if ($this->User->isAdmin()) {
4748
$resourceTypesFinder->contain($resourceTypes, $options);
4849
}
50+
} else {
51+
$resourceTypes = $resourceTypes->where(['slug NOT IN' => ResourceType::V5_RESOURCE_TYPE_SLUGS]);
4952
}
5053

5154
$this->success(__('The operation was successful.'), $resourceTypes->all());

plugins/PassboltCe/ResourceTypes/tests/TestCase/Controller/ResourceTypesIndexControllerTest.php

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

2020
use App\Test\Factory\ResourceFactory;
2121
use App\Test\Lib\AppIntegrationTestCaseV5;
22+
use Cake\Core\Configure;
2223
use Passbolt\ResourceTypes\ResourceTypesPlugin;
2324
use Passbolt\ResourceTypes\Test\Factory\ResourceTypeFactory;
2425
use Passbolt\ResourceTypes\Test\Lib\Model\ResourceTypesModelTrait;
@@ -106,4 +107,19 @@ public function testResourceTypesIndexController__Contain_Resources_Count_Non_Bo
106107
$this->getJson('/resource-types.json?contain[resources_count]=foo');
107108
$this->assertBadRequestError('Invalid contain. "foo" is not a valid contain value.');
108109
}
110+
111+
public function testResourceTypesIndexController_Success_v4DoesntReturnV5Types()
112+
{
113+
$v5Setting = Configure::read('passbolt.v5.enabled');
114+
Configure::write('passbolt.v5.enabled', false);
115+
116+
ResourceTypeFactory::make()->v5PasswordString()->persist();
117+
118+
$this->logInAsUser();
119+
$this->getJson('/resource-types.json');
120+
$this->assertSuccess();
121+
$this->assertCount(0, $this->_responseJsonBody);
122+
123+
Configure::write('passbolt.v5.enabled', $v5Setting);
124+
}
109125
}

0 commit comments

Comments
 (0)