This is an automated email from the ASF dual-hosted git repository.
deacon-mp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/caldera.git
The following commit(s) were added to refs/heads/master by this push:
new cdb9e2ef Prepare the 5.4.0 release (#3435)
cdb9e2ef is described below
commit cdb9e2ef2c77ec4b24e137dbcbda5ecf26c561d2
Author: deacon-mp <[email protected]>
AuthorDate: Thu Nov 19 21:24:37 2026 -0500
Prepare the 5.4.0 release (#3435)
Prepare the tree for Apache Caldera 5.4.0 (incubating), the first release
under the ASF.
- LICENSE: restore the Apache License 2.0 appendix and list the bundled
third-party components in static/, with their license texts under licenses/.
- Replace DISCLAIMER with the Incubator's DISCLAIMER-WIP, and add
SECURITY.md.
- Move ldap3 to requirements-ldap.txt and svglib to
requirements-debrief.txt (both LGPL 3.0). ldap3 is imported only on the LDAP
login path; if LDAP is configured and ldap3 is missing, the server logs an
error naming the file and refuses LDAP logins. tox installs
requirements-ldap.txt, and pip-audit checks both files.
- Add tools/release/make-source-release.sh, which builds the source
release, signs it, checks it and lists the pinned plugin revisions in
plugin-revisions.txt, and RELEASING.md, which describes the release process.
- Docker images are published only by manual dispatch after a release vote,
from a release tag, with the publish actions pinned to ASF-approved releases, a
checksum-verified Go download and labels taken from the tag.
- README: how to fetch the plugins for an unpacked source archive, the
optional requirements in the installation steps, and how to add them to a
Docker image.
- Set the version to 5.4.0, remove the empty caltack entry from
.gitmodules, and update the training and fieldmanual plugin pins.
---
.github/workflows/publish_docker_image.yml | 62 +++++++++--
.gitignore | 3 +
.gitmodules | 3 -
DISCLAIMER | 10 --
DISCLAIMER-WIP | 50 +++++++++
Dockerfile | 11 +-
LICENSE | 134 +++++++++++++++++++++-
README.md | 39 +++++++
RELEASING.md | 143 ++++++++++++++++++++++++
SECURITY.md | 18 +++
app/service/login_handlers/default.py | 16 ++-
app/version.py | 2 +-
licenses/LICENSE-alpinejs.txt | 21 ++++
licenses/LICENSE-bulma-toast.txt | 21 ++++
licenses/LICENSE-bulma-tooltip.txt | 21 ++++
licenses/LICENSE-bulma.txt | 21 ++++
licenses/LICENSE-canvas-confetti.txt | 15 +++
licenses/LICENSE-font-awesome.txt | 157 ++++++++++++++++++++++++++
licenses/LICENSE-jquery-1.12.4.txt | 36 ++++++
licenses/LICENSE-jquery-3.3.1.txt | 36 ++++++
licenses/LICENSE-jquery-ui.txt | 43 ++++++++
licenses/LICENSE-minireset.txt | 21 ++++
licenses/LICENSE-multi-select.txt | 13 +++
licenses/LICENSE-muuri.txt | 21 ++++
plugins/fieldmanual | 2 +-
plugins/training | 2 +-
requirements-debrief.txt | 5 +
requirements-ldap.txt | 6 +
requirements.txt | 3 -
tests/services/test_default_login_handler.py | 117 ++++++++++++++++++++
tools/release/make-source-release.sh | 159 +++++++++++++++++++++++++++
tox.ini | 3 +
32 files changed, 1179 insertions(+), 35 deletions(-)
diff --git a/.github/workflows/publish_docker_image.yml
b/.github/workflows/publish_docker_image.yml
index 7ffef377..fa17edfd 100644
--- a/.github/workflows/publish_docker_image.yml
+++ b/.github/workflows/publish_docker_image.yml
@@ -1,9 +1,25 @@
name: Create and publish a Docker image
+# Docker images are convenience binaries of an ASF release, so they are only
+# published after the release vote has passed. The workflow is started by
+# hand for a final release tag and asks for the vote result link; creating a
+# GitHub release or prerelease does not publish an image.
on:
- release:
- types: [published]
workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Release tag to build, for example 5.4.0 (final releases
only, no -rc suffix)'
+ required: true
+ type: string
+ vote_result_url:
+ description: 'lists.apache.org link to the [RESULT][VOTE] thread that
approved this release'
+ required: true
+ type: string
+ latest:
+ description: 'Also tag the images as latest and slim-latest'
+ required: true
+ type: boolean
+ default: true
permissions:
contents: read
@@ -20,13 +36,29 @@ jobs:
packages: write
steps:
+ - name: Check release inputs
+ env:
+ TAG: ${{ inputs.tag }}
+ VOTE_RESULT_URL: ${{ inputs.vote_result_url }}
+ run: |
+ if ! [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "::error::tag must be a final release version such as 5.4.0,
got '$TAG'"
+ exit 1
+ fi
+ if ! [[ "$VOTE_RESULT_URL" =~ ^https://lists\.apache\.org/ ]]; then
+ echo "::error::vote_result_url must be a https://lists.apache.org/
link to the vote result"
+ exit 1
+ fi
+ echo "Publishing images for $TAG, approved in $VOTE_RESULT_URL" >>
"$GITHUB_STEP_SUMMARY"
+
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
+ ref: refs/tags/${{ inputs.tag }}
submodules: recursive
- name: Log in to the Container registry
- uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
+ uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 #
v4.8.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -34,16 +66,20 @@ jobs:
- name: Extract metadata (tags, labels) for Docker (slim variant)
id: meta-slim
- uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
+ uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
# v6.2.0
with:
+ # Take the ref and commit for the labels from the checked-out
+ # release tag, not from the ref the workflow was started on.
+ context: git
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
- latest=auto
- prefix=slim-,onlatest=true
- suffix=
+ latest=false
+ tags: |
+ type=raw,value=slim-${{ inputs.tag }}
+ type=raw,value=slim-latest,enable=${{ inputs.latest }}
- name: Build and push Docker image (slim)
- uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
+ uses:
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
push: true
@@ -54,12 +90,18 @@ jobs:
- name: Extract metadata (tags, labels) for Docker (full variant)
id: meta-full
- uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
+ uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
# v6.2.0
with:
+ context: git # as for the slim variant
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ flavor: |
+ latest=false
+ tags: |
+ type=raw,value=${{ inputs.tag }}
+ type=raw,value=latest,enable=${{ inputs.latest }}
- name: Build and push Docker image (full)
- uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
+ uses:
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
push: true
diff --git a/.gitignore b/.gitignore
index fc7841ed..24a1678b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,6 @@ htmlcov/
.coverage.*
*,cover
_*/
+
+# source release output (tools/release/make-source-release.sh)
+/dist/
diff --git a/.gitmodules b/.gitmodules
index 13322c63..209d1fc4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -7,9 +7,6 @@
[submodule "plugins/ssl"]
path = plugins/ssl
url = https://github.com/mitre/ssl.git
-[submodule "plugins/caltack"]
- path = plugins/caltack
- url = https://github.com/mitre/caltack.git
[submodule "plugins/compass"]
path = plugins/compass
url = https://github.com/mitre/compass.git
diff --git a/DISCLAIMER b/DISCLAIMER
deleted file mode 100644
index b408600c..00000000
--- a/DISCLAIMER
+++ /dev/null
@@ -1,10 +0,0 @@
-Apache Caldera (incubating) is an effort undergoing incubation at the Apache
-Software Foundation (ASF), sponsored by the Apache Incubator PMC.
-
-Incubation is required of all newly accepted projects until a further review
-indicates that the infrastructure, communications, and decision making process
-have stabilized in a manner consistent with other successful ASF projects.
-
-While incubation status is not necessarily a reflection of the completeness
-or stability of the code, it does indicate that the project has yet to be
-fully endorsed by the ASF.
diff --git a/DISCLAIMER-WIP b/DISCLAIMER-WIP
new file mode 100644
index 00000000..d76b75dd
--- /dev/null
+++ b/DISCLAIMER-WIP
@@ -0,0 +1,50 @@
+Apache Caldera (incubating) is an effort undergoing incubation at The Apache
+Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision-making process have
+stabilized in a manner consistent with other successful ASF projects. While
+incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+Some of the incubating project's releases may not be fully compliant with ASF
+policy. For example, releases may have incomplete or un-reviewed licensing
+conditions. What follows is a list of issues the project is currently aware
+of (this list is likely to be incomplete):
+
+ - Source files do not yet carry the ASF source header, and the build has no
+ Apache RAT configuration to check headers and licenses.
+
+ - The source release bundles the Font Awesome Free 5.15.3 web fonts
+ (static/css/webfonts/), which are under the SIL Open Font License 1.1.
+ ASF policy treats this license as Category B, which is meant for
+ convenience binaries rather than source releases.
+
+ - The source release bundles third-party JavaScript and CSS in minified form
+ without the matching unminified source: static/js/lib/alpine.min.js,
+ bulma-toast.min.js, confetti.browser.min.js and muuri.min.js;
+ static/jquery/jquery.min.js; static/css/lib/bulma-tooltip.min.css and
+ fa-all.min.css. alpine.min.js and confetti.browser.min.js carry no
+ copyright or license notice, and the others carry only a short banner;
+ LICENSE and the licenses/ directory supply the full notices.
+ static/css/lib/custom-bulma.css and its .map file are generated from the
+ Sass sources under static/scss/.
+
+ - Some bundled third-party files have been modified locally
+ (static/jquery/jquery.multi-select.js, static/css/multi-select.css,
+ static/css/lib/bulma-tooltip.min.css), and static/jquery/jquery.min.js
+ has been reformatted. LICENSE identifies them.
+
+ - The origin and license of the images under static/img/ have not been
+ reviewed. Some of them are operating system logos that are trademarks of
+ their owners.
+
+ - Plugins, including the web interface (magma), are git submodules hosted
+ outside the ASF. They are not part of this source release and have not
+ been reviewed for it. conf/default.yml enables several of them.
+
+If you are planning to incorporate this work into your product/project,
+please be aware that you will need to conduct a thorough licensing review to
+determine the overall implications of including this work. For the current
+status of this project through the Apache Incubator, visit:
+https://incubator.apache.org/projects/caldera.html
diff --git a/Dockerfile b/Dockerfile
index b9085b34..8db50d41 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -43,9 +43,14 @@ RUN apt-get update && \
apt-get --no-install-recommends -y install git curl unzip python3-dev
python3-pip mingw-w64 zlib1g gcc && \
rm -rf /var/lib/apt/lists/*
-# Install Golang from source (apt version is too out-of-date)
-RUN curl -k -L https://go.dev/dl/go1.25.0.linux-amd64.tar.gz -o
go1.25.0.linux-amd64.tar.gz && \
-tar -C /usr/local -xzf go1.25.0.linux-amd64.tar.gz && rm
go1.25.0.linux-amd64.tar.gz
+# Install Go from the official release archive (the apt version is too
out-of-date).
+# The archive is checked against the SHA-256 listed for it on
https://go.dev/dl/
+# before it is unpacked; update both values together.
+ARG GO_VERSION=1.25.0
+ARG GO_SHA256=2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613
+RUN curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
-o /tmp/go.tar.gz && \
+echo "${GO_SHA256} /tmp/go.tar.gz" | sha256sum -c - && \
+tar -C /usr/local -xzf /tmp/go.tar.gz && rm /tmp/go.tar.gz
ENV PATH="$PATH:/usr/local/go/bin"
RUN go version
diff --git a/LICENSE b/LICENSE
index 2bb9ad24..1678009c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -173,4 +173,136 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
- END OF TERMS AND CONDITIONS
\ No newline at end of file
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+================================================================================
+APACHE CALDERA (INCUBATING) SUBCOMPONENTS
+================================================================================
+
+This product bundles the third-party components listed below. Each component
+is available under the license named in its entry. The full license texts are
+in the licenses/ directory, at the path given in each entry.
+
+Plugins are not part of this source release: they are git submodules and
+`git archive` does not include them.
+
+--------------------------------------------------------------------------------
+MIT License
+--------------------------------------------------------------------------------
+
+jQuery 1.12.4 (includes Sizzle)
+ Files: static/jquery/jquery.js
+ Notice: Copyright jQuery Foundation and other contributors
+ License: licenses/LICENSE-jquery-1.12.4.txt
+
+jQuery 3.3.1 (includes Sizzle)
+ Files: static/jquery/jquery.min.js
+ Notice: Copyright JS Foundation and other contributors
+ License: licenses/LICENSE-jquery-3.3.1.txt
+ Note: The minified file was reformatted after it was copied in. Its
+ one-line banner refers to jquery.org/license and does not carry
+ the license text.
+
+jQuery UI theme images (1.12.x base theme icon set; exact release not recorded)
+ Files: static/jquery/images/ui-icons_*_256x240.png
+ Notice: Copyright jQuery Foundation and other contributors
+ License: licenses/LICENSE-jquery-ui.txt
+
+Alpine.js 3.1.0
+ Files: static/js/lib/alpine.min.js
+ Notice: Copyright (c) 2019-2021 Caleb Porzio and contributors
+ License: licenses/LICENSE-alpinejs.txt
+ Note: The upstream minified build carries no copyright or license notice.
+ The bundled copy adds only an "eslint-disable" comment.
+
+Bulma 0.9.2 (includes minireset.css 0.0.6)
+ Files: static/scss/bulma/** (Sass sources)
+ static/css/lib/custom-bulma.css and custom-bulma.css.map (compiled
+ from the Bulma sources and static/scss/custom-bulma.sass)
+ Notice: Copyright (c) 2020 Jeremy Thomas (Bulma);
+ Copyright (c) 2016 Jeremy Thomas (minireset.css)
+ License: licenses/LICENSE-bulma.txt, licenses/LICENSE-minireset.txt
+
+bulma-toast 2.3.1
+ Files: static/js/lib/bulma-toast.min.js
+ Notice: Copyright (c) 2018 Rafael Franco
+ License: licenses/LICENSE-bulma-toast.txt
+ Note: The minified banner names the MIT License but does not carry the
+ license text.
+
+@creativebulma/bulma-tooltip 1.2.0
+ Files: static/css/lib/bulma-tooltip.min.css
+ Notice: Copyright (c) 2020 CreativeBulma
+ License: licenses/LICENSE-bulma-tooltip.txt
+ Note: Modified locally (one white-space value). The minified banner names
+ the MIT License but does not carry the license text.
+
+Muuri 0.8.0
+ Files: static/js/lib/muuri.min.js
+ Notice: Copyright (c) 2015-present, Haltu Oy;
+ Copyright (c) 2016-present, Niklas Rämö
+ License: licenses/LICENSE-muuri.txt
+
+Font Awesome Free 5.15.3 (CSS)
+ Files: static/css/lib/fa-all.min.css
+ Notice: Copyright (c) Font Awesome
+ License: licenses/LICENSE-font-awesome.txt
+
+--------------------------------------------------------------------------------
+ISC License
+--------------------------------------------------------------------------------
+
+canvas-confetti 1.5.1
+ Files: static/js/lib/confetti.browser.min.js
+ Notice: Copyright (c) 2020, Kiril Vatev
+ License: licenses/LICENSE-canvas-confetti.txt
+ Note: This file was minified by the jsDelivr CDN from
+ dist/confetti.browser.js. Neither file carries the copyright
+ or license notice.
+
+--------------------------------------------------------------------------------
+WTFPL, Version 2
+--------------------------------------------------------------------------------
+
+MultiSelect (lou/multi-select) 0.9.12
+ Files: static/jquery/jquery.multi-select.js (modified locally)
+ static/css/multi-select.css (modified locally from the upstream
+ css/multi-select.css)
+ Notice: Copyright (c) 2012 Louis Cuny
+ License: licenses/LICENSE-multi-select.txt
+
+--------------------------------------------------------------------------------
+SIL Open Font License 1.1
+--------------------------------------------------------------------------------
+
+Font Awesome Free 5.15.3 (web fonts)
+ Files: static/css/webfonts/fa-brands-400.*, fa-regular-400.*,
+ fa-solid-900.* (eot, svg, ttf, woff, woff2)
+ Notice: Copyright (c) Font Awesome
+ License: licenses/LICENSE-font-awesome.txt
diff --git a/README.md b/README.md
index e8d5a1ca..0c30ea9e 100644
--- a/README.md
+++ b/README.md
@@ -77,6 +77,7 @@ Concise installation steps:
git clone https://github.com/apache/caldera.git --recursive
cd caldera
pip3 install -r requirements.txt
+pip3 install -r requirements-debrief.txt # optional: PDF reports in the
debrief plugin
python3 server.py --insecure --build
```
@@ -86,11 +87,34 @@ Start by cloning this repository recursively, passing the
desired version/releas
git clone https://github.com/apache/caldera.git --recursive --branch x.x.x
```
+If you start from the source release archive
(`apache-caldera-x.x.x-incubating-src.tar.gz`) instead of a clone, note that it
holds the core framework only. The plugin directories in it are empty, and the
server needs the plugins to start. The file `plugin-revisions.txt` in the
archive lists the repository and the exact commit of each plugin for that
release. To fetch them, run this in the top directory of the unpacked archive:
+```Bash
+grep -v '^#' plugin-revisions.txt | while read -r path commit url; do
+ if [ ! -d "$path/.git" ]; then
+ git clone "$url" "$path" || exit 1
+ fi
+ git -C "$path" checkout --detach "$commit" || exit 1
+done
+```
+If a plugin cannot be fetched, the loop stops with an error. Run it again to
continue: plugins that were already cloned are reused. The recursive clone of
the same version gives the same plugin commits.
+
Next, install the PIP requirements:
```Bash
pip3 install -r requirements.txt
```
+LDAP login is optional. To use it, also install the LDAP requirements, which
are kept in a separate file because the `ldap3` package is licensed under the
LGPL 3.0:
+```Bash
+pip3 install -r requirements-ldap.txt
+```
+
+The debrief plugin, which `conf/default.yml` enables, needs the `svglib`
package to build PDF reports. It is kept in a separate file because it is
licensed under the LGPL 3.0:
+```Bash
+pip3 install -r requirements-debrief.txt
+```
+
+These two commands apply to an installation on the host. The Docker images do
not include either set of packages. See [Docker
Installation](#docker-installation) for how to add them to an image.
+
Finally, start the server.
```Bash
python3 server.py --insecure --build
@@ -131,6 +155,21 @@ docker stop <container ID>
There are two variants available, *full* and *slim*. The *slim* variant
doesn't include files necessary for the `emu` and `atomic` plugins, which will
be downloaded on-demand if the plugins are ever enabled. The *full* variant is
suitable for operation in environments without an internet connection. Slim
images on GHCR are prefixed with "slim".
+The Docker images of version 5.4.0 and later install `requirements.txt` but
not the optional `requirements-ldap.txt` and `requirements-debrief.txt`, which
LDAP login and the PDF reports of the debrief plugin need. Installing those
packages on the host does not add them to a container. To use these features
with Docker, build your own image on top of a Caldera image and install the
files you need. Both files are in the image's working directory,
`/usr/src/app`. Save the following as `Dock [...]
+```Dockerfile
+FROM ghcr.io/apache/caldera:latest
+# LDAP login
+RUN pip3 install --break-system-packages --no-cache-dir -r
requirements-ldap.txt
+# PDF reports of the debrief plugin
+RUN pip3 install --break-system-packages --no-cache-dir -r
requirements-debrief.txt
+```
+Then build and run it:
+```sh
+docker build -t caldera-extended -f Dockerfile.extended .
+docker run -it -p 8888:8888 caldera-extended
+```
+To extend an image that you built locally, use its name in the `FROM` line,
for example `FROM caldera`.
+
**Docker Container Notes**
- The Caldera container will automatically generate keys/usernames/password on
first start.
- If you wish to override the default configuration or avoid automatically
generated keys/passwords, consider bind-mounting your own configuration file
with the `-v <your_path>/conf.yml:/usr/src/app/conf/local.yml` flag.
diff --git a/RELEASING.md b/RELEASING.md
new file mode 100644
index 00000000..2fba48c5
--- /dev/null
+++ b/RELEASING.md
@@ -0,0 +1,143 @@
+# Releasing Apache Caldera (incubating)
+
+This is the checklist for a release manager (RM). An ASF release is the
+signed source archive. Docker images and other builds are convenience
+binaries made from an approved release.
+
+Policies this follows:
+
+- Incubator release policy:
<https://incubator.apache.org/policy/incubation.html#releases>
+- Podling release guide:
<https://incubator.apache.org/guides/releasemanagement.html>
+- ASF release policy: <https://www.apache.org/legal/release-policy.html>
+- Release distribution: <https://infra.apache.org/release-distribution.html>
+- Third-party licenses: <https://www.apache.org/legal/resolved.html>
+
+## One-time setup
+
+- **Distribution directories.** Release candidates are staged in
+ `https://dist.apache.org/repos/dist/dev/incubator/caldera/`, and approved
+ releases go to
`https://dist.apache.org/repos/dist/release/incubator/caldera/`
+ (served from `https://downloads.apache.org/incubator/caldera/`). If either
+ directory is missing, ask the mentors or open an INFRA ticket.
+- **Signing key.** Use an RSA key of 4096 bits (at least 2048), created and
+ kept on your own machine. Never create or store it on ASF hardware. Add its
+ fingerprint to your profile at <https://id.apache.org> and publish it to a
+ public keyserver.
+- **KEYS.** Append your public key to the `KEYS` file in the release
+ directory before you sign anything:
+
+ ```sh
+ svn checkout --depth files
https://dist.apache.org/repos/dist/release/incubator/caldera caldera-release
+ cd caldera-release
+ (gpg --list-sigs <KEY_ID> && gpg --armor --export <KEY_ID>) >> KEYS
+ svn add --force KEYS # needed when KEYS is new; no effect when it is
already versioned
+ svn commit -m "Add <your name>'s key to KEYS" KEYS
+ ```
+
+ Never remove a key that signed a release that is still available.
+
+## 1. Prepare the release
+
+- Set `__version__` in `app/version.py` to the release version.
+- Check that `LICENSE`, `NOTICE` and `DISCLAIMER-WIP` (or `DISCLAIMER`) are
+ current. `LICENSE` must list every bundled third-party file, with license
+ texts under `licenses/`, and the release must not contain Category X
+ material or compiled code.
+- Run the test suite.
+- Write the release notes.
+
+## 2. Tag and build the release candidate
+
+```sh
+git tag -s 5.4.0-rc1 -m "Apache Caldera (incubating) 5.4.0 RC1"
+git push origin 5.4.0-rc1
+tools/release/make-source-release.sh 5.4.0 5.4.0-rc1
+```
+
+The script writes these files to `dist/5.4.0/`:
+
+- `apache-caldera-5.4.0-incubating-src.tar.gz`
+- `apache-caldera-5.4.0-incubating-src.tar.gz.asc`
+- `apache-caldera-5.4.0-incubating-src.tar.gz.sha512`
+
+The archive holds the tracked files of the core repository at the tag, plus
+one generated file, `plugin-revisions.txt`. Plugin submodules are not part of
+the source release, so their directories are empty in the archive.
+`plugin-revisions.txt` lists the path, pinned commit and repository URL of
+each one, read from `.gitmodules` and the submodule entries of the tag, so
+that the same plugins can be fetched for an unpacked archive. The
+installation steps in `README.md` show how. Set `GPG_KEY` to choose the
+signing key. `--no-sign` gives a dry run that cannot be released.
+
+## 3. Stage the release candidate
+
+```sh
+svn checkout --depth empty
https://dist.apache.org/repos/dist/dev/incubator/caldera caldera-dev
+cd caldera-dev
+mkdir 5.4.0-rc1
+cp /path/to/caldera/dist/5.4.0/apache-caldera-5.4.0-incubating-src.tar.gz*
5.4.0-rc1/
+svn add 5.4.0-rc1
+svn commit -m "Stage Apache Caldera (incubating) 5.4.0 RC1"
+```
+
+The Apache Trusted Releases platform (<https://releases.apache.org>, in beta)
+can stage and publish the files instead.
+
+## 4. Vote
+
+A podling release needs two votes, which can run one after the other or at
+the same time. Each vote stays open for at least 72 hours.
+
+1. **PPMC vote** on [email protected]. It passes with at least three +1
+ votes from PPMC members and more +1 than -1 votes from PPMC members.
+2. **IPMC vote** on [email protected]. It passes with at least
+ three binding +1 votes from Incubator PMC members and more binding +1 than
+ binding -1 votes.
+
+Each `[VOTE]` email gives the tag and its commit id, the staging URL, the
+KEYS URL, the SHA-512 checksum, the release notes, and the voting period.
+Reviewers check:
+
+```sh
+gpg --import KEYS
+gpg --verify apache-caldera-5.4.0-incubating-src.tar.gz.asc
apache-caldera-5.4.0-incubating-src.tar.gz
+sha512sum --check apache-caldera-5.4.0-incubating-src.tar.gz.sha512
+```
+
+They also check that the file name includes "incubating", that LICENSE,
+NOTICE and the disclaimer are present and correct, that the archive matches
+the tag, and that the tests run. The only file in the archive that is not in
+the tag is `plugin-revisions.txt`; its entries match the output of
+`git ls-tree 5.4.0-rc1 plugins/`. The server, and the tests that use plugin
+files, need the plugins. Fetch them into the unpacked archive as `README.md`
+describes, or clone the tag with `--recursive`, which gives the same commits.
+
+Close each vote with a `[RESULT][VOTE]` email that lists the votes. If the
+candidate fails, fix the problems, tag `5.4.0-rc2` and start again from step 2.
+
+## 5. Publish
+
+After both votes pass:
+
+```sh
+svn mv https://dist.apache.org/repos/dist/dev/incubator/caldera/5.4.0-rc1 \
+ https://dist.apache.org/repos/dist/release/incubator/caldera/5.4.0 \
+ -m "Release Apache Caldera (incubating) 5.4.0"
+git tag -s 5.4.0 5.4.0-rc1^{} -m "Apache Caldera (incubating) 5.4.0"
+git push origin 5.4.0
+```
+
+- Wait at least an hour for the CDN, then update the download page. Link the
+ archive through
`https://www.apache.org/dyn/closer.lua/incubator/caldera/5.4.0/...`,
+ and link the `.asc`, `.sha512` and `KEYS` files on
+ `https://downloads.apache.org/incubator/caldera/`.
+- Create the GitHub release for the tag.
+- Publish the Docker images by running the "Create and publish a Docker
+ image" workflow by hand with the release tag and the link to the IPMC
+ `[RESULT][VOTE]` email.
+- Announce the release from your @apache.org address to [email protected]
+ (moderated, so it can take hours to appear), with copies to
+ [email protected] and [email protected]. Link the download
+ page rather than the files, and include the incubation disclaimer.
+- Remove releases that are no longer current from the release directory.
+ They stay available on <https://archive.apache.org/dist/incubator/caldera/>.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..647f7d85
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,18 @@
+# Security Policy
+
+Apache Caldera (incubating) follows the security process of the Apache
+Software Foundation (ASF).
+
+## Reporting a security issue
+
+Report security issues privately by email to
+[[email protected]](mailto:[email protected]). The ASF Security Team
+passes each report to the project's private mailing list.
+
+Do not report security issues in public GitHub issues, pull requests,
+discussions or mailing lists.
+
+For how the process works and what a report should contain, see:
+
+- <https://www.apache.org/security/>
+- <https://security.apache.org/>
diff --git a/app/service/login_handlers/default.py
b/app/service/login_handlers/default.py
index b26faf22..ea7fede5 100644
--- a/app/service/login_handlers/default.py
+++ b/app/service/login_handlers/default.py
@@ -1,14 +1,15 @@
+import importlib.util
import logging
-import ldap3
from aiohttp import web
from aiohttp_jinja2 import render_template
-from ldap3.core.exceptions import LDAPAttributeError, LDAPException
from app.service.interfaces.i_login_handler import LoginHandlerInterface
from app.utility.config_util import verify_hash
HANDLER_NAME = 'Default Login Handler'
+LDAP_PACKAGE_MISSING = ('LDAP login is configured, but the optional "ldap3"
package is not installed. '
+ 'Install it with: pip install -r
requirements-ldap.txt')
class DefaultLoginHandler(LoginHandlerInterface):
@@ -16,6 +17,8 @@ class DefaultLoginHandler(LoginHandlerInterface):
super().__init__(services, HANDLER_NAME)
self.log = logging.getLogger('default_login_handler')
self._ldap_config = self.get_config('ldap')
+ if self._ldap_config and importlib.util.find_spec('ldap3') is None:
+ self.log.error(LDAP_PACKAGE_MISSING)
async def handle_login(self, request, **kwargs):
data = await request.post()
@@ -55,6 +58,13 @@ class DefaultLoginHandler(LoginHandlerInterface):
return verify_hash(user.password, password)
async def _ldap_login(self, username, password):
+ try:
+ import ldap3
+ from ldap3.core.exceptions import LDAPException
+ except ImportError:
+ self.log.error(LDAP_PACKAGE_MISSING)
+ return False
+
server = ldap3.Server(self._ldap_config.get('server'))
dn = self._ldap_config.get('dn')
user_attr = self._ldap_config.get('user_attr') or 'uid'
@@ -78,6 +88,8 @@ class DefaultLoginHandler(LoginHandlerInterface):
return False
async def _ldap_get_group(self, connection, dn, username, user_attr):
+ from ldap3.core.exceptions import LDAPAttributeError
+
group_attr = self._ldap_config.get('group_attr') or 'objectClass'
red_group_name = self._ldap_config.get('red_group') or 'red'
diff --git a/app/version.py b/app/version.py
index 26d50e4a..d2edd14f 100644
--- a/app/version.py
+++ b/app/version.py
@@ -1,4 +1,4 @@
-__version__ = '5.3.0'
+__version__ = '5.4.0'
def get_version():
diff --git a/licenses/LICENSE-alpinejs.txt b/licenses/LICENSE-alpinejs.txt
new file mode 100644
index 00000000..c3cc2ddc
--- /dev/null
+++ b/licenses/LICENSE-alpinejs.txt
@@ -0,0 +1,21 @@
+# MIT License
+
+Copyright © 2019-2021 Caleb Porzio and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/licenses/LICENSE-bulma-toast.txt b/licenses/LICENSE-bulma-toast.txt
new file mode 100644
index 00000000..5fdddb07
--- /dev/null
+++ b/licenses/LICENSE-bulma-toast.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Rafael Franco
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/licenses/LICENSE-bulma-tooltip.txt
b/licenses/LICENSE-bulma-tooltip.txt
new file mode 100644
index 00000000..b14b7de1
--- /dev/null
+++ b/licenses/LICENSE-bulma-tooltip.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 CreativeBulma
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/licenses/LICENSE-bulma.txt b/licenses/LICENSE-bulma.txt
new file mode 100644
index 00000000..2c51c725
--- /dev/null
+++ b/licenses/LICENSE-bulma.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2020 Jeremy Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/licenses/LICENSE-canvas-confetti.txt
b/licenses/LICENSE-canvas-confetti.txt
new file mode 100644
index 00000000..d703e2ec
--- /dev/null
+++ b/licenses/LICENSE-canvas-confetti.txt
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2020, Kiril Vatev
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/licenses/LICENSE-font-awesome.txt
b/licenses/LICENSE-font-awesome.txt
new file mode 100644
index 00000000..483f9485
--- /dev/null
+++ b/licenses/LICENSE-font-awesome.txt
@@ -0,0 +1,157 @@
+Font Awesome Free License
+-------------------------
+
+Font Awesome Free is free, open source, and GPL friendly. You can use it for
+commercial projects, open source projects, or really almost whatever you want.
+Full Font Awesome Free license: https://fontawesome.com/license/free.
+
+# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
+In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
+packaged as SVG and JS file types.
+
+# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
+In the Font Awesome Free download, the SIL OFL license applies to all icons
+packaged as web and desktop font files.
+
+# Code: MIT License (https://opensource.org/licenses/MIT)
+In the Font Awesome Free download, the MIT license applies to all non-font and
+non-icon files.
+
+# Attribution
+Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
+Awesome Free files already contain embedded comments with sufficient
+attribution, so you shouldn't need to do anything additional when using these
+files normally.
+
+We've kept attribution comments terse, so we ask that you do not actively work
+to remove them from files, especially code. They're a great way for folks to
+learn about Font Awesome.
+
+# Brand Icons
+All brand icons are trademarks of their respective owners. The use of these
+trademarks does not indicate endorsement of the trademark holder by Font
+Awesome, nor vice versa. **Please do not use brand logos for any purpose except
+to represent the company, product, or service to which they refer.**
+
+
+--------------------------------------------------------------------------------
+MIT License (applies to static/css/lib/fa-all.min.css)
+--------------------------------------------------------------------------------
+
+Copyright (c) Font Awesome
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+--------------------------------------------------------------------------------
+SIL Open Font License 1.1 (applies to static/css/webfonts/*)
+--------------------------------------------------------------------------------
+
+Copyright (c) Font Awesome
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/licenses/LICENSE-jquery-1.12.4.txt
b/licenses/LICENSE-jquery-1.12.4.txt
new file mode 100644
index 00000000..5312a4c8
--- /dev/null
+++ b/licenses/LICENSE-jquery-1.12.4.txt
@@ -0,0 +1,36 @@
+Copyright jQuery Foundation and other contributors, https://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
diff --git a/licenses/LICENSE-jquery-3.3.1.txt
b/licenses/LICENSE-jquery-3.3.1.txt
new file mode 100644
index 00000000..e4e5e00e
--- /dev/null
+++ b/licenses/LICENSE-jquery-3.3.1.txt
@@ -0,0 +1,36 @@
+Copyright JS Foundation and other contributors, https://js.foundation/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
diff --git a/licenses/LICENSE-jquery-ui.txt b/licenses/LICENSE-jquery-ui.txt
new file mode 100644
index 00000000..4819e542
--- /dev/null
+++ b/licenses/LICENSE-jquery-ui.txt
@@ -0,0 +1,43 @@
+Copyright jQuery Foundation and other contributors, https://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery-ui
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code contained within the demos directory.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
diff --git a/licenses/LICENSE-minireset.txt b/licenses/LICENSE-minireset.txt
new file mode 100644
index 00000000..c322f1db
--- /dev/null
+++ b/licenses/LICENSE-minireset.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright © 2016 Jeremy Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/licenses/LICENSE-multi-select.txt
b/licenses/LICENSE-multi-select.txt
new file mode 100644
index 00000000..5c93f456
--- /dev/null
+++ b/licenses/LICENSE-multi-select.txt
@@ -0,0 +1,13 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <[email protected]>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/licenses/LICENSE-muuri.txt b/licenses/LICENSE-muuri.txt
new file mode 100644
index 00000000..f7373b30
--- /dev/null
+++ b/licenses/LICENSE-muuri.txt
@@ -0,0 +1,21 @@
+
+Copyright (c) 2015, Haltu Oy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/fieldmanual b/plugins/fieldmanual
index 5c222527..f67fef0a 160000
--- a/plugins/fieldmanual
+++ b/plugins/fieldmanual
@@ -1 +1 @@
-Subproject commit 5c222527a6a0375a973fc7500a7c14caa1d39cf6
+Subproject commit f67fef0a826947b579c4b5d60852be8fbb64ee2c
diff --git a/plugins/training b/plugins/training
index d613da99..edecb1ea 160000
--- a/plugins/training
+++ b/plugins/training
@@ -1 +1 @@
-Subproject commit d613da99791af8424763d72c0024a12491441f17
+Subproject commit edecb1ead4daf4da6eda1dee8646bd989e535945
diff --git a/requirements-debrief.txt b/requirements-debrief.txt
new file mode 100644
index 00000000..658c8d0d
--- /dev/null
+++ b/requirements-debrief.txt
@@ -0,0 +1,5 @@
+# Optional dependency for the debrief plugin, which needs it to build PDF
+# reports. It is not installed by requirements.txt because svglib is licensed
+# under the LGPL 3.0. Install it with:
+# pip install -r requirements-debrief.txt
+svglib==1.5.1
diff --git a/requirements-ldap.txt b/requirements-ldap.txt
new file mode 100644
index 00000000..a1da809d
--- /dev/null
+++ b/requirements-ldap.txt
@@ -0,0 +1,6 @@
+# Optional dependencies for LDAP login (the "ldap" section of the server
+# configuration). They are not installed by requirements.txt because ldap3 is
+# licensed under the LGPL 3.0. Install them with:
+# pip install -r requirements-ldap.txt
+ldap3==2.9.1
+pyasn1==0.6.5
diff --git a/requirements.txt b/requirements.txt
index a34dd6a3..1b9ded4d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,12 +14,9 @@ myst-parser==2.0.0
marshmallow==3.26.2
dirhash==0.2.1
marshmallow-enum==1.5.1
-ldap3==2.9.1
-pyasn1==0.6.5
reportlab==4.0.4 # debrief
rich==13.7.0
lxml==6.1.0 # debrief
-svglib==1.5.1 # debrief
Markdown==3.8.1 # training
dnspython==2.9.2
asyncssh==2.24.1
diff --git a/tests/services/test_default_login_handler.py
b/tests/services/test_default_login_handler.py
new file mode 100644
index 00000000..ec53a024
--- /dev/null
+++ b/tests/services/test_default_login_handler.py
@@ -0,0 +1,117 @@
+import importlib
+import logging
+import sys
+from unittest import mock
+
+import pytest
+from aiohttp import web
+
+import app.service.login_handlers as login_handlers
+from app.service.auth_svc import AuthService
+from app.service.login_handlers.default import DefaultLoginHandler,
LDAP_PACKAGE_MISSING
+from app.utility.base_world import BaseWorld
+
+# argon2 hash of 'testpassword'
+PASSWORD_HASH =
'$argon2id$v=19$m=65536,t=3,p=4$87lgOXDGx/9JUHuCsxlaZw$bcJp3dQcqMiYdZOCm8LLJ8ncaEwjoS1xVcPHUGs/ajU'
+LDAP_CONFIG = {'server': 'ldap://ldap.example.test', 'dn':
'dc=example,dc=test'}
+
+
[email protected]
+def without_ldap3(monkeypatch):
+ """Make ``import ldap3`` fail, as it does when requirements-ldap.txt is
not installed."""
+ for name in [m for m in sys.modules if m == 'ldap3' or
m.startswith('ldap3.')]:
+ monkeypatch.delitem(sys.modules, name)
+ monkeypatch.setitem(sys.modules, 'ldap3', None)
+
+
[email protected]
+def local_config(monkeypatch):
+ monkeypatch.setitem(BaseWorld._app_configuration, 'main', {})
+
+
[email protected]
+def ldap_config(monkeypatch):
+ monkeypatch.setitem(BaseWorld._app_configuration, 'main', {'ldap':
dict(LDAP_CONFIG)})
+
+
[email protected]
+def auth_svc():
+ svc = mock.Mock()
+ svc.user_map = {}
+ svc.create_user = mock.AsyncMock()
+ svc.handle_successful_login = mock.AsyncMock()
+ return svc
+
+
+def make_request(username, password):
+ request = mock.Mock()
+ request.post = mock.AsyncMock(return_value={'username': username,
'password': password})
+ request.app.user_map = {'red': AuthService.User('red', PASSWORD_HASH,
('red', 'app'))}
+ return request
+
+
+def test_module_imports_without_ldap3(without_ldap3, monkeypatch):
+ monkeypatch.setattr(login_handlers, 'default', login_handlers.default)
+ monkeypatch.delitem(sys.modules, 'app.service.login_handlers.default')
+
+ module = importlib.import_module('app.service.login_handlers.default')
+
+ assert module.DefaultLoginHandler.__name__ == 'DefaultLoginHandler'
+
+
[email protected]('password, accepted', [('testpassword', True),
('wrongpassword', False)])
+async def test_local_login_without_ldap3(without_ldap3, local_config,
auth_svc, password, accepted, caplog):
+ handler = DefaultLoginHandler({'auth_svc': auth_svc})
+ request = make_request('red', password)
+
+ with pytest.raises(web.HTTPFound):
+ await handler.handle_login(request)
+
+ if accepted:
+ auth_svc.handle_successful_login.assert_awaited_once_with(request,
'red')
+ else:
+ auth_svc.handle_successful_login.assert_not_awaited()
+ assert LDAP_PACKAGE_MISSING not in caplog.text
+
+
+def test_ldap_config_without_ldap3_logs_error_at_startup(without_ldap3,
ldap_config, auth_svc, caplog):
+ with caplog.at_level(logging.ERROR, logger='default_login_handler'):
+ DefaultLoginHandler({'auth_svc': auth_svc})
+
+ assert LDAP_PACKAGE_MISSING in caplog.text
+ assert 'requirements-ldap.txt' in LDAP_PACKAGE_MISSING
+
+
+async def test_ldap_login_without_ldap3_is_refused(without_ldap3, ldap_config,
auth_svc, caplog):
+ handler = DefaultLoginHandler({'auth_svc': auth_svc})
+ caplog.clear()
+ # Valid local credentials must not be used in place of the configured LDAP
login.
+ request = make_request('red', 'testpassword')
+
+ with caplog.at_level(logging.ERROR, logger='default_login_handler'):
+ with pytest.raises(web.HTTPFound):
+ await handler.handle_login(request)
+
+ auth_svc.handle_successful_login.assert_not_awaited()
+ auth_svc.create_user.assert_not_awaited()
+ assert LDAP_PACKAGE_MISSING in caplog.text
+
+
+async def test_ldap_login_with_ldap3_installed(ldap_config, auth_svc,
monkeypatch):
+ ldap3 = pytest.importorskip('ldap3')
+ connection = mock.MagicMock()
+ connection.__enter__.return_value = connection
+ connection.bind.return_value = True
+ connection.entries = [{'objectClass': mock.Mock(value=['top', 'red'])}]
+ connection_class = mock.Mock(return_value=connection)
+ monkeypatch.setattr(ldap3, 'Server', mock.Mock())
+ monkeypatch.setattr(ldap3, 'Connection', connection_class)
+ handler = DefaultLoginHandler({'auth_svc': auth_svc})
+ request = make_request('alice', 'ldappassword')
+
+ with pytest.raises(web.HTTPFound):
+ await handler.handle_login(request)
+
+ connection_class.assert_called_once_with(mock.ANY,
user='uid=alice,dc=example,dc=test', password='ldappassword')
+ auth_svc.create_user.assert_awaited_once_with('alice', None, 'red')
+ auth_svc.handle_successful_login.assert_awaited_once_with(request, 'alice')
diff --git a/tools/release/make-source-release.sh
b/tools/release/make-source-release.sh
new file mode 100755
index 00000000..7e64384e
--- /dev/null
+++ b/tools/release/make-source-release.sh
@@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+#
+# Build the Apache Caldera (incubating) source release from a git ref:
+# apache-caldera-<version>-incubating-src.tar.gz
+# apache-caldera-<version>-incubating-src.tar.gz.asc (detached signature)
+# apache-caldera-<version>-incubating-src.tar.gz.sha512 (checksum)
+#
+# The archive is made with `git archive`, so it holds exactly the tracked
+# files of the core repository at that ref, plus one generated file,
+# plugin-revisions.txt. Plugin submodules are not part of the source release
+# and are not included: their directories are empty in the archive, and
+# plugin-revisions.txt lists the path, pinned commit and URL of each one so
+# that the matching plugins can be fetched (see README.md).
+#
+# Usage:
+# tools/release/make-source-release.sh [--no-sign] <version> <git-ref>
+#
+# version release version, for example 5.4.0
+# git-ref tag or commit to package, for example 5.4.0-rc1
+# --no-sign skip the signature (dry run only; the output cannot be released)
+#
+# Environment:
+# OUT_DIR output directory (default: dist/<version> under the repository
root)
+# GPG_KEY key id or fingerprint to sign with (default: gpg's default key)
+#
+# Needs git 2.28 or later (git archive --add-file).
+#
+# See RELEASING.md for how the files are staged and voted on.
+
+set -euo pipefail
+
+usage() {
+ sed -n '/^# Usage:/,/^# See RELEASING/p' "$0" | sed 's/^# \{0,1\}//'
+ exit 2
+}
+
+sign=1
+if [[ "${1:-}" == "--no-sign" ]]; then
+ sign=0
+ shift
+fi
+[[ $# -eq 2 ]] || usage
+version=$1
+ref=$2
+
+if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "error: version must look like 5.4.0, got '$version'" >&2
+ exit 2
+fi
+
+repo_root=$(git -C "$(dirname "$0")" rev-parse --show-toplevel)
+cd "$repo_root"
+
+commit=$(git rev-parse --verify --quiet "$ref^{commit}") || {
+ echo "error: '$ref' is not a tag or commit in $repo_root" >&2
+ exit 1
+}
+
+# The packaged tree must declare the version being released. The declaration
+# is matched as a fixed string, so the dots in the version are literal.
+if ! git show "$commit:app/version.py" | grep -qxF -- "__version__ =
'$version'"; then
+ echo "error: app/version.py at $ref does not set __version__ = '$version'"
>&2
+ exit 1
+fi
+
+for required in LICENSE NOTICE; do
+ git cat-file -e "$commit:$required" 2>/dev/null || {
+ echo "error: $required is missing at $ref" >&2
+ exit 1
+ }
+done
+if ! git cat-file -e "$commit:DISCLAIMER" 2>/dev/null && ! git cat-file -e
"$commit:DISCLAIMER-WIP" 2>/dev/null; then
+ echo "error: neither DISCLAIMER nor DISCLAIMER-WIP exists at $ref" >&2
+ exit 1
+fi
+
+name="apache-caldera-${version}-incubating"
+out_dir=${OUT_DIR:-"$repo_root/dist/$version"}
+tarball="${name}-src.tar.gz"
+mkdir -p "$out_dir"
+out_dir=$(cd "$out_dir" && pwd)
+rm -f "$out_dir/$tarball" "$out_dir/$tarball.asc" "$out_dir/$tarball.sha512"
+
+# Plugins are separate repositories that the core repository pins as
+# submodules. List each submodule of the release commit, with the commit it is
+# pinned to and its URL from .gitmodules, in a generated file for the archive.
+manifest_name=plugin-revisions.txt
+if git cat-file -e "$commit:$manifest_name" 2>/dev/null; then
+ echo "error: $manifest_name exists at $ref, but this script generates that
file" >&2
+ exit 1
+fi
+
+# Print the URL that .gitmodules at the release commit gives for a submodule
path.
+submodule_url() {
+ local key value
+ while read -r key value; do
+ if [[ "$value" == "$1" ]]; then
+ key=${key#submodule.}
+ git config --blob "$commit:.gitmodules" --get
"submodule.${key%.path}.url"
+ return
+ fi
+ done < <(git config --blob "$commit:.gitmodules" --get-regexp
'^submodule\..*\.path$')
+ return 1
+}
+
+work_dir=$(mktemp -d)
+trap 'rm -rf "$work_dir"' EXIT
+manifest="$work_dir/$manifest_name"
+plugin_count=0
+{
+ echo "# Plugin repositories pinned by Apache Caldera (incubating)
$version,"
+ echo "# commit $commit."
+ echo "# Plugins are not part of this source release. README.md describes
how to"
+ echo "# fetch them at the commits listed here."
+ echo "#"
+ echo "# <path> <commit> <url>"
+ while read -r mode _ sha path; do
+ [[ "$mode" == 160000 ]] || continue
+ url=$(submodule_url "$path") || url=
+ if [[ -z "$url" || "$path$url" =~ [[:space:]] ]]; then
+ echo "error: .gitmodules at $ref has no usable URL for the
submodule '$path'" >&2
+ exit 1
+ fi
+ echo "$path $sha $url"
+ plugin_count=$((plugin_count + 1))
+ done < <(git ls-tree -r "$commit")
+} > "$manifest"
+
+git archive --format=tar.gz --prefix="${name}/" --add-file="$manifest" \
+ --output="$out_dir/$tarball" "$commit"
+
+# A source release must not contain compiled code.
+compiled=$(tar -tzf "$out_dir/$tarball" | grep -E
'\.(exe|dll|so|dylib|jar|class|pyc|pyd|o|a)$' || true)
+if [[ -n "$compiled" ]]; then
+ echo "error: the archive contains compiled files:" >&2
+ echo "$compiled" >&2
+ exit 1
+fi
+
+cd "$out_dir"
+if command -v sha512sum >/dev/null 2>&1; then
+ sha512sum "$tarball" > "$tarball.sha512"
+ sha512sum --check --quiet "$tarball.sha512"
+else
+ shasum -a 512 "$tarball" > "$tarball.sha512"
+ shasum -a 512 --check --quiet "$tarball.sha512"
+fi
+
+if [[ $sign -eq 1 ]]; then
+ gpg --armor --detach-sign ${GPG_KEY:+--local-user "$GPG_KEY"} --output
"$tarball.asc" "$tarball"
+ gpg --verify "$tarball.asc" "$tarball"
+else
+ echo "warning: --no-sign given; $tarball is not signed and cannot be
released" >&2
+fi
+
+echo
+echo "Source release for $version built from $ref ($commit),"
+echo "with $plugin_count plugin revisions listed in $manifest_name:"
+ls -l "$out_dir/$tarball"*
diff --git a/tox.ini b/tox.ini
index 293248b3..a2d6a143 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,6 +17,7 @@ skip_missing_interpreters = true
description = run tests
deps =
-rrequirements.txt
+ -rrequirements-ldap.txt
virtualenv!=20.0.22
pre-commit
pytest
@@ -71,6 +72,8 @@ deps =
skip_install = true
commands =
pip-audit -r requirements.txt
+ pip-audit -r requirements-ldap.txt
+ pip-audit -r requirements-debrief.txt
# GHSA-6w46-j5rx-g56g (pytest tmpdir handling, fixed in pytest 9.0.3):
# pytest is a test-only tool and is not part of the release. The suite
# still uses the event_loop fixture, so pytest-asyncio stays at 0.26.x,