Merge pull request #19 from mkilijanek/codex/create-pr-to-merge-master-gchq-into-master
Sync CI workflow updates from master-gchq into master
This commit is contained in:
commit
23b8b62235
@ -12,3 +12,7 @@ indent_size = 4
|
||||
[{package.json,.travis.yml,nightwatch.json}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[.github/**.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
2
.github/workflows/dependency-review.yml
vendored
2
.github/workflows/dependency-review.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
150
.github/workflows/master.yml
vendored
150
.github/workflows/master.yml
vendored
@ -2,129 +2,61 @@ name: "Master Build, Test & Deploy"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
nightly:
|
||||
description: "Tag build as nightly"
|
||||
required: false
|
||||
default: "false"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
# Weekly build and publish to keep images fresh
|
||||
- cron: '0 3 * * 1'
|
||||
- master
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm install
|
||||
npm run setheapsize
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm install
|
||||
npm run setheapsize
|
||||
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
|
||||
- name: Production Build
|
||||
if: success()
|
||||
run: npx grunt prod --msg="Version 10 is here! Read about the new features <a href='https://github.com/gchq/CyberChef/wiki/Character-encoding,-EOL-separators,-and-editor-features'>here</a>"
|
||||
- name: Production Build
|
||||
if: success()
|
||||
run: npx grunt prod --msg=""
|
||||
|
||||
- name: Generate sitemap
|
||||
run: npx grunt exec:sitemap
|
||||
- name: Generate sitemap
|
||||
run: npx grunt exec:sitemap
|
||||
|
||||
- name: UI Tests
|
||||
if: success()
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
- name: UI Tests
|
||||
if: success()
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
|
||||
- name: Prepare for GitHub Pages
|
||||
if: success()
|
||||
run: npx grunt copy:ghPages
|
||||
- name: Prepare for GitHub Pages
|
||||
if: success()
|
||||
run: npx grunt copy:ghPages
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
if: success() && github.ref == 'refs/heads/master'
|
||||
uses: crazy-max/ghaction-github-pages@v3
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: ./build/prod
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
docker-images:
|
||||
name: Build & Publish Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: main
|
||||
if: github.ref == 'refs/heads/master'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set extra tags
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.nightly }}" = "true" ]; then
|
||||
echo "EXTRA_TAGS=type=raw,value=nightly" >> $GITHUB_ENV
|
||||
else
|
||||
echo "EXTRA_TAGS=" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,format=long
|
||||
${{ env.EXTRA_TAGS }}
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
- name: Deploy to GitHub Pages
|
||||
if: success() && github.ref == 'refs/heads/master'
|
||||
uses: crazy-max/ghaction-github-pages@v3
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: ./build/prod
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
80
.github/workflows/pull_requests.yml
vendored
80
.github/workflows/pull_requests.yml
vendored
@ -1,5 +1,8 @@
|
||||
name: "Pull Requests"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
@ -9,47 +12,50 @@ jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm install
|
||||
npm run setheapsize
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm install
|
||||
npm run setheapsize
|
||||
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
|
||||
- name: Production Build
|
||||
if: success()
|
||||
run: npx grunt prod
|
||||
- name: Production Build
|
||||
if: success()
|
||||
run: npx grunt prod
|
||||
|
||||
- name: Production Image Build
|
||||
if: success()
|
||||
id: build-image
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
# Not being uploaded to any registry, use a simple name to allow Buildah to build correctly.
|
||||
image: cyberchef
|
||||
containerfiles: ./Dockerfile
|
||||
platforms: linux/amd64
|
||||
oci: true
|
||||
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
|
||||
extra-args: |
|
||||
--ulimit nofile=10000
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: UI Tests
|
||||
if: success()
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Production Image Build
|
||||
if: success()
|
||||
id: build-image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: cyberchef:pr
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: UI Tests
|
||||
if: success()
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
|
||||
163
.github/workflows/releases.yml
vendored
163
.github/workflows/releases.yml
vendored
@ -4,7 +4,10 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
@ -16,81 +19,105 @@ jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm ci
|
||||
npm run setheapsize
|
||||
- name: Install
|
||||
run: |
|
||||
export DETECT_CHROMEDRIVER_VERSION=true
|
||||
npm ci
|
||||
npm run setheapsize
|
||||
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
- name: Lint
|
||||
run: npx grunt lint
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
npm test
|
||||
npm run testnodeconsumer
|
||||
|
||||
- name: Production Build
|
||||
run: npx grunt prod
|
||||
- name: Production Build
|
||||
run: npx grunt prod
|
||||
|
||||
- name: UI Tests
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
- name: UI Tests
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||
|
||||
- name: Image Metadata
|
||||
id: image-metadata
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{version}}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Production Image Build
|
||||
id: build-image
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
tags: ${{ steps.image-metadata.outputs.tags }}
|
||||
labels: ${{ steps.image-metadata.outputs.labels }}
|
||||
containerfiles: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
oci: true
|
||||
# enable build layer caching between platforms
|
||||
layers: true
|
||||
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
|
||||
extra-args: |
|
||||
--ulimit nofile=10000
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Publish to GHCR
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
tags: ${{ steps.build-image.outputs.tags }}
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ env.REGISTRY_USER }}
|
||||
password: ${{ env.REGISTRY_PASSWORD }}
|
||||
- name: Image Metadata
|
||||
id: image-metadata
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Upload Release Assets
|
||||
id: upload-release-assets
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/prod/*.zip
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
file_glob: true
|
||||
body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details."
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ env.REGISTRY_USER }}
|
||||
password: ${{ env.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Publish to NPM
|
||||
uses: JS-DevTools/npm-publish@v1
|
||||
with:
|
||||
token: ${{ secrets.NPM_TOKEN }}
|
||||
- name: Publish to GHCR
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.image-metadata.outputs.tags }}
|
||||
labels: ${{ steps.image-metadata.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Upload Release Assets
|
||||
id: upload-release-assets
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/prod/*.zip
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
file_glob: true
|
||||
body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details."
|
||||
|
||||
npm-publish:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
needs: main
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set node version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install
|
||||
run: npm ci
|
||||
|
||||
- name: Create machine generated files
|
||||
run: npm run node
|
||||
|
||||
- name: Reset node version ready for publish
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Publish to NPM
|
||||
run: npm publish
|
||||
|
||||
2
.github/workflows/security-auto-fix.yml
vendored
2
.github/workflows/security-auto-fix.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: 24
|
||||
cache: 'npm'
|
||||
|
||||
- name: Cache node modules
|
||||
|
||||
11
package.json
11
package.json
@ -193,16 +193,16 @@
|
||||
"start": "npx grunt dev",
|
||||
"build": "npx grunt prod",
|
||||
"node": "npx grunt node",
|
||||
"repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-experimental-fetch --no-warnings src/node/repl.mjs",
|
||||
"test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs",
|
||||
"repl": "node --no-experimental-fetch --no-warnings src/node/repl.mjs",
|
||||
"test": "npx grunt configTests && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs",
|
||||
"testnodeconsumer": "npx grunt testnodeconsumer",
|
||||
"testui": "npx grunt testui",
|
||||
"testuidev": "npx nightwatch --env=dev",
|
||||
"lint": "npx grunt lint",
|
||||
"lint:grammar": "cspell ./src",
|
||||
"postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup && npx grunt exec:fixJimpModule",
|
||||
"newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
|
||||
"minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs",
|
||||
"newop": "node src/core/config/scripts/newOperation.mjs",
|
||||
"minor": "node src/core/config/scripts/newMinorVersion.mjs",
|
||||
"getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
|
||||
"setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048",
|
||||
"security:audit": "npm audit",
|
||||
@ -211,5 +211,8 @@
|
||||
"security:triage": "node scripts/vulnerability-triage.js",
|
||||
"security:triage:json": "node scripts/vulnerability-triage.js --json",
|
||||
"security:check": "npm run security:triage && npm run lint"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import Chef from "./Chef.mjs";
|
||||
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
|
||||
import OperationConfig from "./config/OperationConfig.json" with { type: "json" };
|
||||
import OpModules from "./config/modules/OpModules.mjs";
|
||||
import loglevelMessagePrefix from "loglevel-message-prefix";
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
|
||||
import OperationConfig from "./config/OperationConfig.json" with { type: "json" };
|
||||
import OperationError from "./errors/OperationError.mjs";
|
||||
import Operation from "./Operation.mjs";
|
||||
import DishError from "./errors/DishError.mjs";
|
||||
|
||||
@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/config/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: generateConfig.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs");
|
||||
console.log("Example> node src/core/config/scripts/generateConfig.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ const dir = path.join(process.cwd() + "/src/core/config/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: generateOpsIndex.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs");
|
||||
console.log("Example> node src/core/config/scripts/generateOpsIndex.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ const dir = path.join(process.cwd() + "/src/core/config/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: newMinorVersion.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs");
|
||||
console.log("Example> node src/core/config/scripts/newMinorVersion.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/operations/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: newOperation.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/newOperation.mjs");
|
||||
console.log("Example> node src/core/config/scripts/newOperation.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import OperationConfig from "../config/OperationConfig.json" assert {type: "json"};
|
||||
import OperationConfig from "../config/OperationConfig.json" with { type: "json" };
|
||||
import Utils, { isWorkerEnvironment } from "../Utils.mjs";
|
||||
import Recipe from "../Recipe.mjs";
|
||||
import Dish from "../Dish.mjs";
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
import NodeDish from "./NodeDish.mjs";
|
||||
import NodeRecipe from "./NodeRecipe.mjs";
|
||||
import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
|
||||
import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" };
|
||||
import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs";
|
||||
import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs";
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ const dir = path.join(`${process.cwd()}/src/node`);
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: generateNodeIndex.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs");
|
||||
console.log("Example> node src/node/config/scripts/generateNodeIndex.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@ -17,8 +17,8 @@ import * as CanvasComponents from "../core/lib/CanvasComponents.mjs";
|
||||
|
||||
// CyberChef
|
||||
import App from "./App.mjs";
|
||||
import Categories from "../core/config/Categories.json" assert {type: "json"};
|
||||
import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
|
||||
import Categories from "../core/config/Categories.json" with { type: "json" };
|
||||
import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" };
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import sm from "sitemap";
|
||||
import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"};
|
||||
import OperationConfig from "../../core/config/OperationConfig.json" with { type: "json" };
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
import Categories from "../../../src/core/config/Categories.json" assert {type: "json"};
|
||||
import OperationConfig from "../../../src/core/config/OperationConfig.json" assert {type: "json"};
|
||||
import Categories from "../../../src/core/config/Categories.json" with { type: "json" };
|
||||
import OperationConfig from "../../../src/core/config/OperationConfig.json" with { type: "json" };
|
||||
import it from "../assertionHandler.mjs";
|
||||
import assert from "assert";
|
||||
|
||||
|
||||
@ -322,7 +322,7 @@ TestRegister.addTests([
|
||||
]
|
||||
}
|
||||
],
|
||||
expectedMatch: /^Invalid JPath expression: jsonPath: self is not defined:/
|
||||
expectedMatch: /^Invalid JPath expression: Unexpected "\{" at character 1/
|
||||
},
|
||||
{
|
||||
name: "CSS selector",
|
||||
|
||||
@ -15,26 +15,52 @@ const inputObject = JSON.stringify({
|
||||
}, null, 4);
|
||||
|
||||
const hsKey = "secret_cat";
|
||||
const rsKey = `-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw
|
||||
33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW
|
||||
+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB
|
||||
AoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS
|
||||
3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5Cp
|
||||
uGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE
|
||||
2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0
|
||||
GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0K
|
||||
Su5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY
|
||||
6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5
|
||||
fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523
|
||||
Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aP
|
||||
FaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw==
|
||||
-----END RSA PRIVATE KEY-----`;
|
||||
const esKey = `-----BEGIN PRIVATE KEY-----
|
||||
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2
|
||||
OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r
|
||||
1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G
|
||||
const rsKey = `-----BEGIN PRIVATE KEY-----
|
||||
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnBZHfKzx27jc+
|
||||
9cFPj3b42HO8auxjtlpJpiWgMluSJi8ECrN3iIODf5H9xf1Np61+4xtz3SDKibdA
|
||||
XgB9rhXRz6LcRNN962QtIvKriI+Mr9EEaAwNFYziZ8bhDVgawheWCqSJO0DjDDDk
|
||||
0CTbfl7SeIhcTuoPXeWFQICUsyc6w3uE+KWnnPZnK9l3R02ssBjsqQhf3LZ9bz04
|
||||
52ahhuBg1BgBOIeu8Y8hzTAjsOuMDZ7XV8MbEpcmOYRy46vEjRTl3ZIpYoS0v5st
|
||||
M60swjnPiv43oBAsziVddIJWnh+TnBacnuhHl7amuGCLspogftJGefuGDNxIJOLH
|
||||
mPaO5R7vAgMBAAECggEADZn32SZQBIaI7SWF8Ju3OvZvdffrnAFH9o8YJwLf/k5O
|
||||
NVQ19cMtTwgrPcAy5igJoG9Zlew+en46Mkl2iO+/bB9n7MUGmKLLvpaQqAW9weA2
|
||||
E6bWksyig0/t1yE0fzrPLa/JuSSqcNOua0JP8TZS+dxL1vd0c1wpX7uI9nhHxn9Q
|
||||
OJNY6N+ebeIjEugYJaeaLWj6cQ1x9V0+JealQtlra4Xex/CwczqPLKD01bdPe/Fn
|
||||
5iLG8/dIofHz+615UTC52vwKaL2JiWUHX9gBlahrZYOuhxJQ1RRAf03+Ij2hyUwa
|
||||
tOKglPZIhDajALfU3qSfOfRHnMKpakdA9tiZ1TTIvQKBgQD5lUvlZOfY/WdkHl3u
|
||||
RnF3g/lWT4dRzdcezeYkLAdYcu5Q1ExVlYPezA9tYD2uR7cziJy/em1v0tPXzCSL
|
||||
+BGB8/Ds4wg3QYnV8RXgI/4XxXf2iNbfJEfJ74nxza1/9L9Bnvg1OZLcdagu+Ria
|
||||
p8y3hWzbBie52o0T8s/KDo2/PQKBgQDs9hseyloiDqsmW7hfLw+AiH1IGwXgK53b
|
||||
ZeBwtASr7SYD1Ej0xFZ5SZ/OukjdDAQoyrivpjPcCjXxR1eoCA857S/+sSRPk+Gw
|
||||
3+9lWys7jd4VEWvQgV7PKwGGVc1Ku/aKjNbNnu4HxbQfb7bJZnvoW8WqsqHhT/2z
|
||||
bFnuYVD5mwKBgQC88adpXECg5wX0p4CYuD+CKSkDjGV3KoumyF1oGOTesvNzwaSg
|
||||
TfZtHrK3LNrFK4mnu85erwJWW5cAkY1BYWVvqgtEaoN3wWflzQOwkc70lAvDWcjB
|
||||
WSf32h3mLr0gV1rLBNwG/zUNLQ1LskxMGKhEbv//t+MvMiMHbRSddPMeSQKBgQDm
|
||||
H8QKzP1nodM4905AshVeAC+a/RNhtzogvfmPumPnC/IlOd54RsysEYIvY94rPeY0
|
||||
L1vYyZIHmar1XRGVz+3plZ1MvX/EAJvoCDIXvshnl8kbsMWBwoHus5dRfLZYY950
|
||||
g36ARl5oEepxtS5QvUSMTcPTmJN5mxOJUiqsRLo9DQKBgQDyOatwmZLrWs8Sipet
|
||||
pdJpPnBJ1TE+Dm1WmaUfmjoXJxi07Bfikex5ybqqed49s5TSb2OBU4eG/yVLQcix
|
||||
ik0m4tG0NSEJ/EgfwUxdteHSjGmWnuiK0r3oAz6ffE32RfqvEoFRcCh/H8MdkVtg
|
||||
ErVnxmpzv5elRSZ/DUn2uygxgA==
|
||||
-----END PRIVATE KEY-----`;
|
||||
const es256Key = `-----BEGIN EC PRIVATE KEY-----
|
||||
MHcCAQEEIA3ISxaDm/NdIVmkuAWR5VTNNj2PTpe+eWhv2rUhNE9joAoGCCqGSM49
|
||||
AwEHoUQDQgAEY5Iad2fwtKm40eqg+hx4sxwsZwKm0WP/GDNGAPUisD3H2AlLedYE
|
||||
+xZ8cehEKjddb6Bftv0I3PLGFMBQIyE0pA==
|
||||
-----END EC PRIVATE KEY-----`;
|
||||
const es384Key = `-----BEGIN EC PRIVATE KEY-----
|
||||
MIGkAgEBBDAp0jx0wSk6L2od/DbovYvrhG/AKXAFpqaQ7/u8tgg7w0lBHWrA9yHF
|
||||
YG1Z0k5lEACgBwYFK4EEACKhZANiAASYGNRZMaBebhOkwML7V4JJgiXqukoopqun
|
||||
xXWTCEw4qCEqydsXE6TFVB2RJ0+hpjoK00XqVVvyv8fw6ZYH9y5dHmj0RsnBMrAm
|
||||
oOhhUpXlZWsfiY97db80mKCp7n2MkNw=
|
||||
-----END EC PRIVATE KEY-----`;
|
||||
const es512Key = `-----BEGIN EC PRIVATE KEY-----
|
||||
MIHcAgEBBEIARI9C6QrByhpJ8paMAgKyz6piOIEF2wDxlPEFcVC3ZHSo4crE2Uc5
|
||||
E94EOuLNnKs/TinGMiTUhbefpfETI5SML4qgBwYFK4EEACOhgYkDgYYABADka9q3
|
||||
ZXy2j1ml6fQqFbG6ryD2+2Cu43xxDeEoec9PW4Dfe/hmkluYwSv15X5+VhBx36sh
|
||||
Jeh34sXjACyMVXfLGQGS3Puxol0c1nyC1uv9ecxLJmWUtUmPm9Uz87tb3vhI636x
|
||||
8YT3MpqHkOZnDm4CiG09QIS9ROUHKH/BGQ7QtH/9yA==
|
||||
-----END EC PRIVATE KEY-----`;
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
@ -88,7 +114,7 @@ TestRegister.addTests([
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES256", "{}"],
|
||||
args: [es256Key, "ES256", "{}"],
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
@ -103,7 +129,7 @@ TestRegister.addTests([
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES384", "{}"],
|
||||
args: [es384Key, "ES384", "{}"],
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
@ -118,7 +144,7 @@ TestRegister.addTests([
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES512", "{}"],
|
||||
args: [es512Key, "ES512", "{}"],
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
@ -163,7 +189,7 @@ TestRegister.addTests([
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "RS512", "{}"],
|
||||
args: [rsKey, "RS512", "{}"],
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user