Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 216 additions & 0 deletions .betterleaks-history-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
[
{
"RuleID": "secret-literal-assignment",
"Description": "Secret-like literal assignment in source, YAML, env and config files",
"StartLine": 8,
"EndLine": 8,
"StartColumn": 3,
"EndColumn": 20,
"Match": "password = 'REDACTED'",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "valentinab25",
"git.author_name": "valentinab25",
"git.date": "2021-05-25T17:18:22Z",
"git.message": "Cypress coverage",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "d274f575bc425483bcf1bb84e1762bdf22462ec1",
"path": "cypress/support/commands.js",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/d274f575bc425483bcf1bb84e1762bdf22462ec1/cypress/support/commands.js#L8"
},
"Tags": [
"literal-secret",
"literal-secret"
],
"Fingerprint": "d274f575bc425483bcf1bb84e1762bdf22462ec1:cypress/support/commands.js:secret-literal-assignment:8",
"File": "cypress/support/commands.js",
"SymlinkFile": "",
"Commit": "d274f575bc425483bcf1bb84e1762bdf22462ec1",
"Entropy": 2.321928,
"Author": "valentinab25",
"Email": "valentinab25",
"Date": "2021-05-25T17:18:22Z",
"Message": "Cypress coverage"
},
{
"RuleID": "secret-literal-assignment",
"Description": "Secret-like literal assignment in source, YAML, env and config files",
"StartLine": 15,
"EndLine": 15,
"StartColumn": 28,
"EndColumn": 46,
"Match": "password: REDACTED",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "valentinab25",
"git.author_name": "valentinab25",
"git.date": "2021-05-25T17:18:22Z",
"git.message": "Cypress coverage",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "d274f575bc425483bcf1bb84e1762bdf22462ec1",
"path": "cypress/support/commands.js",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/d274f575bc425483bcf1bb84e1762bdf22462ec1/cypress/support/commands.js#L15"
},
"Tags": [
"literal-secret",
"literal-secret"
],
"Fingerprint": "d274f575bc425483bcf1bb84e1762bdf22462ec1:cypress/support/commands.js:secret-literal-assignment:15",
"File": "cypress/support/commands.js",
"SymlinkFile": "",
"Commit": "d274f575bc425483bcf1bb84e1762bdf22462ec1",
"Entropy": 2.947703,
"Author": "valentinab25",
"Email": "valentinab25",
"Date": "2021-05-25T17:18:22Z",
"Message": "Cypress coverage"
},
{
"RuleID": "secret-literal-assignment",
"Description": "Secret-like literal assignment in source, YAML, env and config files",
"StartLine": 8,
"EndLine": 8,
"StartColumn": 3,
"EndColumn": 20,
"Match": "password = 'REDACTED'",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "alin.voinea@eaudeweb.ro",
"git.author_name": "Alin Voinea",
"git.date": "2021-06-04T14:07:58Z",
"git.message": "Cypress coverage (#8)\n\n* Cypress coverage\n\n* Automated release 2.2.2\n\nCo-authored-by: valentinab25 \u003cvalentinab25\u003e\nCo-authored-by: EEA Jenkins \u003c@users.noreply.github.com\u003e",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "883e419076e90ec9b21cfb31961c01310f2ad68a",
"path": "cypress/support/commands.js",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/883e419076e90ec9b21cfb31961c01310f2ad68a/cypress/support/commands.js#L8"
},
"Tags": [
"literal-secret",
"literal-secret"
],
"Fingerprint": "883e419076e90ec9b21cfb31961c01310f2ad68a:cypress/support/commands.js:secret-literal-assignment:8",
"File": "cypress/support/commands.js",
"SymlinkFile": "",
"Commit": "883e419076e90ec9b21cfb31961c01310f2ad68a",
"Entropy": 2.321928,
"Author": "Alin Voinea",
"Email": "alin.voinea@eaudeweb.ro",
"Date": "2021-06-04T14:07:58Z",
"Message": "Cypress coverage (#8)\n\n* Cypress coverage\n\n* Automated release 2.2.2\n\nCo-authored-by: valentinab25 \u003cvalentinab25\u003e\nCo-authored-by: EEA Jenkins \u003c@users.noreply.github.com\u003e"
},
{
"RuleID": "secret-literal-assignment",
"Description": "Secret-like literal assignment in source, YAML, env and config files",
"StartLine": 15,
"EndLine": 15,
"StartColumn": 28,
"EndColumn": 46,
"Match": "password: REDACTED",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "alin.voinea@eaudeweb.ro",
"git.author_name": "Alin Voinea",
"git.date": "2021-06-04T14:07:58Z",
"git.message": "Cypress coverage (#8)\n\n* Cypress coverage\n\n* Automated release 2.2.2\n\nCo-authored-by: valentinab25 \u003cvalentinab25\u003e\nCo-authored-by: EEA Jenkins \u003c@users.noreply.github.com\u003e",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "883e419076e90ec9b21cfb31961c01310f2ad68a",
"path": "cypress/support/commands.js",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/883e419076e90ec9b21cfb31961c01310f2ad68a/cypress/support/commands.js#L15"
},
"Tags": [
"literal-secret",
"literal-secret"
],
"Fingerprint": "883e419076e90ec9b21cfb31961c01310f2ad68a:cypress/support/commands.js:secret-literal-assignment:15",
"File": "cypress/support/commands.js",
"SymlinkFile": "",
"Commit": "883e419076e90ec9b21cfb31961c01310f2ad68a",
"Entropy": 2.947703,
"Author": "Alin Voinea",
"Email": "alin.voinea@eaudeweb.ro",
"Date": "2021-06-04T14:07:58Z",
"Message": "Cypress coverage (#8)\n\n* Cypress coverage\n\n* Automated release 2.2.2\n\nCo-authored-by: valentinab25 \u003cvalentinab25\u003e\nCo-authored-by: EEA Jenkins \u003c@users.noreply.github.com\u003e"
},
{
"RuleID": "env-short-secret-assignment",
"Description": "Uppercase env-style PASS/TOKEN/SECRET assignment",
"StartLine": 36,
"EndLine": 36,
"StartColumn": 11,
"EndColumn": 49,
"Match": "GITHUB_TOKEN=REDACTED",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "miu.razvan28@gmail.com",
"git.author_name": "Miu Razvan",
"git.date": "2022-10-25T10:29:27Z",
"git.message": "Use latest cypress + bring add-on up to date",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "f1c4c50797ea25365d4bc28839f5bb10013ad423",
"path": "RELEASE.md",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/f1c4c50797ea25365d4bc28839f5bb10013ad423/RELEASE.md?plain=1#L36"
},
"Tags": [
"env",
"literal-secret",
"env",
"literal-secret"
],
"Fingerprint": "f1c4c50797ea25365d4bc28839f5bb10013ad423:RELEASE.md:env-short-secret-assignment:36",
"File": "RELEASE.md",
"SymlinkFile": "",
"Commit": "f1c4c50797ea25365d4bc28839f5bb10013ad423",
"Entropy": 0.23519339,
"Author": "Miu Razvan",
"Email": "miu.razvan28@gmail.com",
"Date": "2022-10-25T10:29:27Z",
"Message": "Use latest cypress + bring add-on up to date"
},
{
"RuleID": "env-short-secret-assignment",
"Description": "Uppercase env-style PASS/TOKEN/SECRET assignment",
"StartLine": 235,
"EndLine": 235,
"StartColumn": 11,
"EndColumn": 49,
"Match": "GITHUB_TOKEN=REDACTED",
"Secret": "REDACTED",
"Attributes": {
"git.author_email": "valentinab25",
"git.author_name": "valentinab25",
"git.date": "2021-12-16T17:01:46Z",
"git.message": "[JENKINS] Refs #142742 - Add release documentation",
"git.platform": "github",
"git.remote_url": "https://github.com/eea/volto-object-widget",
"git.sha": "9e888e25f098d4d1e556472eb1d1d85419050466",
"path": "README.md",
"resource": "git.patch_content",
"url": "https://github.com/eea/volto-object-widget/blob/9e888e25f098d4d1e556472eb1d1d85419050466/README.md?plain=1#L235"
},
"Tags": [
"env",
"literal-secret",
"env",
"literal-secret"
],
"Fingerprint": "9e888e25f098d4d1e556472eb1d1d85419050466:README.md:env-short-secret-assignment:235",
"File": "README.md",
"SymlinkFile": "",
"Commit": "9e888e25f098d4d1e556472eb1d1d85419050466",
"Entropy": 0.23519339,
"Author": "valentinab25",
"Email": "valentinab25",
"Date": "2021-12-16T17:01:46Z",
"Message": "[JENKINS] Refs #142742 - Add release documentation"
}
]
7 changes: 7 additions & 0 deletions .cookieplone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Object Widget",
"frontend_addon_name": "volto-object-widget",
"description": "volto-object-widget: Volto add-on",
"volto_version": "19.3.0",
"__template__": "frontend_addon"
}
30 changes: 24 additions & 6 deletions .coverage.babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
const defaultBabel = require('@plone/volto/babel');
// Coverage-enabled variant of the Volto babel config. `make start-ci` copies
// this file over core/packages/volto/babel.config.js so that
// babel-plugin-istanbul instruments the app and Cypress can collect
// end-to-end coverage.
//
// Instrumenting the whole workspace breaks the client build (webpack 5 pulls
// server-only code in once tree-shaking is disabled), so only the add-on
// sources are instrumented: they are the only ones SonarQube analyses.
// `cwd` must be the workspace root (/app), otherwise test-exclude would
// ignore the add-on files, which live outside the Volto core package.
const path = require('path');

