Skip to content

Commit

Permalink
Merge remote-tracking branch 'pro/common' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanvyas22 committed Jan 29, 2024
2 parents 4ca0553 + 9c09484 commit 8091d7a
Show file tree
Hide file tree
Showing 245 changed files with 11,419 additions and 1,760 deletions.
11 changes: 10 additions & 1 deletion .gitlab-ci/jobs/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
stage: unit-test
variables:
PHP_VERSION: "7.4"
COMPOSER_ALLOW_SUPERUSER: 1
image: $CI_REGISTRY_IMAGE_TEST:$PHP_VERSION
allow_failure: false
script:
- composer config --global process-timeout 2000
- composer install --dev --no-interaction
- composer install --no-interaction
- composer validate --check-lock --no-check-publish
- composer cs-check
- composer stan
- composer psalm
Expand All @@ -20,3 +22,10 @@ static-analysis:
when: on_success
- if: '$TEST_DISABLED == null && $CI_COMMIT_BRANCH != "master"'
when: on_success

static-analysis-js:
stage: unit-test
image: node:18
script:
- npm ci
- npm run lint
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
; always amends --ignore-scripts on npm installs
ignore-scripts=true
; do not tag on npm version
git-tag-version=false
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Prerequisite
Make sure you have the developement dependencies install.
```
composer install --dev
composer install
```

## How do I run the unit tests
Expand Down
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ module.exports = function(grunt) {
'third_party/sendgrid.svg',
'third_party/sendinblue.svg',
'third_party/zoho.svg',
'third_party/outlook.svg',
'third_party/office365.svg',

// Setup
'illustrations/email.png',
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@
"cakephp/bake": "^2.3.0",
"phpunit/phpunit": "~9.5.2",
"cakephp/cakephp-codesniffer": "^4.5",
"passbolt/passbolt-selenium-api": "^4.2",
"passbolt/passbolt-selenium-api": "^4.5",
"passbolt/passbolt-test-data": "^4.4",
"vierge-noire/cakephp-fixture-factories": "^v2.9.0",
"cakephp/localized": "4.0.0",
"vimeo/psalm": "^5.0.0",
"cakedc/cakephp-phpstan": "^2.0"
"cakedc/cakephp-phpstan": "^2.0",
"johnkary/phpunit-speedtrap": "^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -128,6 +129,7 @@
"Passbolt\\JwtAuthentication\\": "./plugins/PassboltCe/JwtAuthentication/src",
"Passbolt\\Import\\": "./plugins/PassboltCe/Import/src",
"Passbolt\\Export\\": "./plugins/PassboltCe/Export/src",
"Passbolt\\PasswordExpiry\\": "./plugins/PassboltCe/PasswordExpiry/src",
"Passbolt\\ResourceTypes\\": "./plugins/PassboltCe/ResourceTypes/src",
"Passbolt\\SmtpSettings\\": "./plugins/PassboltCe/SmtpSettings/src",
"Passbolt\\MultiFactorAuthentication\\": "./plugins/PassboltCe/MultiFactorAuthentication/src",
Expand All @@ -153,6 +155,7 @@
"Passbolt\\Mobile\\Test\\": "./plugins/PassboltCe/Mobile/tests",
"Passbolt\\JwtAuthentication\\Test\\": "./plugins/PassboltCe/JwtAuthentication/tests",
"Passbolt\\MultiFactorAuthentication\\Test\\": "./plugins/PassboltCe/MultiFactorAuthentication/tests",
"Passbolt\\PasswordExpiry\\Test\\": "./plugins/PassboltCe/PasswordExpiry/tests",
"Passbolt\\SmtpSettings\\Test\\": "./plugins/PassboltCe/SmtpSettings/tests",
"Passbolt\\SelfRegistration\\Test\\": "./plugins/PassboltCe/SelfRegistration/tests",
"Passbolt\\ResourceTypes\\Test\\": "./plugins/PassboltCe/ResourceTypes/tests",
Expand All @@ -171,7 +174,7 @@
"cs-check": "phpcs -d memory_limit=512M --colors -p --ignore=*.js,*/templates/* ./src ./tests ./plugins",
"cs-fix": "phpcbf -d memory_limit=512M --colors --ignore=*.js,*/templates/* ./src ./tests ./plugins",
"install-dev": [
"@composer install --dev",
"@composer install",
"npm install",
"./node_modules/.bin/grunt appjs-update",
"./node_modules/.bin/grunt styleguide-update"
Expand Down
78 changes: 65 additions & 13 deletions composer.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function up()
// This line is required for Postgres support.
$this->getAdapter()->commitTransaction();

(new AvatarsTransferService($AvatarsTable, $FileStorageTable))->transfer();
try {
(new AvatarsTransferService($AvatarsTable, $FileStorageTable))->transfer();
} catch (\Throwable $e) {
Log::error('There was an error in V320TransferFileStorageToAvatars');
Log::error($e->getMessage());
}
}

public function down()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);

