From d9611f5b4f3a4865dd839c1be463df62d6b533eb Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 9 May 2024 14:15:28 +0000 Subject: [PATCH 01/18] Version bump --- box.json | 2 +- changelog.md | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/box.json b/box.json index f9c3754..12c38f8 100644 --- a/box.json +++ b/box.json @@ -1,6 +1,6 @@ { "name":"ColdBox Security", - "version":"3.4.3", + "version":"3.5.0", "location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbsecurity/@build.version@/cbsecurity-@build.version@.zip", "author":"Ortus Solutions.com ", "slug":"cbsecurity", diff --git a/changelog.md b/changelog.md index 47a5091..9fa0567 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.4.3] - 2024-05-09 + +## [3.4.2] - 2024-01-10 + +## [3.4.1] - 2023-08-09 + ### Fixed - Renamed `renderView()` to `view` to be ColdBox 7 compliant now. @@ -379,7 +385,9 @@ settings = { - Created first module version -[Unreleased]: https://github.com/coldbox-modules/cbsecurity/compare/v3.4.2...HEAD +[Unreleased]: https://github.com/coldbox-modules/cbsecurity/compare/v3.4.3...HEAD + +[3.4.3]: https://github.com/coldbox-modules/cbsecurity/compare/v3.4.2...v3.4.3 [3.4.2]: https://github.com/coldbox-modules/cbsecurity/compare/v3.4.1...v3.4.2 From 21edd85c45131d5dd67926e92f12ba0969f1c8f6 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Sat, 10 Aug 2024 13:37:39 -0400 Subject: [PATCH 02/18] BOX-122 - Resolve Fixed an issue with the use of arguments scope due to refactor to member `.each` method --- models/jwt/JwtService.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/jwt/JwtService.cfc b/models/jwt/JwtService.cfc index 857b611..9701896 100644 --- a/models/jwt/JwtService.cfc +++ b/models/jwt/JwtService.cfc @@ -441,7 +441,7 @@ component accessors="true" singleton threadsafe { // Announce the invalid claims variables.interceptorService.announce( "cbSecurity_onJWTInvalidClaims", - { token : arguments.token, payload : decodedToken } + { token : token, payload : decodedToken } ); throw( From 8f0b6e09b6e496920fbeb732aa49d4425630fbf0 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Thu, 5 Dec 2024 10:41:50 -0600 Subject: [PATCH 03/18] add boxlang to matrix --- .github/workflows/tests.yml | 3 +++ server-boxlang@1.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 server-boxlang@1.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5766983..f65874a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,9 @@ jobs: - coldboxVersion: "be" cfengine: "adobe@2023" experimental: true + - coldboxVersion: "be" + cfengine: "boxlang@1" + experimental: true steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/server-boxlang@1.json b/server-boxlang@1.json new file mode 100644 index 0000000..36f4512 --- /dev/null +++ b/server-boxlang@1.json @@ -0,0 +1,36 @@ +{ + "app":{ + "cfengine":"boxlang@be", + "serverHomeDirectory":".engine/boxlang" + }, + "name":"cbsecurity-boxlang@1", + "force":true, + "openBrowser":false, + "web":{ + "directoryBrowsing":true, + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"test-harness", + "aliases":{ + "/moduleroot/cbsecurity":"./" + } + }, + "JVM":{ + "heapSize":"1024", + "javaVersion":"openjdk21_jdk", + "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999" + }, + "cfconfig":{ + "file":".cfconfig.json" + }, + "env":{ + "BOXLANG_DEBUG":true + }, + "scripts":{ + "onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" + } +} \ No newline at end of file From e1f8e3a7b58adf143ba0c98754da3ed488f0fa88 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 6 Dec 2024 22:18:26 -0600 Subject: [PATCH 04/18] Add boxlang server file --- server-boxlang@1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-boxlang@1.json b/server-boxlang@1.json index 36f4512..20c3c3a 100644 --- a/server-boxlang@1.json +++ b/server-boxlang@1.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"boxlang@be", + "cfengine":"boxlang@1.0.0-snapshot", "serverHomeDirectory":".engine/boxlang" }, "name":"cbsecurity-boxlang@1", From bb31d7860136dd4359310c75e876c79de4f3e082 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 6 Dec 2024 22:19:39 -0600 Subject: [PATCH 05/18] remove modules already in box.json of module itself --- test-harness/box.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test-harness/box.json b/test-harness/box.json index 308e694..a7f1409 100644 --- a/test-harness/box.json +++ b/test-harness/box.json @@ -6,13 +6,10 @@ "description":"", "dependencies":{ "coldbox":"^6.0.0", - "cbauth":"^6.0.0", - "BCrypt":"^2.0.0", - "jwt-cfml":"^1.0.0", - "cbcsrf":"^3.0.0" + "BCrypt":"^3.1.0+4" }, "devDependencies":{ - "cbdebugger":"^4.0.0", + "cbdebugger":"^4.0.0", "testbox":"*", "route-visualizer":"*" }, From f26f99af9dad2fc33fd8a114a08ab7df73dc21c1 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 10 Jan 2025 10:08:37 -0500 Subject: [PATCH 06/18] fix test that was causing StackOverflow in BL --- test-harness/tests/specs/integration/JWTSpec.cfc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test-harness/tests/specs/integration/JWTSpec.cfc b/test-harness/tests/specs/integration/JWTSpec.cfc index 403745b..0e58003 100644 --- a/test-harness/tests/specs/integration/JWTSpec.cfc +++ b/test-harness/tests/specs/integration/JWTSpec.cfc @@ -48,6 +48,8 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { variables.jwtService.getSettings().jwt.tokenStorage.enabled = true; variables.jwtService.getSettings().jwt.tokenStorage.driver = "cachebox"; variables.jwtService.getSettings().jwt.tokenStorage.properties = { "cacheName" : "default" }; + + variables.defaultIssuer = variables.jwtService.getSettings().jwt.issuer; // Recreate Token Storage variables.jwtService.getTokenStorage( force: true ); } @@ -79,6 +81,7 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { beforeEach( function( currentSpec ){ variables.jwtService.getSettings().jwt.enableAutoRefreshValidator = true; variables.jwtAuthValidator = getInstance( "JwtAuthValidator@cbsecurity" ); + variables.jwtService.getSettings().jwt.issuer = variables.defaultIssuer; } ); afterEach( function( currentSpec ){ variables.jwtService.getSettings().jwt.enableAutoRefreshValidator = false; @@ -103,6 +106,7 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { } ); given( "Auto refresh is on and an expired access token is sent but no refresh token is sent", function(){ then( "the validation should fail", function(){ + // variables.jwtService.getSettings().jwt.issuer = "http://127.0.0.1:56596/"; getRequestContext().setValue( "x-auth-token", variables.expired_token ); var results = variables.jwtAuthValidator.validateSecurity( "" ); expect( results.allow ).toBeFalse( results.toString() ); @@ -388,10 +392,11 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { given( "a valid jwt token put in to storage", function(){ then( "it should use the exp on the token for the storage timeout", function(){ - var originalTokenStorage = duplicate( variables.jwtService.getTokenStorage() ); + var originalTokenStorage = variables.jwtService.getTokenStorage(); try { variables.jwtService.getTokenStorage().clearAll(); - var tokenStorageMock = prepareMock( variables.jwtService.getTokenStorage() ); + var tokenStorageMock = prepareMock( getWirebox().getInstance( "CacheTokenStorage@cbsecurity" ) ); + variables.jwtService.setTokenStorage( tokenStorageMock ); tokenStorageMock.$( "set", tokenStorageMock ); var expirationSeconds = 100; var expirationTime = variables.jwtService.toEpoch( From 0b53b0bea539c3bed433ddc96bbd522da3b7a2ee Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 10 Jan 2025 10:10:19 -0500 Subject: [PATCH 07/18] change to Coldbox 7 as default --- test-harness/box.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-harness/box.json b/test-harness/box.json index a7f1409..962ab29 100644 --- a/test-harness/box.json +++ b/test-harness/box.json @@ -5,7 +5,7 @@ "private":true, "description":"", "dependencies":{ - "coldbox":"^6.0.0", + "coldbox":"^7.0.0", "BCrypt":"^3.1.0+4" }, "devDependencies":{ From 39309e277ac2f946e75fe807497c645adfed54af Mon Sep 17 00:00:00 2001 From: jclausen Date: Fri, 10 Jan 2025 17:30:16 +0000 Subject: [PATCH 08/18] Apply cfformat changes --- test-harness/tests/specs/integration/JWTSpec.cfc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-harness/tests/specs/integration/JWTSpec.cfc b/test-harness/tests/specs/integration/JWTSpec.cfc index 0e58003..3e286fb 100644 --- a/test-harness/tests/specs/integration/JWTSpec.cfc +++ b/test-harness/tests/specs/integration/JWTSpec.cfc @@ -395,7 +395,9 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { var originalTokenStorage = variables.jwtService.getTokenStorage(); try { variables.jwtService.getTokenStorage().clearAll(); - var tokenStorageMock = prepareMock( getWirebox().getInstance( "CacheTokenStorage@cbsecurity" ) ); + var tokenStorageMock = prepareMock( + getWirebox().getInstance( "CacheTokenStorage@cbsecurity" ) + ); variables.jwtService.setTokenStorage( tokenStorageMock ); tokenStorageMock.$( "set", tokenStorageMock ); var expirationSeconds = 100; From 838650dec13142acc2da769b82b29b5725ebf650 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 10 Jan 2025 12:40:58 -0500 Subject: [PATCH 09/18] fix mock usage to prevent singleton mutation --- test-harness/tests/specs/integration/JWTSpec.cfc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-harness/tests/specs/integration/JWTSpec.cfc b/test-harness/tests/specs/integration/JWTSpec.cfc index 3e286fb..cb8403c 100644 --- a/test-harness/tests/specs/integration/JWTSpec.cfc +++ b/test-harness/tests/specs/integration/JWTSpec.cfc @@ -394,10 +394,10 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" { then( "it should use the exp on the token for the storage timeout", function(){ var originalTokenStorage = variables.jwtService.getTokenStorage(); try { - variables.jwtService.getTokenStorage().clearAll(); var tokenStorageMock = prepareMock( - getWirebox().getInstance( "CacheTokenStorage@cbsecurity" ) + new cbsecurity.models.jwt.storages.CacheTokenStorage() ); + getWirebox().autowire( tokenStorageMock ); variables.jwtService.setTokenStorage( tokenStorageMock ); tokenStorageMock.$( "set", tokenStorageMock ); var expirationSeconds = 100; From dd4aaeb5fea84e0fc35eefa8a9973857152439a4 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:09:52 -0600 Subject: [PATCH 10/18] ci: enable workflow dispatch for triggering boxlang tests and reinstall commandbox-boxlang --- .github/workflows/snapshot.yml | 1 + .github/workflows/tests.yml | 5 +++++ server-boxlang@1.json | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 63aca2e..93b278d 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -4,6 +4,7 @@ on: push: branches: - 'development' + workflow_dispatch: jobs: ########################################################################################## diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f65874a..7933e67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,6 +73,11 @@ jobs: - name: Setup CommandBox CLI uses: Ortus-Solutions/setup-commandbox@v2.0.1 + - name: Update Commandbox Boxlang Module + if: ${{ matrix.cfengine == 'boxlang@1' }} + run: + box install --force commandbox-boxlang + - name: Install Dependencies run: | box install diff --git a/server-boxlang@1.json b/server-boxlang@1.json index 20c3c3a..3866674 100644 --- a/server-boxlang@1.json +++ b/server-boxlang@1.json @@ -22,7 +22,7 @@ "JVM":{ "heapSize":"1024", "javaVersion":"openjdk21_jdk", - "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999" + "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999 -Dboxlang.debugMode=true" }, "cfconfig":{ "file":".cfconfig.json" @@ -33,4 +33,4 @@ "scripts":{ "onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" } -} \ No newline at end of file +} From c45c51137047a1e1f805742e091ffa0846ce3d63 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 4 Feb 2025 22:43:24 -0600 Subject: [PATCH 11/18] ci: use ubuntu-24.04 runner --- .github/workflows/pr.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/snapshot.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a48c550..355726a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -19,7 +19,7 @@ jobs: formatCheck: name: Checks Source Code Formatting - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39844c2..41d6fa7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: ########################################################################################## build: name: Build & Publish - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -133,7 +133,7 @@ jobs: prep_next_release: name: Prep Next Release if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [ build ] steps: # Checkout development diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 93b278d..4855d83 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -19,7 +19,7 @@ jobs: ########################################################################################## format: name: Code Auto-Formatting - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7933e67..7e7f353 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ on: jobs: tests: name: Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 env: DB_USER: root DB_PASSWORD: root From f28b35213bca2b2b08ae0d200adf0887c9d936ee Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:14:49 -0600 Subject: [PATCH 12/18] add cron for weekly tests [skip ci] --- .github/workflows/cron.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/cron.yml diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 0000000..5ea8f4b --- /dev/null +++ b/.github/workflows/cron.yml @@ -0,0 +1,28 @@ +name: Weekly Test Engines + +on: + workflow_dispatch: + schedule: + - cron: '0 8 * * 4' + +jobs: + tests: + + uses: ./.github/workflows/tests.yml + secrets: inherit + + notify: + needs: [ tests ] + runs-on: ubuntu-24.04 + if: ${{ always() }} + steps: + - name: Slack Notifications + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: boxlang-cron + SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' + SLACK_ICON_EMOJI: ":bell:" + SLACK_MESSAGE: '${{ github.repository }} weekly tests' + SLACK_TITLE: ${{ github.repository }} Tests results + SLACK_USERNAME: CI + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} From 0c8d3f5fdda11d5940d0c4a1b5498e71734f4574 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:25:22 -0600 Subject: [PATCH 13/18] remove workflow dispatch in cron [skip ci] --- .github/workflows/cron.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 5ea8f4b..2de8875 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,7 +1,6 @@ name: Weekly Test Engines on: - workflow_dispatch: schedule: - cron: '0 8 * * 4' From 29653064883fbbbf29876e5ea5d16bba4fee0e03 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 20 Feb 2025 12:05:36 +0100 Subject: [PATCH 14/18] boxlang certs --- .github/workflows/cron.yml | 43 +++++++++-------- .github/workflows/pr.yml | 5 +- .github/workflows/release.yml | 46 ++++++++++++++++--- .github/workflows/snapshot.yml | 16 ++++++- .github/workflows/tests.yml | 31 +++++-------- .markdownlint.json | 2 +- box.json | 11 +---- changelog.md | 5 ++ server-adobe@2021.json | 3 +- server-boxlang-cfml@1.json | 33 +++++++++++++ server-boxlang@1.json | 36 --------------- server-adobe@2018.json => server-lucee@6.json | 6 +-- test-harness/tests/Application.cfc | 2 +- 13 files changed, 136 insertions(+), 103 deletions(-) create mode 100644 server-boxlang-cfml@1.json delete mode 100644 server-boxlang@1.json rename server-adobe@2018.json => server-lucee@6.json (76%) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 2de8875..f3a888a 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -1,27 +1,26 @@ -name: Weekly Test Engines +name: Daily Tests on: - schedule: - - cron: '0 8 * * 4' + schedule: + - cron: '0 0 * * *' # Runs at 00:00 UTC every day jobs: - tests: - - uses: ./.github/workflows/tests.yml - secrets: inherit + tests: + uses: ./.github/workflows/tests.yml + secrets: inherit - notify: - needs: [ tests ] - runs-on: ubuntu-24.04 - if: ${{ always() }} - steps: - - name: Slack Notifications - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: boxlang-cron - SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' - SLACK_ICON_EMOJI: ":bell:" - SLACK_MESSAGE: '${{ github.repository }} weekly tests' - SLACK_TITLE: ${{ github.repository }} Tests results - SLACK_USERNAME: CI - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + notify: + needs: [ tests ] + runs-on: ubuntu-24.04 + if: ${{ always() }} + steps: + - name: Slack Notifications + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: boxlang-cron + SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' + SLACK_ICON_EMOJI: ":bell:" + SLACK_MESSAGE: '${{ github.repository }} weekly tests' + SLACK_TITLE: ${{ github.repository }} Tests results + SLACK_USERNAME: CI + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 355726a..b0bf721 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,10 +6,8 @@ on: - "main" - "master" - "development" - - "releases/v*" pull_request: branches: - - "releases/v*" - development jobs: @@ -17,7 +15,8 @@ jobs: uses: ./.github/workflows/tests.yml secrets: inherit - formatCheck: + # Format PR + format_check: name: Checks Source Code Formatting runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41d6fa7..c9069d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,13 @@ on: default: false type: boolean + # Manual Trigger + workflow_dispatch: env: - MODULE_ID: cbsecurity + MODULE_ID: ${{ github.event.repository.name }} + JDK: 21 SNAPSHOT: ${{ inputs.snapshot || false }} + BUILD_ID: ${{ github.run_number }} jobs: ########################################################################################## @@ -27,6 +31,11 @@ jobs: build: name: Build & Publish runs-on: ubuntu-24.04 + permissions: + checks: write + pull-requests: write + contents: write + issues: write steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -36,6 +45,12 @@ jobs: with: forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }} + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: ${{ env.JDK }} + - name: "Setup Environment Variables For Build Process" id: current_version run: | @@ -50,7 +65,7 @@ jobs: fi - name: Update changelog [unreleased] with latest version - uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + uses: thomaseizinger/keep-a-changelog-new-release@3.1.0 if: env.SNAPSHOT == 'false' with: changelogPath: ./changelog.md @@ -61,10 +76,10 @@ jobs: npm install -g markdownlint-cli markdownlint changelog.md --fix box install commandbox-docbox - box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }} + box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ env.BUILD_ID }} :branch=${{ env.BRANCH }} - - name: Commit Changelog To Master - uses: EndBug/add-and-commit@v9.1.3 + - name: Commit Changelog [unreleased] with latest version + uses: EndBug/add-and-commit@v9.1.4 if: env.SNAPSHOT == 'false' with: author_name: Github Actions @@ -118,7 +133,7 @@ jobs: box forgebox publish --force - name: Create Github Release - uses: taiki-e/create-gh-release-action@v1.8.0 + uses: taiki-e/create-gh-release-action@v1.8.2 continue-on-error: true if: env.SNAPSHOT == 'false' with: @@ -127,6 +142,18 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ref: refs/tags/v${{ env.VERSION }} + - name: Inform Slack + if: ${{ always() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: coding + SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' + SLACK_ICON_EMOJI: ":bell:" + SLACK_MESSAGE: "Module ${{ env.MODULE_ID }} v${{ env.VERSION }} Built with ${{ job.status }}!" + SLACK_TITLE: "ColdBox Module ${{ env.MODULE_ID }}" + SLACK_USERNAME: CI + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + ########################################################################################## # Prep Next Release ########################################################################################## @@ -135,6 +162,11 @@ jobs: if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' runs-on: ubuntu-24.04 needs: [ build ] + permissions: + checks: write + pull-requests: write + contents: write + issues: write steps: # Checkout development - name: Checkout Repository @@ -165,7 +197,7 @@ jobs: # Commit it back to development - name: Commit Version Bump - uses: EndBug/add-and-commit@v9.1.3 + uses: EndBug/add-and-commit@v9.1.4 with: author_name: Github Actions author_email: info@ortussolutions.com diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 4855d83..50c8392 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -4,8 +4,14 @@ on: push: branches: - 'development' + workflow_dispatch: +# Unique group name per workflow-branch/tag combo +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: ########################################################################################## # Module Tests @@ -20,6 +26,9 @@ jobs: format: name: Code Auto-Formatting runs-on: ubuntu-24.04 + permissions: + contents: write + checks: write steps: - uses: actions/checkout@v4 @@ -29,7 +38,7 @@ jobs: cmd: run-script format - name: Commit Format Changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Apply cfformat changes @@ -40,5 +49,10 @@ jobs: uses: ./.github/workflows/release.yml needs: [ tests, format ] secrets: inherit + permissions: + checks: write + pull-requests: write + contents: write + issues: write with: snapshot: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e7f353..c01b7cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,16 +18,16 @@ jobs: strategy: fail-fast: false matrix: - cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ] - coldboxVersion: [ "^6.0.0", "^7.0.0" ] + cfengine: [ "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ] + coldboxVersion: [ "^7.0.0" ] experimental: [ false ] - # Here we tests all engines against ColdBox@BE + # Experimental: ColdBox BE vs All Engines include: - coldboxVersion: "be" cfengine: "lucee@5" experimental: true - coldboxVersion: "be" - cfengine: "adobe@2018" + cfengine: "lucee@6" experimental: true - coldboxVersion: "be" cfengine: "adobe@2021" @@ -36,26 +36,24 @@ jobs: cfengine: "adobe@2023" experimental: true - coldboxVersion: "be" - cfengine: "boxlang@1" + cfengine: "boxlang-cfml@1" experimental: true steps: - name: Checkout Repository uses: actions/checkout@v4 + # DATABASE SETUP: uncomment if you need to setup a database + # - name: Setup Database and Fixtures + # run: | + # sudo systemctl start mysql.service + # mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;' + # mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql - name: Setup Java uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" - - - name: Setup Database and Fixtures - run: | - sudo systemctl start mysql.service - # Create Database - mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE cbsecurity;' - # Import Database - mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/cbsecurity.sql + java-version: "21" - name: Setup Environment For Testing Process run: | @@ -73,11 +71,6 @@ jobs: - name: Setup CommandBox CLI uses: Ortus-Solutions/setup-commandbox@v2.0.1 - - name: Update Commandbox Boxlang Module - if: ${{ matrix.cfengine == 'boxlang@1' }} - run: - box install --force commandbox-boxlang - - name: Install Dependencies run: | box install diff --git a/.markdownlint.json b/.markdownlint.json index 8189ee3..21bc843 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -8,9 +8,9 @@ "no-multiple-blanks": { "maximum": 2 }, - "no-duplicate-heading" : false, "no-duplicate-header" : { "siblings_only" : true }, + "no-duplicate-heading" : false, "no-inline-html" : false } diff --git a/box.json b/box.json index 12c38f8..d72458c 100644 --- a/box.json +++ b/box.json @@ -28,10 +28,9 @@ "cbcsrf":"^3.0.0" }, "devDependencies":{ + "commandbox-boxlang":"*", "commandbox-cfformat":"*", - "commandbox-docbox":"*", - "commandbox-dotenv":"*", - "commandbox-cfconfig":"*" + "commandbox-docbox":"*" }, "ignore":[ "**/.*", @@ -50,16 +49,10 @@ "format:check":"cfformat check handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc", "install:dependencies":"install && cd test-harness && install", "start:lucee":"server start serverConfigFile=server-lucee@5.json", - "start:2018":"server start serverConfigFile=server-adobe@2018.json", - "start:2021":"server start serverConfigFile=server-adobe@2021.json", "start:2023":"server start serverConfigFile=server-adobe@2023.json", "stop:lucee":"server stop serverConfigFile=server-lucee@5.json", - "stop:2018":"server stop serverConfigFile=server-adobe@2018.json", - "stop:2021":"server stop serverConfigFile=server-adobe@2021.json", "stop:2023":"server stop serverConfigFile=server-adobe@2023.json", "logs:lucee":"server log serverConfigFile=server-lucee@5.json --follow", - "logs:2018":"server log serverConfigFile=server-adobe@2018.json --follow", - "logs:2021":"server log serverConfigFile=server-adobe@2021.json --follow", "logs:2023":"server log serverConfigFile=server-adobe@2023.json --follow" }, "installPaths":{ diff --git a/changelog.md b/changelog.md index 9fa0567..63cd2f6 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- BoxLang certification +- Github Actions updates + ## [3.4.3] - 2024-05-09 ## [3.4.2] - 2024-01-10 diff --git a/server-adobe@2021.json b/server-adobe@2021.json index 39b2bdc..a43ff4b 100644 --- a/server-adobe@2021.json +++ b/server-adobe@2021.json @@ -17,7 +17,8 @@ } }, "jvm":{ - "heapSize":"1024" + "heapSize":"1024", + "javaVersion":"openjdk11_jre" }, "openBrowser":"false", "cfconfig":{ diff --git a/server-boxlang-cfml@1.json b/server-boxlang-cfml@1.json new file mode 100644 index 0000000..9c40aca --- /dev/null +++ b/server-boxlang-cfml@1.json @@ -0,0 +1,33 @@ +{ + "name":"cbsecurity-boxlang@1", + "app":{ + "serverHomeDirectory":".engine/boxlang", + "cfengine":"boxlang@be" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot": "test-harness", + "aliases":{ + "/moduleroot/cbsecurity":"../" + } + }, + "JVM":{ + "heapSize":"1024", + "javaVersion":"openjdk21_jre", + "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888" + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + }, + "env":{ + }, + "scripts":{ + "onServerInitialInstall":"install bx-compat-cfml,bx-esapi,bx-mysql --noSave" + } +} diff --git a/server-boxlang@1.json b/server-boxlang@1.json deleted file mode 100644 index 3866674..0000000 --- a/server-boxlang@1.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "app":{ - "cfengine":"boxlang@1.0.0-snapshot", - "serverHomeDirectory":".engine/boxlang" - }, - "name":"cbsecurity-boxlang@1", - "force":true, - "openBrowser":false, - "web":{ - "directoryBrowsing":true, - "http":{ - "port":"60299" - }, - "rewrites":{ - "enable":"true" - }, - "webroot":"test-harness", - "aliases":{ - "/moduleroot/cbsecurity":"./" - } - }, - "JVM":{ - "heapSize":"1024", - "javaVersion":"openjdk21_jdk", - "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999 -Dboxlang.debugMode=true" - }, - "cfconfig":{ - "file":".cfconfig.json" - }, - "env":{ - "BOXLANG_DEBUG":true - }, - "scripts":{ - "onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" - } -} diff --git a/server-adobe@2018.json b/server-lucee@6.json similarity index 76% rename from server-adobe@2018.json rename to server-lucee@6.json index 2f498c3..9457279 100644 --- a/server-adobe@2018.json +++ b/server-lucee@6.json @@ -1,8 +1,8 @@ { - "name":"cbsecurity-adobe@2018", + "name":"cbsecurity-lucee@6", "app":{ - "serverHomeDirectory":".engine/adobe2018", - "cfengine":"adobe@2018" + "serverHomeDirectory":".engine/lucee6", + "cfengine":"lucee@6" }, "web":{ "http":{ diff --git a/test-harness/tests/Application.cfc b/test-harness/tests/Application.cfc index ea12dfe..8ba0b8d 100644 --- a/test-harness/tests/Application.cfc +++ b/test-harness/tests/Application.cfc @@ -52,7 +52,7 @@ component { // If hitting the runner or specs, prep our virtual app if ( getBaseTemplatePath().replace( expandPath( "/tests" ), "" ).reFindNoCase( "(runner|specs)" ) ) { - request.coldBoxVirtualApp.startup(); + request.coldBoxVirtualApp.startup( true ); } return true; From 60259f7c35a4d7d1bf267898188e296bd4d245bd Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Tue, 25 Feb 2025 13:32:42 -0500 Subject: [PATCH 15/18] restore database to tests --- .github/workflows/tests.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c01b7cb..6ca8fd9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,12 +42,13 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - # DATABASE SETUP: uncomment if you need to setup a database - # - name: Setup Database and Fixtures - # run: | - # sudo systemctl start mysql.service - # mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;' - # mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql + - name: Setup Database and Fixtures + run: | + sudo systemctl start mysql.service + # Create Database + mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE cbsecurity;' + # Import Database + mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/cbsecurity.sql - name: Setup Java uses: actions/setup-java@v4 From 284dca1ccff14b6b0571a166342161a542b13b77 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Tue, 25 Feb 2025 14:28:12 -0500 Subject: [PATCH 16/18] BL testing - still failing due to Jakarta upgrade and jwt-cfml incorrect java constructor --- box.json | 2 +- server-boxlang-cfml@1.json | 11 +++++------ test-harness/box.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/box.json b/box.json index d72458c..f5a2254 100644 --- a/box.json +++ b/box.json @@ -47,7 +47,7 @@ "format":"cfformat run handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc --overwrite", "format:watch":"cfformat watch handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc ./.cfformat.json", "format:check":"cfformat check handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc", - "install:dependencies":"install && cd test-harness && install", + "install:dependencies":"install --force && cd test-harness && install --force", "start:lucee":"server start serverConfigFile=server-lucee@5.json", "start:2023":"server start serverConfigFile=server-adobe@2023.json", "stop:lucee":"server stop serverConfigFile=server-lucee@5.json", diff --git a/server-boxlang-cfml@1.json b/server-boxlang-cfml@1.json index 9c40aca..50158b5 100644 --- a/server-boxlang-cfml@1.json +++ b/server-boxlang-cfml@1.json @@ -1,5 +1,5 @@ { - "name":"cbsecurity-boxlang@1", + "name":"cbsecurity-boxlang-cfml@1", "app":{ "serverHomeDirectory":".engine/boxlang", "cfengine":"boxlang@be" @@ -11,8 +11,8 @@ "rewrites":{ "enable":"true" }, - "webroot": "test-harness", - "aliases":{ + "webroot":"test-harness", + "aliases":{ "/moduleroot/cbsecurity":"../" } }, @@ -21,12 +21,11 @@ "javaVersion":"openjdk21_jre", "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888" }, - "openBrowser":"false", + "openBrowser":"false", "cfconfig":{ "file":".cfconfig.json" }, - "env":{ - }, + "env":{}, "scripts":{ "onServerInitialInstall":"install bx-compat-cfml,bx-esapi,bx-mysql --noSave" } diff --git a/test-harness/box.json b/test-harness/box.json index 962ab29..629a8ca 100644 --- a/test-harness/box.json +++ b/test-harness/box.json @@ -5,7 +5,7 @@ "private":true, "description":"", "dependencies":{ - "coldbox":"^7.0.0", + "coldbox":"^7", "BCrypt":"^3.1.0+4" }, "devDependencies":{ From f92b95f0ed22797e9faa387555ad89e5079aad18 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Fri, 21 Mar 2025 13:04:01 -0400 Subject: [PATCH 17/18] change to use ISO instead of textual dates for localization support in BL --- models/jwt/JwtService.cfc | 6 +++--- test-harness/handlers/Public.cfc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/models/jwt/JwtService.cfc b/models/jwt/JwtService.cfc index 9701896..5fc06d4 100644 --- a/models/jwt/JwtService.cfc +++ b/models/jwt/JwtService.cfc @@ -163,7 +163,7 @@ component accessors="true" singleton threadsafe { /** * Logout a user and invalidate their access token * - * @user + * @user * @customClaims */ function logout(){ @@ -652,7 +652,7 @@ component accessors="true" singleton threadsafe { function toEpoch( required target ){ return dateDiff( "s", - dateConvert( "utc2local", "January 1 1970 00:00" ), + dateConvert( "utc2local", "1970-01-01T00:00:00Z" ), arguments.target ); } @@ -666,7 +666,7 @@ component accessors="true" singleton threadsafe { return dateAdd( "s", arguments.target, // should be in utc - dateConvert( "utc2local", "January 1 1970 00:00" ) + dateConvert( "utc2local", "1970-01-01T00:00:00Z" ) ); } diff --git a/test-harness/handlers/Public.cfc b/test-harness/handlers/Public.cfc index 529a439..9114e79 100644 --- a/test-harness/handlers/Public.cfc +++ b/test-harness/handlers/Public.cfc @@ -37,11 +37,11 @@ component { } function toEpoch( required target ){ - return dateDiff( "s", dateConvert( "utc2local", "January 1 1970 00:00" ), arguments.target ); + return dateDiff( "s", dateConvert( "utc2local", "1970-01-01T00:00:00Z" ), arguments.target ); } function fromEpoch( required target ){ - return dateAdd( "s", arguments.target, dateConvert( "utc2local", "January 1 1970 00:00" ) ); + return dateAdd( "s", arguments.target, dateConvert( "utc2local", "1970-01-01T00:00:00Z" ) ); } } From cc70e4bdfc9113328634ee318a22449a258eb19b Mon Sep 17 00:00:00 2001 From: jclausen <5255645+jclausen@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:04:44 +0000 Subject: [PATCH 18/18] Apply cfformat changes --- models/jwt/JwtService.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/jwt/JwtService.cfc b/models/jwt/JwtService.cfc index 5fc06d4..aa1ad37 100644 --- a/models/jwt/JwtService.cfc +++ b/models/jwt/JwtService.cfc @@ -163,7 +163,7 @@ component accessors="true" singleton threadsafe { /** * Logout a user and invalidate their access token * - * @user + * @user * @customClaims */ function logout(){