function applyDefault(api) {
const defaultBabel = require('./babel');

const workspaceRoot = path.resolve(__dirname, '../../..');

module.exports = function (api) {
const voltoBabel = defaultBabel(api);
voltoBabel.plugins.push('istanbul');
voltoBabel.plugins.push([
'istanbul',
{
cwd: workspaceRoot,
include: ['packages/*/src/**'],
},
]);
return voltoBabel;
}

module.exports = applyDefault;
};
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git
node_modules
core
build
coverage
*.log
.DS_Store
cypress/screenshots
cypress/videos
cypress/reports
3 changes: 0 additions & 3 deletions .env

This file was deleted.

66 changes: 21 additions & 45 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,41 @@
const fs = require('fs');
const path = require('path');
const projectRootPath = fs.realpathSync(__dirname + '/../../../');

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
let configFile;
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
configFile = `${projectRootPath}/tsconfig.json`;
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
configFile = `${projectRootPath}/jsconfig.json`;
const projectRootPath = __dirname;
const { AddonRegistry } = require('@plone/registry/addon-registry');

if (configFile) {
const jsConfig = require(configFile).compilerOptions;
const pathsConfig = jsConfig.paths;
if (pathsConfig['@plone/volto'])
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
}
let coreLocation;
if (fs.existsSync(`${projectRootPath}/core`))
coreLocation = `${projectRootPath}/core`;
else if (fs.existsSync(`${projectRootPath}/../../core`))
coreLocation = `${projectRootPath}/../../core`;