/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
* @since 4.5.0
*/
use Migrations\AbstractMigration;

class V450AddExpiredDateFieldToResources extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$this
->table('resources')
->addColumn('expired', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
'after' => 'deleted'
])
->save();
}
}
20 changes: 17 additions & 3 deletions config/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
'share' => filter_var(env('PASSBOLT_EMAIL_SEND_PASSWORD_SHARE', true), FILTER_VALIDATE_BOOLEAN),
'update' => filter_var(env('PASSBOLT_EMAIL_SEND_PASSWORD_UPDATE', true), FILTER_VALIDATE_BOOLEAN),
'delete' => filter_var(env('PASSBOLT_EMAIL_SEND_PASSWORD_DELETE', true), FILTER_VALIDATE_BOOLEAN),
'expire' => filter_var(env('PASSBOLT_EMAIL_SEND_PASSWORD_EXPIRE', true), FILTER_VALIDATE_BOOLEAN),
],
'user' => [
// WARNING: disabling PASSBOLT_EMAIL_SEND_USER_CREATE and PASSBOLT_EMAIL_SEND_USER_RECOVER will prevent user from signing up.
Expand Down Expand Up @@ -153,7 +154,8 @@
'manager' => [
// Notify managers when group membership changes.
'update' => filter_var(env('PASSBOLT_EMAIL_SEND_GROUP_MANAGER_UPDATE', true), FILTER_VALIDATE_BOOLEAN),
]
'requestAddUser' => filter_var(env('PASSBOLT_EMAIL_SEND_GROUP_MANAGER_REQUEST_ADD_USER', true), FILTER_VALIDATE_BOOLEAN),
],
],
'folder' => [
'create' => filter_var(env('PASSBOLT_EMAIL_SEND_FOLDER_CREATE', false), FILTER_VALIDATE_BOOLEAN),
Expand Down Expand Up @@ -242,6 +244,9 @@
'previewPassword' => [
'enabled' => filter_var(env('PASSBOLT_PLUGINS_PREVIEW_PASSWORD_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
],
'passwordExpiry' => [
'enabled' => filter_var(env('PASSBOLT_PLUGINS_PASSWORD_EXPIRY_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
],
'resourceTypes' => [
'enabled' => filter_var(env('PASSBOLT_PLUGINS_RESOURCE_TYPES_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
],
Expand All @@ -252,7 +257,7 @@
'enabled' => filter_var(env('PASSBOLT_PLUGINS_MOBILE_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
],
'desktop' => [
'enabled' => filter_var(env('PASSBOLT_PLUGINS_DESKTOP_ENABLED', false), FILTER_VALIDATE_BOOLEAN)
'enabled' => filter_var(env('PASSBOLT_PLUGINS_DESKTOP_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
],
'jwtAuthentication' => [
'enabled' => filter_var(env('PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED', true), FILTER_VALIDATE_BOOLEAN)
Expand Down Expand Up @@ -338,6 +343,12 @@
// This is disabled by default as it prevents legitimate users to know whether their accounts was disabled
// as well as prevent open registration to work
'preventEmailEnumeration' => filter_var(env('PASSBOLT_SECURITY_PREVENT_EMAIL_ENUMERATION', false), FILTER_VALIDATE_BOOLEAN),
'email' => [
'anonymiseAdministratorIdentity' => filter_var(
env('PASSBOLT_SECURITY_EMAIL_ANONYMISE_ADMINISTRATOR_IDENTITY', false),
FILTER_VALIDATE_BOOLEAN
),
],
],

// Should the app be SSL / HTTPS only.
Expand All @@ -353,5 +364,8 @@
// Override the Cake ExceptionRenderer.
'Error' => [
'exceptionRenderer' => 'App\Error\AppExceptionRenderer',
]
'skipLog' => [
'Authentication\Authenticator\UnauthenticatedException',
],
],
];
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
return [
'passbolt' => [
'version' => '4.4.2',
'name' => 'Is It Because I\'m Black?',
'name' => 'Is It Because I\'m Black',
],
'php' => [
'minVersion' => '7.4',
Expand Down
1 change: 1 addition & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export_languages:
- pl
- pt-BR
- ro
- ru
- sv
commit_message: '[skip-ci]'
Loading

0 comments on commit 8091d7a

Please sign in to comment.