const { AddonRegistry } = require('@plone/registry/addon-registry');
const { registry } = AddonRegistry.init(projectRootPath);
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(registry.packages).map((o) => [
o,
registry.packages[o].modulePath,
]);

const addonExtenders = registry.getEslintExtenders().map((m) => require(m));

const defaultConfig = {
extends: `${voltoPath}/.eslintrc`,
module.exports = {
extends: `${coreLocation}/packages/volto/.eslintrc`,
rules: {
'import/no-unresolved': 1,
},
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', '@plone/volto/src'],
['@plone/volto-slate', '@plone/volto-slate/src'],
['@plone/volto', `${coreLocation}/packages/volto/src`],
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
['@plone/registry', `${coreLocation}/packages/registry/src`],
[
'@eeacms/volto-object-widget',
'./packages/volto-object-widget/src',
],
...addonAliases,
['@package', `${__dirname}/src`],
['@root', `${__dirname}/src`],
['~', `${__dirname}/src`],
],
extensions: ['.js', '.jsx', '.json'],
},
'babel-plugin-root-import': {
rootPathSuffix: 'src',
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
},
},
rules: {
'react/jsx-no-target-blank': [
'error',
{
allowReferrer: true,
},
],
}
};

const config = addonExtenders.reduce(
(acc, extender) => extender.modify(acc),
defaultConfig,
);

module.exports = config;
29 changes: 29 additions & 0 deletions .github/workflows/betterleaks-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Betterleaks history audit

on:
schedule:
- cron: "0 3 * * 1" # Mondays 03:00 UTC
workflow_dispatch:

permissions:
contents: read

jobs:
audit:
name: Scan all commits for secrets
runs-on: ubuntu-latest
timeout-minutes: 70 # outer guard; the scan itself stops after timeout-minutes below
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0 # all commits of all branches

# Shared EEA secret scan: https://github.com/eea/github-actions/tree/main/betterleaks#weekly-full-history-audit
# Findings already handled are listed in .betterleaks-history-baseline.json.
- uses: eea/github-actions/betterleaks@v1
with:
mode: git
log-opts: --all
baseline: .betterleaks-history-baseline.json
timeout-minutes: 60
Loading
Loading