From 2b79f5a4f5a7198e404e17177dfe6a69e50fa2e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Tue, 23 May 2023 11:44:06 -0700
Subject: [PATCH 001/266] Use trunk
---
requirements/requirements-direct.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index e6353ccee..75b944ffa 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -5,7 +5,9 @@ cattrs==22.2.0
cryptography==40.0.2
hyperlink==21.0.0
jwcrypto==1.4.2
-klein==21.8.0
+#klein==21.8.0
+klein @ git+https://github.com/twisted/klein@trunk
+#klein @ file:///Users/wsanchez/Developer/Twisted/klein
PyMySQL==1.0.3
pyOpenSSL==23.1.1
PyYAML==6.0
From 5d78ac3cfcd68d414bbf193472874a28af3a648c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Tue, 23 May 2023 14:55:51 -0700
Subject: [PATCH 002/266] easy pickins'
---
src/ims/element/_element.py | 8 +++++---
src/ims/ext/test/test_klein.py | 2 ++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/ims/element/_element.py b/src/ims/element/_element.py
index 493a60b50..b3b885a65 100644
--- a/src/ims/element/_element.py
+++ b/src/ims/element/_element.py
@@ -176,7 +176,7 @@ def url(self, request: IRequest, tag: Tag) -> KleinRenderable:
except AttributeError:
raise ValueError(f"Unknown URL name: {name}") from None
- text = url.asText()
+ text = cast(str, url.asText())
if tag.tagName == "json":
return jsonTextFromObject(text)
@@ -245,7 +245,7 @@ def events(self, request: IRequest, tag: Tag) -> KleinRenderable:
"""
Repeat an element once for each event, embedding the event ID.
"""
- return self._events(request, tag)
+ return cast(KleinRenderable, self._events(request, tag))
@renderer
def events_reversed(self, request: IRequest, tag: Tag) -> KleinRenderable:
@@ -253,7 +253,9 @@ def events_reversed(self, request: IRequest, tag: Tag) -> KleinRenderable:
Repeat an element once for each event in reverse order, embedding the
event ID.
"""
- return self._events(request, tag, reverse_order=True)
+ return cast(
+ KleinRenderable, self._events(request, tag, reverse_order=True)
+ )
@renderer
async def events_list(self, request: IRequest, tag: Tag) -> KleinRenderable:
diff --git a/src/ims/ext/test/test_klein.py b/src/ims/ext/test/test_klein.py
index 5850b89d4..1f546b8ab 100644
--- a/src/ims/ext/test/test_klein.py
+++ b/src/ims/ext/test/test_klein.py
@@ -49,6 +49,7 @@ def test_static_etag(self) -> None:
app.root(request)
etags = request.responseHeaders.getRawHeaders("etag")
+ assert etags is not None
self.assertTrue(len(etags) == 1, etags)
etag = etags[0]
self.assertTrue(etag)
@@ -63,6 +64,7 @@ def test_static_cacheControl(self) -> None:
app.root(request)
etags = request.responseHeaders.getRawHeaders("cache-control")
+ assert etags is not None
self.assertTrue(len(etags) == 1, etags)
etag = etags[0]
self.assertTrue(etag)
From b6f23268822dc903eeec9a58468d7fbaab032ce4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Mon, 16 Oct 2023 19:06:58 -0700
Subject: [PATCH 003/266] Switch to Python 3.12
---
.github/workflows/cicd.yml | 22 +++++++++++-----------
.github/workflows/deploy.yml | 4 ++--
.pre-commit-config.yaml | 10 +++++-----
pyproject.toml | 2 +-
tox.ini | 12 ++++++------
5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml
index 01b6d44ba..9054b571b 100644
--- a/.github/workflows/cicd.yml
+++ b/.github/workflows/cicd.yml
@@ -40,7 +40,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -86,7 +86,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -132,7 +132,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -179,7 +179,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -225,7 +225,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -270,7 +270,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -299,13 +299,13 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
- python-version: ["3.11"] # Versions to test with coverage
+ python-version: ["3.12"] # Versions to test with coverage
tox-prefix: ["coverage"]
optional: [false]
include:
- # Test Python 3.12 beta but allow it to fail
+ # Test Python beta but allow it to fail
- os: "ubuntu-latest"
- python-version: "3.12.0-beta.4"
+ python-version: "3.13.0-alpha.1"
optional: true
tox-prefix: "test"
@@ -404,7 +404,7 @@ jobs:
- uses: "actions/setup-python@v4"
if: ${{ matrix.tox-prefix == 'coverage' }}
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v3.1.4"
@@ -561,7 +561,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.11"
+ python-version: "3.12"
- name: Deploy to staging
run: ./bin/deploy staging
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 590538e6e..c2955c4a8 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -36,7 +36,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.10"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
@@ -91,7 +91,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
- python-version: "3.10"
+ python-version: "3.12"
- name: System Python Information
uses: twisted/python-info-action@v1
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 549a1c527..d2792b6ab 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -8,13 +8,13 @@ repos:
rev: "v3.15.0"
hooks:
- id: pyupgrade
- args: ["--py310-plus"]
+ args: ["--py312-plus"]
- repo: https://github.com/psf/black
rev: "23.9.1"
hooks:
- id: black
- args: ["--target-version", "py311"]
+ args: ["--target-version", "py312"]
- repo: https://github.com/PyCQA/autoflake
rev: "v2.2.1"
@@ -32,12 +32,12 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- - flake8-bugbear==23.7.10
+ - flake8-bugbear==23.9.16
- flake8-docstrings==1.7.0
- flake8-mutable==1.2.0
- flake8-pep3101==2.0.0
- pep8-naming==0.13.3
- - pycodestyle==2.11.0
+ - pycodestyle==2.11.1
- pydocstyle==6.3.0
- pyflakes==3.1.0
@@ -46,7 +46,7 @@ repos:
hooks:
- id: yesqa
additional_dependencies:
- - flake8-bugbear==23.7.10
+ - flake8-bugbear==23.9.16
- flake8-docstrings==1.7.0
- flake8-mutable==1.2.0
- flake8-pep3101==2.0.0
diff --git a/pyproject.toml b/pyproject.toml
index 0c4c86147..daa59dc1f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,4 +7,4 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 80
-target-version = ["py311"]
+target-version = ["py312"]
diff --git a/tox.ini b/tox.ini
index 38bf736cb..6d4299d7f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,8 +2,8 @@
envlist =
lint, mypy, bandit
- test-py312
- coverage-py311
+ test-py313
+ coverage-py312
coverage_report
docs
packaging
@@ -13,7 +13,7 @@ skip_missing_interpreters = {tty:True:False}
[default]
-basepython = python3.11
+basepython = python3.12
deps =
{test,coverage}: -r requirements/requirements-tests.txt
@@ -37,8 +37,8 @@ description = run tests
basepython =
py: python
- py311: python3.11
py312: python3.12
+ py313: python3.13
deps = {[default]deps}
@@ -128,7 +128,7 @@ commands =
description = generate coverage report
-depends = coverage-py{311,312}
+depends = coverage-py{312,313}
basepython = {[default]basepython}
@@ -231,7 +231,7 @@ commands =
description = check for potential packaging problems
-depends = {test,coverage}-py{311,312}
+depends = {test,coverage}-py{312,313}
basepython = {[default]basepython}
From 8fd8beec71f0e3235d1841b0890671056379829a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Mon, 16 Oct 2023 19:19:35 -0700
Subject: [PATCH 004/266] Update metadata
---
setup.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index ef53376e0..4d06a6cf5 100755
--- a/setup.py
+++ b/setup.py
@@ -62,8 +62,7 @@
"Intended Audience :: Other Audience",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
- "Programming Language :: Python :: 3.10",
- "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
From 7759a93e7fe9c00a86306d82b6cac5f857be5b8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Mon, 16 Oct 2023 19:19:44 -0700
Subject: [PATCH 005/266] Upate Dockerfile
---
Dockerfile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index e129576ad..c5e7633d6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# This stage builds the build container.
# -----------------------------------------------------------------------------
-FROM python:3.11.0-alpine3.16 as build
+FROM python:3.12.0-alpine3.18 as build
# Install compiler toolchain and libraries.
RUN apk add --no-cache build-base libffi-dev libressl-dev
@@ -35,7 +35,7 @@ RUN "${IMS_INSTALL_DIR}/bin/pip" --no-cache-dir install "${IMS_SOURCE_DIR}"
# -----------------------------------------------------------------------------
# This stage builds the application container.
# -----------------------------------------------------------------------------
-FROM python:3.11.0-alpine3.16 as application
+FROM python:3.12.0-alpine3.18 as application
# Paths
ARG IMS_INSTALL_DIR="/opt/ims"
@@ -53,7 +53,7 @@ RUN apk add --no-cache libressl
# Allow Python to bind to privileged port numbers
RUN apk add --no-cache libcap
-RUN setcap "cap_net_bind_service=+ep" /usr/local/bin/python3.11
+RUN setcap "cap_net_bind_service=+ep" /usr/local/bin/python3.12
# Create server root and make that our working directory
RUN install -o daemon -g daemon -d "${IMS_SERVER_ROOT}"
From 50eae117f8a5805f2d92635cfcf8146dbe737462 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 27 Nov 2023 04:32:04 +0000
Subject: [PATCH 006/266] Bump mypy from 1.5.1 to 1.7.1
Bumps [mypy](https://github.com/python/mypy) from 1.5.1 to 1.7.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.5.1...v1.7.1)
---
updated-dependencies:
- dependency-name: mypy
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
requirements/requirements-mypy.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-mypy.txt b/requirements/requirements-mypy.txt
index faddf29fe..37785c2d6 100644
--- a/requirements/requirements-mypy.txt
+++ b/requirements/requirements-mypy.txt
@@ -1,6 +1,6 @@
# Note: mypy-zope pins the mypy version
-mypy==1.5.1
+mypy==1.7.1
mypy-zope==1.0.1
types-PyMySQL==1.1.0.1
From 78b864428a22236fc18579efda1ba1015bb8c316 Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Mon, 15 Jan 2024 15:25:48 -0700
Subject: [PATCH 007/266] docs: change to working tox command
"tox run -e exec" didn't work for me. It complained about "run" being an invalid subcommand. "tox -e exec" did work though.
---
README.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.rst b/README.rst
index 1b5d08054..6a1002409 100644
--- a/README.rst
+++ b/README.rst
@@ -49,7 +49,7 @@ To set up a configuration for development, start by copying the example configur
To build and run the server (for development only)::
- tox run -e exec
+ tox -e exec
In your browser, open http://localhost:8080/ to reach the server. Log in as any user in the ``conf/directory.yaml`` directory file. In the ``conf/imsd.conf`` sample configuration file, the users ``Hardware`` and ``Loosy`` are administrators, and in the sample directory, all users have passwords that match their handles. You'll want to log in as one of those to set up an Event.
From 74a9e2cb5a2dc62839895f475a0d9d4bafaa2e3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Wed, 17 Jan 2024 10:15:32 -0800
Subject: [PATCH 008/266] Add instructions to install and update Tox with pipx.
---
README.rst | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/README.rst b/README.rst
index 6a1002409..a79d3a5f6 100644
--- a/README.rst
+++ b/README.rst
@@ -27,6 +27,13 @@ Running the Test Suite
~~~~~~~~~~~~~~~~~~~~~~
This project uses Tox_ for running tests.
+
+If you do not have tox installed, the recommended way is to use pipx_::
+
+ python3 -m pip install pipx
+ pipx install tox
+ pipx upgrade tox
+
To run all of the default test environments::
tox run
@@ -49,7 +56,7 @@ To set up a configuration for development, start by copying the example configur
To build and run the server (for development only)::
- tox -e exec
+ tox run -e exec
In your browser, open http://localhost:8080/ to reach the server. Log in as any user in the ``conf/directory.yaml`` directory file. In the ``conf/imsd.conf`` sample configuration file, the users ``Hardware`` and ``Loosy`` are administrators, and in the sample directory, all users have passwords that match their handles. You'll want to log in as one of those to set up an Event.
@@ -68,8 +75,9 @@ Pull requests in GitHub will run all tests on Travis CI, and all are required to
.. ------------------------------------------------------------------------- ..
-.. _Twisted: https://twistedmatrix.com/
-.. _Klein: https://klein.readthedocs.io/
-.. _Tox: http://tox.readthedocs.io/
.. _Flake8: http://flake8.pycqa.org/
+.. _Klein: https://klein.readthedocs.io/
.. _Mypy: http://mypy.readthedocs.io/
+.. _pipx: https://pipx.pypa.io/stable/
+.. _Tox: http://tox.readthedocs.io/
+.. _Twisted: https://twistedmatrix.com/
From c7ac3d0bce50182413ec4d09eab0fb61d0686791 Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Mon, 15 Jan 2024 15:08:01 -0700
Subject: [PATCH 009/266] feat: help user not lose unsaved changes
As things were, it was easy to accidentally navigate away from the
incident page and lose your unsaved text. I know this would've saved
me a lot of pain at Burning Man 2023, and I'm sure other people have
been bitten by this problem too.
I'm a JavaScript noob, so please feel free to suggest any changes.
---
src/ims/element/static/incident.js | 8 ++++++++
src/ims/element/static/incident_report.js | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/src/ims/element/static/incident.js b/src/ims/element/static/incident.js
index abbbae389..d2495828c 100644
--- a/src/ims/element/static/incident.js
+++ b/src/ims/element/static/incident.js
@@ -30,6 +30,14 @@ function initIncidentPage() {
// Scroll to incident_report_add field
$("html, body").animate({ scrollTop: $("#incident_report_add").offset().top }, 500);
$("#incident_report_add").focus();
+
+ // Warn the user if they're about to navigate away with unsaved text.
+ window.addEventListener('beforeunload', function (e) {
+ if (document.getElementById("incident_report_add").value !== '') {
+ e.preventDefault();
+ e.returnValue = '';
+ }
+ });
}
function loadedBody() {
diff --git a/src/ims/element/static/incident_report.js b/src/ims/element/static/incident_report.js
index a1010f652..b6da848e8 100644
--- a/src/ims/element/static/incident_report.js
+++ b/src/ims/element/static/incident_report.js
@@ -23,6 +23,14 @@ function initIncidentReportPage() {
// Scroll to incident_report_add field
$("html, body").animate({ scrollTop: $("#incident_report_add").offset().top }, 500);
$("#incident_report_add").focus();
+
+ // Warn the user if they're about to navigate away with unsaved text.
+ window.addEventListener('beforeunload', function (e) {
+ if (document.getElementById("incident_report_add").value !== '') {
+ e.preventDefault();
+ e.returnValue = '';
+ }
+ });
}
function loadedBody() {
From 8055f6b2e15b09421bfc547a654b42c7411a2c91 Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Sun, 21 Jan 2024 11:50:33 -0700
Subject: [PATCH 010/266] fix: do case insensitive sort of Ranger handles
Previously the list of Rangers in the "Add" dropdowns used
case-sensitive sorting, so all the handles starting with a
lowercase character were listed at the very end. This was
rather unintuitive. localeCompare seems to be the preferred
way to do this, and it uses the host's locale by default.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
---
src/ims/element/static/incident.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ims/element/static/incident.js b/src/ims/element/static/incident.js
index abbbae389..fa037f50e 100644
--- a/src/ims/element/static/incident.js
+++ b/src/ims/element/static/incident.js
@@ -515,7 +515,7 @@ function drawRangers() {
if (handles == undefined) {
handles = [];
} else {
- handles.sort();
+ handles.sort((a, b) => a.localeCompare(b));
}
for (var i in handles) {
@@ -545,7 +545,7 @@ function drawRangersToAdd() {
for (var handle in personnel) {
handles.push(handle);
}
- handles.sort();
+ handles.sort((a, b) => a.localeCompare(b));
select.empty();
select.append($(""));
From 76a6f6c32234d30512cb0e1a98a9e0877e0eb3c6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 22 Jan 2024 03:48:13 +0000
Subject: [PATCH 011/266] Bump safety from 2.3.5 to 3.0.1 (#1091)
Bumps [safety](https://github.com/pyupio/safety) from 2.3.5 to 3.0.1.
- [Release notes](https://github.com/pyupio/safety/releases)
- [Changelog](https://github.com/pyupio/safety/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyupio/safety/compare/2.3.5...3.0.1)
---
updated-dependencies:
- dependency-name: safety
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-safety.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-safety.txt b/requirements/requirements-safety.txt
index 774b05d4b..81a09b7c8 100644
--- a/requirements/requirements-safety.txt
+++ b/requirements/requirements-safety.txt
@@ -1 +1 @@
-safety==2.3.5
+safety==3.0.1
From 30b380937c33546488a402367cc878ab13670f75 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 22 Jan 2024 03:59:42 +0000
Subject: [PATCH 012/266] Bump markupsafe from 2.1.3 to 2.1.4 (#1092)
Bumps [markupsafe](https://github.com/pallets/markupsafe) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/pallets/markupsafe/releases)
- [Changelog](https://github.com/pallets/markupsafe/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/markupsafe/compare/2.1.3...2.1.4)
---
updated-dependencies:
- dependency-name: markupsafe
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-indirect.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-indirect.txt b/requirements/requirements-indirect.txt
index 7e3ee8fbe..f880a96bd 100644
--- a/requirements/requirements-indirect.txt
+++ b/requirements/requirements-indirect.txt
@@ -7,7 +7,7 @@ Deprecated==1.2.14
exceptiongroup==1.2.0
idna==3.6
incremental==22.10.0
-MarkupSafe==2.1.3
+MarkupSafe==2.1.4
packaging==23.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
From a58b3c7397394321a1baa57dc007c10c4e6a11c0 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 22 Jan 2024 04:00:45 +0000
Subject: [PATCH 013/266] Bump hypothesis from 6.91.0 to 6.96.2
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.91.0 to 6.96.2.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.91.0...hypothesis-python-6.96.2)
---
updated-dependencies:
- dependency-name: hypothesis
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
requirements/requirements-tests.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt
index b35d07fc9..eff3f6a4f 100644
--- a/requirements/requirements-tests.txt
+++ b/requirements/requirements-tests.txt
@@ -1,3 +1,3 @@
docker==7.0.0
-hypothesis==6.91.0
+hypothesis==6.96.2
mock==5.1.0
From ee917dd97256e3be188f8d254b0bc8ffd2d2f711 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 29 Jan 2024 03:30:50 +0000
Subject: [PATCH 014/266] Bump codecov/codecov-action from 3.1.4 to 3.1.5
(#1093)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.4...v3.1.5)
---
updated-dependencies:
- dependency-name: codecov/codecov-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/cicd.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml
index 25573ec68..81644544b 100644
--- a/.github/workflows/cicd.yml
+++ b/.github/workflows/cicd.yml
@@ -405,7 +405,7 @@ jobs:
python-version: "3.11"
- name: "Upload coverage to Codecov"
- uses: "codecov/codecov-action@v3.1.4"
+ uses: "codecov/codecov-action@v3.1.5"
if: ${{ matrix.tox-prefix == 'coverage' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
From b1b085b85484b5c29f44a5a4526e4fc252dc806a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 29 Jan 2024 03:48:04 +0000
Subject: [PATCH 015/266] Bump bandit from 1.7.6 to 1.7.7 (#1096)
Bumps [bandit](https://github.com/PyCQA/bandit) from 1.7.6 to 1.7.7.
- [Release notes](https://github.com/PyCQA/bandit/releases)
- [Commits](https://github.com/PyCQA/bandit/compare/1.7.6...1.7.7)
---
updated-dependencies:
- dependency-name: bandit
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-bandit.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-bandit.txt b/requirements/requirements-bandit.txt
index f142655de..9e8c53492 100644
--- a/requirements/requirements-bandit.txt
+++ b/requirements/requirements-bandit.txt
@@ -1 +1 @@
-bandit==1.7.6
+bandit==1.7.7
From f46a500d941e832dda16a96abe69bd8d5e0d5d9e Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 29 Jan 2024 16:45:11 +0000
Subject: [PATCH 016/266] [pre-commit.ci] pre-commit autoupdate
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1)
---
.pre-commit-config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ca50a3dae..1496730cc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -11,7 +11,7 @@ repos:
args: ["--py310-plus"]
- repo: https://github.com/psf/black
- rev: "23.12.1"
+ rev: "24.1.1"
hooks:
- id: black
args: ["--target-version", "py311"]
From 9a3473211b4759e7b72aab74c59b807bdeebf4e7 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 29 Jan 2024 16:45:44 +0000
Subject: [PATCH 017/266] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
src/ims/application/_api.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ims/application/_api.py b/src/ims/application/_api.py
index 3ddbc9ee7..3eae2107e 100644
--- a/src/ims/application/_api.py
+++ b/src/ims/application/_api.py
@@ -438,9 +438,9 @@ async def newIncidentResource(
json[IncidentJSONKey.state.value] = IncidentStateJSONValue.new.value
if IncidentJSONKey.priority.value not in json:
- json[
- IncidentJSONKey.priority.value
- ] = IncidentPriorityJSONValue.normal.value
+ json[IncidentJSONKey.priority.value] = (
+ IncidentPriorityJSONValue.normal.value
+ )
# If not provided, set JSON handles, types, entries,
# incident report numbers to an empty list
From 7a91c300d8f9e3e0490991c7ef1d35644825351b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 1 Feb 2024 05:46:42 +0000
Subject: [PATCH 018/266] Bump pyopenssl from 23.3.0 to 24.0.0 (#1097)
Bumps [pyopenssl](https://github.com/pyca/pyopenssl) from 23.3.0 to 24.0.0.
- [Changelog](https://github.com/pyca/pyopenssl/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/pyopenssl/compare/23.3.0...24.0.0)
---
updated-dependencies:
- dependency-name: pyopenssl
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index f283c7617..471985eb2 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -7,7 +7,7 @@ hyperlink==21.0.0
jwcrypto==1.5.1
klein==21.8.0
PyMySQL==1.1.0
-pyOpenSSL==23.3.0
+pyOpenSSL==24.0.0
PyYAML==6.0.1
service-identity==24.1.0
Twisted==23.10.0
From 30f6a0173e22717bfc1d15c093eeaf0687b76918 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 1 Feb 2024 05:47:36 +0000
Subject: [PATCH 019/266] Bump cryptography from 41.0.7 to 42.0.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.7 to 42.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.7...42.0.2)
---
updated-dependencies:
- dependency-name: cryptography
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 471985eb2..e21422fc8 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -2,7 +2,7 @@ arrow==1.3.0
attrs==23.2.0
bcrypt==4.1.2
cattrs==23.2.3
-cryptography==41.0.7
+cryptography==42.0.2
hyperlink==21.0.0
jwcrypto==1.5.1
klein==21.8.0
From b78646ea6177d74c5a776d9b8c432d5be091a10a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Wed, 31 Jan 2024 22:05:07 -0800
Subject: [PATCH 020/266] Allow pre-commit-ci to automerge.
---
.github/workflows/automerge.yml | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml
index 817deee3f..054be53ac 100644
--- a/.github/workflows/automerge.yml
+++ b/.github/workflows/automerge.yml
@@ -12,14 +12,8 @@ jobs:
runs-on: ubuntu-latest
- if: ${{ github.actor == 'dependabot[bot]' }}
+ if: ${{ contains('["dependabot[bot]", "pre-commit-ci[bot]"]', github.actor) }}
steps:
- # - name: Get Dependabot metadata
- # id: dependabot-metadata
- # uses: dependabot/fetch-metadata@v1.6.0
- # with:
- # github-token: "${{ secrets.GITHUB_TOKEN }}"
-
- name: Approve the PR
run: gh pr review --approve "${{ github.event.pull_request.html_url }}"
env:
From 0d663be7b9ee395340fb10998ee21b0e8414219e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Wed, 31 Jan 2024 22:05:22 -0800
Subject: [PATCH 021/266] Disable Safety for now
---
.github/workflows/cicd.yml | 70 +++++++++++++++++++-------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml
index 81644544b..87115f4a4 100644
--- a/.github/workflows/cicd.yml
+++ b/.github/workflows/cicd.yml
@@ -149,51 +149,51 @@ jobs:
run: tox run -e bandit
- safety:
+ # safety:
- name: Safety (dependency security checker)
+ # name: Safety (dependency security checker)
- runs-on: ubuntu-latest
- timeout-minutes: 5
+ # runs-on: ubuntu-latest
+ # timeout-minutes: 5
- steps:
+ # steps:
- - name: Harden CI
- uses: step-security/harden-runner@v2.6.1
- with:
- disable-sudo: true
- disable-file-monitoring: true
- egress-policy: block
- allowed-endpoints: >
- api.github.com:443
- files.pythonhosted.org:443
- github.com:443
- pypi.org:443
- pyup.io:443
+ # - name: Harden CI
+ # uses: step-security/harden-runner@v2.6.1
+ # with:
+ # disable-sudo: true
+ # disable-file-monitoring: true
+ # egress-policy: block
+ # allowed-endpoints: >
+ # api.github.com:443
+ # files.pythonhosted.org:443
+ # github.com:443
+ # pypi.org:443
+ # pyup.io:443
- - name: Checkout source code
- uses: actions/checkout@v4
+ # - name: Checkout source code
+ # uses: actions/checkout@v4
- - name: Install Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.11"
+ # - name: Install Python
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: "3.11"
- - name: System Python Information
- uses: twisted/python-info-action@v1
+ # - name: System Python Information
+ # uses: twisted/python-info-action@v1
- - name: Set up Tox environment
- run: |
- pip install tox
- tox run -e safety --notest
+ # - name: Set up Tox environment
+ # run: |
+ # pip install tox
+ # tox run -e safety --notest
- - name: Tox Python Information
- uses: twisted/python-info-action@v1
- with:
- python-path: .tox/safety/*/python
+ # - name: Tox Python Information
+ # uses: twisted/python-info-action@v1
+ # with:
+ # python-path: .tox/safety/*/python
- - name: Run Safety
- run: tox run -e safety
+ # - name: Run Safety
+ # run: tox run -e safety
docs:
From ce3daa87ab7bf5b6a52c25fbafaee61671d08201 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 1 Feb 2024 06:23:32 +0000
Subject: [PATCH 022/266] Bump coverage from 7.4.0 to 7.4.1 (#1094)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.0 to 7.4.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.4.0...7.4.1)
---
updated-dependencies:
- dependency-name: coverage
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wilfredo Sánchez Vega
---
requirements/requirements-coverage.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-coverage.txt b/requirements/requirements-coverage.txt
index 5e00acee1..d930d48e6 100644
--- a/requirements/requirements-coverage.txt
+++ b/requirements/requirements-coverage.txt
@@ -1 +1 @@
-coverage==7.4.0
+coverage==7.4.1
From d0017f461f30a2189332caa886bbffd35fefe4cd Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Thu, 1 Feb 2024 06:53:45 -0700
Subject: [PATCH 023/266] authorizationsForUser() takes str not Event (#1086)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: correctly decode event ID (DO NOT SUBMIT)
There's some bug in here such that when I load IMS against SQLite,
I'm unable to retrieve saved Events. It's because those get read as
Event objects in this code location, rather than as strings.
This PR is super dirty, and it's here to notify Tool about the bug,
not really as a fix. I'm not even sure if it just afflicts the SQLite
scenario, but I haven't tried it with MySQL.
* Pass event ID, not event, to authorizationsForUser
* Shouldn't be necessary. Wish the type checker caught this.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Wilfredo Sánchez
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
src/ims/element/_element.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ims/element/_element.py b/src/ims/element/_element.py
index 493a60b50..5afcea663 100644
--- a/src/ims/element/_element.py
+++ b/src/ims/element/_element.py
@@ -223,7 +223,8 @@ def order(i: Iterable[str]) -> Iterable[str]:
[
event.id
for event in await self.config.store.events()
- if relevantAuthorizations & await authorizationsForUser(event)
+ if relevantAuthorizations
+ & await authorizationsForUser(event.id)
]
)
From 6d1d9ac17038fe6906679be2ad12840fb7d90b45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Thu, 1 Feb 2024 11:11:40 -0800
Subject: [PATCH 024/266] Switch to Klein-23.12.0. Fix up typing issues.
---
requirements/requirements-direct.txt | 6 +---
src/ims/application/_api.py | 49 ++++++++++++++++++----------
src/ims/application/_auth.py | 9 +++--
src/ims/application/_klein.py | 46 ++++++++++++++++----------
src/ims/application/_main.py | 5 +--
src/ims/application/_web.py | 23 ++++++++-----
6 files changed, 85 insertions(+), 53 deletions(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 22d0547d3..baad55d1c 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -5,11 +5,7 @@ cattrs==23.2.3
cryptography==42.0.2
hyperlink==21.0.0
jwcrypto==1.5.1
-
-#klein==21.8.0
-klein @ git+https://github.com/twisted/klein@trunk
-#klein @ file:///Users/wsanchez/Developer/Twisted/klein
-
+klein==23.12.0
PyMySQL==1.1.0
pyOpenSSL==24.0.0
PyYAML==6.0.1
diff --git a/src/ims/application/_api.py b/src/ims/application/_api.py
index 3eae2107e..7a710c499 100644
--- a/src/ims/application/_api.py
+++ b/src/ims/application/_api.py
@@ -35,6 +35,7 @@
from attrs import frozen
from hyperlink import URL
from klein import KleinRenderable
+from klein._app import KleinSynchronousRenderable
from twisted.internet.defer import Deferred
from twisted.internet.error import ConnectionDone
from twisted.logger import Logger
@@ -151,7 +152,9 @@ def bagResource(self, request: IRequest) -> KleinRenderable:
return jsonBytes(request, self._bag, str(hash(self._bag)))
@router.route(_unprefix(URLs.auth), methods=("POST",))
- async def authResource(self, request: IRequest) -> KleinRenderable:
+ async def authResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Authentication endpoint.
"""
@@ -216,7 +219,9 @@ async def authResource(self, request: IRequest) -> KleinRenderable:
)
@router.route(_unprefix(URLs.personnel), methods=("HEAD", "GET"))
- async def personnelResource(self, request: IRequest) -> KleinRenderable:
+ async def personnelResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Personnel endpoint.
"""
@@ -249,7 +254,9 @@ async def personnelData(self) -> tuple[Iterable[bytes], str]:
)
@router.route(_unprefix(URLs.incidentTypes), methods=("HEAD", "GET"))
- async def incidentTypesResource(self, request: IRequest) -> KleinRenderable:
+ async def incidentTypesResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Incident types endpoint.
"""
@@ -272,7 +279,7 @@ async def incidentTypesResource(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.incidentTypes), methods=("POST",))
async def editIncidentTypesResource(
self, request: IRequest
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident types editing endpoint.
"""
@@ -313,7 +320,9 @@ async def editIncidentTypesResource(
return noContentResponse(request)
@router.route(_unprefix(URLs.events), methods=("HEAD", "GET"))
- async def eventsResource(self, request: IRequest) -> KleinRenderable:
+ async def eventsResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Events endpoint.
"""
@@ -336,7 +345,9 @@ async def eventsResource(self, request: IRequest) -> KleinRenderable:
return jsonBytes(request, data, str(hash(data)))
@router.route(_unprefix(URLs.events), methods=("POST",))
- async def editEventsResource(self, request: IRequest) -> KleinRenderable:
+ async def editEventsResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Events editing endpoint.
"""
@@ -396,7 +407,7 @@ async def listIncidentsResource(
@router.route(_unprefix(URLs.incidents), methods=("POST",))
async def newIncidentResource(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
New incident endpoint.
"""
@@ -514,7 +525,7 @@ async def newIncidentResource(
@router.route(_unprefix(URLs.incidentNumber), methods=("HEAD", "GET"))
async def readIncidentResource(
self, request: IRequest, event_id: str, incident_number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident endpoint.
"""
@@ -544,7 +555,7 @@ async def readIncidentResource(
@router.route(_unprefix(URLs.incidentNumber), methods=("POST",))
async def editIncidentResource(
self, request: IRequest, event_id: str, incident_number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident edit endpoint.
"""
@@ -705,7 +716,7 @@ def _cast(obj: Any) -> Any:
@router.route(_unprefix(URLs.incidentReports), methods=("HEAD", "GET"))
async def listIncidentReportsResource(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident reports endpoint.
"""
@@ -760,7 +771,7 @@ async def listIncidentReportsResource(
@router.route(_unprefix(URLs.incidentReports), methods=("POST",))
async def newIncidentReportResource(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
New incident report endpoint.
"""
@@ -873,7 +884,7 @@ async def newIncidentReportResource(
@router.route(_unprefix(URLs.incidentReport), methods=("HEAD", "GET"))
async def readIncidentReportResource(
self, request: IRequest, event_id: str, incident_report_number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident report endpoint.
"""
@@ -899,7 +910,7 @@ async def readIncidentReportResource(
@router.route(_unprefix(URLs.incidentReport), methods=("POST",))
async def editIncidentReportResource(
self, request: IRequest, event_id: str, incident_report_number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Incident report edit endpoint.
"""
@@ -1027,7 +1038,7 @@ def _cast(obj: Any) -> Any:
@router.route(_unprefix(URLs.acl), methods=("HEAD", "GET"))
async def readAdminAccessResource(
self, request: IRequest
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Admin access control endpoint.
"""
@@ -1050,7 +1061,7 @@ async def readAdminAccessResource(
@router.route(_unprefix(URLs.acl), methods=("POST",))
async def editAdminAccessResource(
self, request: IRequest
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Admin access control edit endpoint.
"""
@@ -1076,7 +1087,9 @@ async def editAdminAccessResource(
return noContentResponse(request)
@router.route(_unprefix(URLs.streets), methods=("HEAD", "GET"))
- async def readStreetsResource(self, request: IRequest) -> KleinRenderable:
+ async def readStreetsResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Street list endpoint.
"""
@@ -1104,7 +1117,9 @@ async def authorizedEvents() -> AsyncIterable[Event]:
)
@router.route(_unprefix(URLs.streets), methods=("POST",))
- async def editStreetsResource(self, request: IRequest) -> KleinRenderable:
+ async def editStreetsResource(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Street list edit endpoint.
"""
diff --git a/src/ims/application/_auth.py b/src/ims/application/_auth.py
index 83bc772ca..da0996e17 100644
--- a/src/ims/application/_auth.py
+++ b/src/ims/application/_auth.py
@@ -23,6 +23,7 @@
from attrs import frozen
from hyperlink import URL
from klein import KleinRenderable
+from klein._app import KleinSynchronousRenderable
from twisted.logger import Logger
from twisted.web.iweb import IRequest
@@ -52,7 +53,9 @@ class AuthApplication:
config: Configuration
@router.route(_unprefix(URLs.login), methods=("HEAD", "GET"))
- def login(self, request: IRequest, failed: bool = False) -> KleinRenderable:
+ def login(
+ self, request: IRequest, failed: bool = False
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for the login page.
"""
@@ -63,7 +66,9 @@ def login(self, request: IRequest, failed: bool = False) -> KleinRenderable:
return LoginPage(config=self.config, failed=failed)
@router.route(_unprefix(URLs.login), methods=("POST",))
- async def loginSubmit(self, request: IRequest) -> KleinRenderable:
+ async def loginSubmit(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for a login form submission.
"""
diff --git a/src/ims/application/_klein.py b/src/ims/application/_klein.py
index 647b6a0d9..6446ca514 100644
--- a/src/ims/application/_klein.py
+++ b/src/ims/application/_klein.py
@@ -21,10 +21,11 @@
from collections.abc import Callable, Iterable, Sequence
from functools import wraps
-from typing import Any, Optional, cast
+from typing import Any, Optional, TypeVar, cast
from hyperlink import URL
from klein import Klein, KleinRenderable, KleinRouteHandler
+from klein._app import KleinSynchronousRenderable
from twisted.logger import Logger
from twisted.python.failure import Failure
from twisted.web import http
@@ -54,6 +55,9 @@
log = Logger()
+KleinRouteHandlerT = TypeVar("KleinRouteHandlerT", bound=KleinRouteHandler)
+
+
def renderResponse(f: KleinRouteHandler) -> KleinRouteHandler:
"""
Decorator to ensure that the returned response is rendered, if applicable.
@@ -67,7 +71,9 @@ def wrapper(
response = f(self, request, *args, **kwargs)
if IRenderable.providedBy(response):
- return renderElement(request, response)
+ return renderElement( # type: ignore[return-value]
+ request, response
+ )
return response
@@ -76,7 +82,7 @@ def wrapper(
def redirect(
request: IRequest, location: URL, origin: str | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Perform a redirect.
"""
@@ -108,7 +114,7 @@ def redirect(
def noContentResponse(
request: IRequest, etag: str | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Respond with no content.
"""
@@ -118,7 +124,7 @@ def noContentResponse(
return b""
-def textResponse(request: IRequest, message: str) -> KleinRenderable:
+def textResponse(request: IRequest, message: str) -> KleinSynchronousRenderable:
"""
Respond with the given text.
"""
@@ -127,7 +133,7 @@ def textResponse(request: IRequest, message: str) -> KleinRenderable:
return message.encode("utf-8")
-def notFoundResponse(request: IRequest) -> KleinRenderable:
+def notFoundResponse(request: IRequest) -> KleinSynchronousRenderable:
"""
Respond with a NOT FOUND status.
"""
@@ -137,7 +143,7 @@ def notFoundResponse(request: IRequest) -> KleinRenderable:
return textResponse(request, "Not found")
-def methodNotAllowedResponse(request: IRequest) -> KleinRenderable:
+def methodNotAllowedResponse(request: IRequest) -> KleinSynchronousRenderable:
"""
Respond with a METHOD NOT ALLOWED status.
"""
@@ -150,7 +156,7 @@ def methodNotAllowedResponse(request: IRequest) -> KleinRenderable:
return textResponse(request, "HTTP method not allowed")
-def forbiddenResponse(request: IRequest) -> KleinRenderable:
+def forbiddenResponse(request: IRequest) -> KleinSynchronousRenderable:
"""
Respond with a FORBIDDEN status.
"""
@@ -164,7 +170,7 @@ def forbiddenResponse(request: IRequest) -> KleinRenderable:
return textResponse(request, "Permission denied")
-def notAuthenticatedResponse(request: IRequest) -> KleinRenderable:
+def notAuthenticatedResponse(request: IRequest) -> KleinSynchronousRenderable:
"""
Respond with a UNAUTHORIZED status.
"""
@@ -180,7 +186,7 @@ def notAuthenticatedResponse(request: IRequest) -> KleinRenderable:
def badRequestResponse(
request: IRequest, message: str | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Respond with a BAD REQUEST status.
"""
@@ -200,7 +206,7 @@ def badRequestResponse(
def invalidJSONResponse(
request: IRequest, error: Exception | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Respond with a BAD REQUEST status for invalid JSON request data.
"""
@@ -209,7 +215,7 @@ def invalidJSONResponse(
def invalidQueryResponse(
request: IRequest, arg: str, value: str | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Respond with a BAD REQUEST status due to an invalid query.
"""
@@ -221,7 +227,9 @@ def invalidQueryResponse(
return badRequestResponse(request, f"Invalid query: {arg}={value}")
-def badGatewayResponse(request: IRequest, message: str) -> KleinRenderable:
+def badGatewayResponse(
+ request: IRequest, message: str
+) -> KleinSynchronousRenderable:
"""
Respond with a BAD GATEWAY status.
"""
@@ -233,7 +241,7 @@ def badGatewayResponse(request: IRequest, message: str) -> KleinRenderable:
def internalErrorResponse(
request: IRequest, message: str | None = None
-) -> KleinRenderable:
+) -> KleinSynchronousRenderable:
"""
Respond with an INTERNAL SERVER ERROR status.
"""
@@ -328,7 +336,7 @@ def __init__(self) -> None:
def route(
self, url: str | URL, *args: Any, **kwargs: Any
- ) -> Callable[[KleinRouteHandler], KleinRouteHandler]:
+ ) -> Callable[[KleinRouteHandlerT], KleinRouteHandlerT]:
"""
See :meth:`Klein.route`.
"""
@@ -337,7 +345,7 @@ def route(
if isinstance(url, URL):
url = url.asText()
- def decorator(f: KleinRouteHandler) -> KleinRouteHandler:
+ def decorator(f: KleinRouteHandlerT) -> KleinRouteHandlerT:
@superRoute(url, *args, **kwargs)
@wraps(f)
def wrapper(
@@ -355,7 +363,7 @@ def wrapper(
return f(app, request, *args, **kwargs)
- return cast(KleinRouteHandler, wrapper)
+ return wrapper # type: ignore[return-value]
return decorator
@@ -434,7 +442,9 @@ def notAuthenticatedError(
return forbiddenResponse(request)
element = redirect(request, URLs.login, origin="o")
- return renderElement(request, element)
+ return renderElement( # type: ignore[return-value]
+ request, element # type: ignore[arg-type]
+ )
@self.handle_errors(DirectoryError)
@renderResponse
diff --git a/src/ims/application/_main.py b/src/ims/application/_main.py
index 408594b41..2948e1805 100644
--- a/src/ims/application/_main.py
+++ b/src/ims/application/_main.py
@@ -18,13 +18,14 @@
Incident Management System web service.
"""
-from typing import ClassVar
+from typing import ClassVar, cast
from attrs import Factory, field, frozen
from klein import KleinRenderable
from twisted.logger import globalLogPublisher
from twisted.python.filepath import FilePath
from twisted.web.iweb import IRequest
+from twisted.web.resource import IResource
from twisted.web.static import File
import ims.element
@@ -184,7 +185,7 @@ def externalApplicationEndpoint(self, request: IRequest) -> KleinRenderable:
"""
External application resource.
"""
- return self.externalApplication.router.resource()
+ return cast(IResource, self.externalApplication.router.resource())
@router.route(URLs.app, branch=True)
@static
diff --git a/src/ims/application/_web.py b/src/ims/application/_web.py
index 0d31f571e..58bdb0046 100644
--- a/src/ims/application/_web.py
+++ b/src/ims/application/_web.py
@@ -23,6 +23,7 @@
from attrs import frozen
from hyperlink import URL
from klein import KleinRenderable
+from klein._app import KleinSynchronousRenderable
from twisted.web.iweb import IRequest
from ims.auth import Authorization, NotAuthorizedError
@@ -80,7 +81,7 @@ def applicationRootResource(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.viewEvent), methods=("HEAD", "GET"))
async def viewIncidentsResource(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Event root page.
@@ -101,7 +102,7 @@ async def viewIncidentsResource(
@router.route(_unprefix(URLs.admin), methods=("HEAD", "GET"))
@static
- async def adminPage(self, request: IRequest) -> KleinRenderable:
+ async def adminPage(self, request: IRequest) -> KleinSynchronousRenderable:
"""
Endpoint for admin page.
"""
@@ -114,7 +115,9 @@ async def adminPage(self, request: IRequest) -> KleinRenderable:
return AdminRootPage(config=self.config)
@router.route(_unprefix(URLs.adminEvents), methods=("HEAD", "GET"))
- async def adminEventsPage(self, request: IRequest) -> KleinRenderable:
+ async def adminEventsPage(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for access control page.
"""
@@ -129,7 +132,7 @@ async def adminEventsPage(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.adminIncidentTypes), methods=("HEAD", "GET"))
async def adminAdminIncidentTypesPagePage(
self, request: IRequest
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for incident types admin page.
"""
@@ -142,7 +145,9 @@ async def adminAdminIncidentTypesPagePage(
return AdminIncidentTypesPage(config=self.config)
@router.route(_unprefix(URLs.adminStreets), methods=("HEAD", "GET"))
- async def adminStreetsPage(self, request: IRequest) -> KleinRenderable:
+ async def adminStreetsPage(
+ self, request: IRequest
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for streets admin page.
"""
@@ -157,7 +162,7 @@ async def adminStreetsPage(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.viewIncidents), methods=("HEAD", "GET"))
async def viewIncidentsPage(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for the incidents page.
"""
@@ -183,7 +188,7 @@ def viewIncidentsTemplatePage(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.viewIncidentNumber), methods=("HEAD", "GET"))
async def viewIncidentPage(
self, request: IRequest, event_id: str, number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for the incident page.
"""
@@ -216,7 +221,7 @@ def viewIncidentTemplatePage(self, request: IRequest) -> KleinRenderable:
@router.route(_unprefix(URLs.viewIncidentReports), methods=("HEAD", "GET"))
async def viewIncidentReportsPage(
self, request: IRequest, event_id: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for the incident reports page.
"""
@@ -248,7 +253,7 @@ def viewIncidentReportsTemplatePage(
)
async def viewIncidentReportPage(
self, request: IRequest, event_id: str, number: str
- ) -> KleinRenderable:
+ ) -> KleinSynchronousRenderable:
"""
Endpoint for the incident report page.
"""
From 779364629bec19a0fb891f9333adb1b4d2f7734e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Thu, 1 Feb 2024 11:24:33 -0800
Subject: [PATCH 025/266] Fix typing in element/
---
src/ims/element/page/_page.py | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/ims/element/page/_page.py b/src/ims/element/page/_page.py
index f5a494d6f..7f0bfd80e 100644
--- a/src/ims/element/page/_page.py
+++ b/src/ims/element/page/_page.py
@@ -24,8 +24,7 @@
from attrs import mutable
from hyperlink import URL
-from klein import KleinRenderable
-from twisted.web.iweb import IRequest
+from twisted.web.iweb import IRequest, IRenderable
from twisted.web.template import Tag, renderer, tags
from ims.config import Configuration
@@ -88,14 +87,14 @@ def add(name: str) -> None:
return result.values()
@renderer
- def title(self, request: IRequest, tag: Tag) -> KleinRenderable:
+ def title(self, request: IRequest, tag: Tag) -> IRenderable:
"""
`` element.
"""
- return tag.clone()(self.name)
+ return tag.clone()(self.name) # type: ignore[return-value]
@renderer
- def head(self, request: IRequest, tag: Tag) -> KleinRenderable:
+ def head(self, request: IRequest, tag: Tag) -> IRenderable:
"""
`` element.
"""
@@ -114,7 +113,7 @@ def head(self, request: IRequest, tag: Tag) -> KleinRenderable:
if "imports" in tag.attributes:
del tag.attributes["imports"]
- return tag(
+ return tag( # type: ignore[return-value]
# Resource metadata
tags.meta(charset="utf-8"),
tags.meta(
@@ -145,19 +144,21 @@ def head(self, request: IRequest, tag: Tag) -> KleinRenderable:
)
@renderer
- def container(self, request: IRequest, tag: Tag) -> KleinRenderable:
+ def container(self, request: IRequest, tag: Tag) -> IRenderable:
"""
App container.
"""
tag.children.insert(0, self.top(request))
- return tag(self.bottom(request), Class="container-fluid")
+ return tag( # type: ignore[return-value]
+ self.bottom(request), Class="container-fluid"
+ )
@renderer
- def top(self, request: IRequest, tag: Tag | None = None) -> KleinRenderable:
+ def top(self, request: IRequest, tag: Tag | None = None) -> IRenderable:
"""
Top elements.
"""
- return (
+ return ( # type: ignore[return-value]
self.nav(request),
self.header(request),
self.title(request, tags.h1.clone()(id="doc-title")),
@@ -166,14 +167,14 @@ def top(self, request: IRequest, tag: Tag | None = None) -> KleinRenderable:
@renderer
def bottom(
self, request: IRequest, tag: Tag | None = None
- ) -> KleinRenderable:
+ ) -> IRenderable:
"""
Bottom elements.
"""
- return (self.footer(request),)
+ return (self.footer(request),) # type: ignore[return-value]
@renderer
- def nav(self, request: IRequest, tag: Tag | None = None) -> KleinRenderable:
+ def nav(self, request: IRequest, tag: Tag | None = None) -> IRenderable:
"""
`
From 97f8fedef37a6790f3000ea94c464e7de31794d2 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 03:35:13 +0000
Subject: [PATCH 226/266] Bump pre-commit from 3.8.0 to 4.0.0 (#1294)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.8.0 to 4.0.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.8.0...v4.0.0)
---
updated-dependencies:
- dependency-name: pre-commit
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-lint.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-lint.txt b/requirements/requirements-lint.txt
index 1509fe7c3..7ffa20c41 100644
--- a/requirements/requirements-lint.txt
+++ b/requirements/requirements-lint.txt
@@ -1 +1 @@
-pre-commit==3.8.0
+pre-commit==4.0.0
From 59c211a8e96a80e60e78e1ce2b60bbda3ec0f6cd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 03:43:04 +0000
Subject: [PATCH 227/266] Bump hypothesis from 6.112.2 to 6.112.4 (#1296)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.112.2 to 6.112.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.112.2...hypothesis-python-6.112.4)
---
updated-dependencies:
- dependency-name: hypothesis
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-tests.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt
index 9a077b0fb..6a69c119f 100644
--- a/requirements/requirements-tests.txt
+++ b/requirements/requirements-tests.txt
@@ -1,3 +1,3 @@
docker==7.1.0
-hypothesis==6.112.2
+hypothesis==6.112.4
mock==5.1.0
From e0998d2e3ee8b793634a49f4a4941dfc9f0de324 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 03:51:15 +0000
Subject: [PATCH 228/266] Bump sphinx-autobuild from 2024.9.19 to 2024.10.3
(#1295)
Bumps [sphinx-autobuild](https://github.com/sphinx-doc/sphinx-autobuild) from 2024.9.19 to 2024.10.3.
- [Release notes](https://github.com/sphinx-doc/sphinx-autobuild/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx-autobuild/blob/main/NEWS.rst)
- [Commits](https://github.com/sphinx-doc/sphinx-autobuild/compare/2024.09.19...2024.10.03)
---
updated-dependencies:
- dependency-name: sphinx-autobuild
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-docs.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-docs.txt b/requirements/requirements-docs.txt
index 0fe27877b..b36aef1d0 100644
--- a/requirements/requirements-docs.txt
+++ b/requirements/requirements-docs.txt
@@ -1,3 +1,3 @@
furo==2024.8.6
Sphinx==8.0.2
-sphinx-autobuild==2024.9.19
+sphinx-autobuild==2024.10.3
From cb8f374322da6eaa74e61042513da1d621f43080 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 17:05:58 +0000
Subject: [PATCH 229/266] [pre-commit.ci] pre-commit autoupdate (#1297)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.pre-commit-config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0a200c7f3..ed6ae1a2e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -62,7 +62,7 @@ repos:
args: ["--filter-files"]
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: "v4.6.0"
+ rev: "v5.0.0"
hooks:
- id: check-ast
- id: check-builtin-literals
From a4f2c182f8c2226d35d72a7225d146e9fbf53103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?=
Date: Wed, 9 Oct 2024 18:27:19 -0700
Subject: [PATCH 230/266] Don't hard code timeout on IMSSession, duh. Use same
value as JWT token timeout. Change IMS_TOKEN_LIFETIME_NORMAL to
IMS_TOKEN_LIFETIME. Remove unused IMS_TOKEN_LIFETIME_EXTENDED.
---
src/ims/application/_api.py | 2 +-
src/ims/config/_config.py | 20 ++++----------------
src/ims/run/_command.py | 7 +++----
3 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/src/ims/application/_api.py b/src/ims/application/_api.py
index 7a710c499..78d575d62 100644
--- a/src/ims/application/_api.py
+++ b/src/ims/application/_api.py
@@ -204,7 +204,7 @@ async def authResource(
else:
self._log.info("Issuing credentials for user {user}", user=user)
credentials = await authProvider.credentialsForUser(
- user, self.config.tokenLifetimeNormal
+ user, self.config.tokenLifetime
)
return jsonBytes(
request, jsonTextFromObject(credentials).encode("utf-8")
diff --git a/src/ims/config/_config.py b/src/ims/config/_config.py
index f7f6e6112..42aba37b8 100644
--- a/src/ims/config/_config.py
+++ b/src/ims/config/_config.py
@@ -388,26 +388,16 @@ def fromConfigFile(cls, configFile: Path | None) -> "Configuration":
masterKey = parser.valueFromConfig("MASTER_KEY", "Core", "MasterKey")
- tokenLifetimeNormal = TimeDelta(
+ tokenLifetime = TimeDelta(
seconds=int(
parser.valueFromConfig(
- "TOKEN_LIFETIME_NORMAL",
+ "TOKEN_LIFETIME",
"Core",
"TokenLifetime",
str(1 * 60 * 60),
)
)
)
- tokenLifetimeExtended = TimeDelta(
- seconds=int(
- parser.valueFromConfig(
- "TOKEN_LIFETIME_EXTENDED",
- "Core",
- "TokenLifetime",
- str(30 * 24 * 60 * 60),
- )
- )
- )
#
# Persist some objects
@@ -430,8 +420,7 @@ def fromConfigFile(cls, configFile: Path | None) -> "Configuration":
requireActive=requireActive,
serverRoot=serverRoot,
storeFactory=storeFactory,
- tokenLifetimeExtended=tokenLifetimeExtended,
- tokenLifetimeNormal=tokenLifetimeNormal,
+ tokenLifetime=tokenLifetime,
)
cachedResourcesRoot: Path
@@ -449,8 +438,7 @@ def fromConfigFile(cls, configFile: Path | None) -> "Configuration":
port: int
requireActive: bool
serverRoot: Path
- tokenLifetimeExtended: TimeDelta
- tokenLifetimeNormal: TimeDelta
+ tokenLifetime: TimeDelta
_storeFactory: Callable[[], IMSDataStore]
diff --git a/src/ims/run/_command.py b/src/ims/run/_command.py
index d2871747c..440bfa61e 100644
--- a/src/ims/run/_command.py
+++ b/src/ims/run/_command.py
@@ -55,10 +55,6 @@
__all__ = ()
-class IMSSession(Session):
- sessionTimeout = 60 * 60 * 1 # 1 hour
-
-
@frozen(kw_only=True)
class Command:
"""
@@ -107,6 +103,9 @@ def runServer(cls, config: Configuration, options: ServerOptions) -> None:
patchCombinedLogFormatter()
+ class IMSSession(Session):
+ sessionTimeout = int(config.tokenLifetime.total_seconds())
+
factory = Site(application.router.resource())
factory.sessionFactory = IMSSession
From af04a293d1a9b2559fec48abcb6385880fdb5d4c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 03:57:30 +0000
Subject: [PATCH 231/266] build(deps): bump zope-interface from 7.0.3 to 7.1.0
(#1304)
Bumps [zope-interface](https://github.com/zopefoundation/zope.interface) from 7.0.3 to 7.1.0.
- [Changelog](https://github.com/zopefoundation/zope.interface/blob/master/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/zope.interface/compare/7.0.3...7.1.0)
---
updated-dependencies:
- dependency-name: zope-interface
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 8e0f39b4d..4f07a2cef 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -12,4 +12,4 @@ PyYAML==6.0.2
service-identity==24.1.0
Twisted==24.7.0
Werkzeug==3.0.4
-zope.interface==7.0.3
+zope.interface==7.1.0
From b3c24d851f48e6df16f121c10eba409dd99a1675 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:05:16 +0000
Subject: [PATCH 232/266] build(deps): bump markupsafe from 2.1.5 to 3.0.1
(#1302)
Bumps [markupsafe](https://github.com/pallets/markupsafe) from 2.1.5 to 3.0.1.
- [Release notes](https://github.com/pallets/markupsafe/releases)
- [Changelog](https://github.com/pallets/markupsafe/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/markupsafe/compare/2.1.5...3.0.1)
---
updated-dependencies:
- dependency-name: markupsafe
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-indirect.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-indirect.txt b/requirements/requirements-indirect.txt
index 3855fa71a..6efec550c 100644
--- a/requirements/requirements-indirect.txt
+++ b/requirements/requirements-indirect.txt
@@ -7,7 +7,7 @@ Deprecated==1.2.14
exceptiongroup==1.2.2
idna==3.10
incremental==24.7.2
-MarkupSafe==2.1.5
+MarkupSafe==3.0.1
packaging==24.1
pyasn1==0.6.1
pyasn1-modules==0.4.1
From b1ee6a4fc704a1dca511319fd5f06d10ed88176a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:12:44 +0000
Subject: [PATCH 233/266] build(deps): bump sphinx from 8.0.2 to 8.1.3 (#1310)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.0.2 to 8.1.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.0.2...v8.1.3)
---
updated-dependencies:
- dependency-name: sphinx
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-docs.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-docs.txt b/requirements/requirements-docs.txt
index b36aef1d0..70cf9ec79 100644
--- a/requirements/requirements-docs.txt
+++ b/requirements/requirements-docs.txt
@@ -1,3 +1,3 @@
furo==2024.8.6
-Sphinx==8.0.2
+Sphinx==8.1.3
sphinx-autobuild==2024.10.3
From de17cb03f9d101c31fc18d3021f88ea45d355152 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:20:18 +0000
Subject: [PATCH 234/266] build(deps): bump pre-commit from 4.0.0 to 4.0.1
(#1308)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.0.0...v4.0.1)
---
updated-dependencies:
- dependency-name: pre-commit
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-lint.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-lint.txt b/requirements/requirements-lint.txt
index 7ffa20c41..e88d27155 100644
--- a/requirements/requirements-lint.txt
+++ b/requirements/requirements-lint.txt
@@ -1 +1 @@
-pre-commit==4.0.0
+pre-commit==4.0.1
From 1da8925cc5b4650bc50df9ca68e12224a6cb2b81 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:28:43 +0000
Subject: [PATCH 235/266] build(deps): bump pyparsing from 3.1.4 to 3.2.0
(#1306)
Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 3.1.4 to 3.2.0.
- [Release notes](https://github.com/pyparsing/pyparsing/releases)
- [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES)
- [Commits](https://github.com/pyparsing/pyparsing/compare/3.1.4...3.2.0)
---
updated-dependencies:
- dependency-name: pyparsing
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-indirect.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-indirect.txt b/requirements/requirements-indirect.txt
index 6efec550c..17f6eb98f 100644
--- a/requirements/requirements-indirect.txt
+++ b/requirements/requirements-indirect.txt
@@ -12,7 +12,7 @@ packaging==24.1
pyasn1==0.6.1
pyasn1-modules==0.4.1
pycparser==2.22
-pyparsing==3.1.4
+pyparsing==3.2.0
python-dateutil==2.9.0.post0
six==1.16.0
sortedcontainers==2.4.0
From c3ebb3c725a142584726011f8e034a9abbebe07d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:37:47 +0000
Subject: [PATCH 236/266] build(deps): bump charset-normalizer from 3.3.2 to
3.4.0 (#1305)
Bumps [charset-normalizer](https://github.com/Ousret/charset_normalizer) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/Ousret/charset_normalizer/releases)
- [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Ousret/charset_normalizer/compare/3.3.2...3.4.0)
---
updated-dependencies:
- dependency-name: charset-normalizer
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-indirect.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-indirect.txt b/requirements/requirements-indirect.txt
index 17f6eb98f..2c773b0df 100644
--- a/requirements/requirements-indirect.txt
+++ b/requirements/requirements-indirect.txt
@@ -1,7 +1,7 @@
Automat==24.8.1
certifi==2024.8.30
cffi==1.17.1
-charset-normalizer==3.3.2
+charset-normalizer==3.4.0
constantly==23.10.4
Deprecated==1.2.14
exceptiongroup==1.2.2
From 4457a25e2969f5cc4310247716f04a2d5cc5b383 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:45:59 +0000
Subject: [PATCH 237/266] build(deps): bump hypothesis from 6.112.4 to 6.115.0
(#1309)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.112.4 to 6.115.0.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.112.4...hypothesis-python-6.115.0)
---
updated-dependencies:
- dependency-name: hypothesis
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-tests.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt
index 6a69c119f..b3006b7f0 100644
--- a/requirements/requirements-tests.txt
+++ b/requirements/requirements-tests.txt
@@ -1,3 +1,3 @@
docker==7.1.0
-hypothesis==6.112.4
+hypothesis==6.115.0
mock==5.1.0
From fc63a9be4eb5782c05fd72065a8901b818a51983 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 04:53:58 +0000
Subject: [PATCH 238/266] build(deps): bump coverage from 7.6.1 to 7.6.3
(#1303)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.1 to 7.6.3.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.6.1...7.6.3)
---
updated-dependencies:
- dependency-name: coverage
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-coverage.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-coverage.txt b/requirements/requirements-coverage.txt
index 1bf0f9a76..135d77e78 100644
--- a/requirements/requirements-coverage.txt
+++ b/requirements/requirements-coverage.txt
@@ -1 +1 @@
-coverage==7.6.1
+coverage==7.6.3
From 8f982753fc82d3c34fcb14d29a3b017fa7d4542e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 05:01:36 +0000
Subject: [PATCH 239/266] build(deps): bump mypy-zope from 1.0.5 to 1.0.7
(#1307)
Bumps [mypy-zope](https://github.com/Shoobx/mypy-zope) from 1.0.5 to 1.0.7.
- [Changelog](https://github.com/Shoobx/mypy-zope/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shoobx/mypy-zope/compare/1.0.5...1.0.7)
---
updated-dependencies:
- dependency-name: mypy-zope
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-mypy.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-mypy.txt b/requirements/requirements-mypy.txt
index 145ef4dd0..1e7c2abd4 100644
--- a/requirements/requirements-mypy.txt
+++ b/requirements/requirements-mypy.txt
@@ -1,7 +1,7 @@
# Note: mypy-zope pins the mypy version
mypy==1.9.0
-mypy-zope==1.0.5
+mypy-zope==1.0.7
types-PyMySQL==1.1.0.20240524
types-PyYAML==6.0.12.20240917
From 94a9ec0c581b83efbd5e228a1b7aa4f1223052d9 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 14 Oct 2024 16:58:48 +0000
Subject: [PATCH 240/266] [pre-commit.ci] pre-commit autoupdate (#1311)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
updates:
- [github.com/asottile/pyupgrade: v3.17.0 → v3.18.0](https://github.com/asottile/pyupgrade/compare/v3.17.0...v3.18.0)
- [github.com/psf/black: 24.8.0 → 24.10.0](https://github.com/psf/black/compare/24.8.0...24.10.0)
- [github.com/mgedmin/check-manifest: 0.49 → 0.50](https://github.com/mgedmin/check-manifest/compare/0.49...0.50)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.pre-commit-config.yaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ed6ae1a2e..a32396944 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -5,13 +5,13 @@ ci:
repos:
- repo: https://github.com/asottile/pyupgrade
- rev: "v3.17.0"
+ rev: "v3.18.0"
hooks:
- id: pyupgrade
args: ["--py312-plus"]
- repo: https://github.com/psf/black
- rev: "24.8.0"
+ rev: "24.10.0"
hooks:
- id: black
args: ["--target-version", "py312"]
@@ -106,6 +106,6 @@ repos:
- id: text-unicode-replacement-char
- repo: https://github.com/mgedmin/check-manifest
- rev: "0.49"
+ rev: "0.50"
hooks:
- id: check-manifest
From 2f8609918f02cbfce61161cdfabc33d2b7715835 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Oct 2024 03:21:14 +0000
Subject: [PATCH 241/266] build(deps): bump coverage from 7.6.3 to 7.6.4
(#1312)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.3 to 7.6.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.6.3...7.6.4)
---
updated-dependencies:
- dependency-name: coverage
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-coverage.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-coverage.txt b/requirements/requirements-coverage.txt
index 135d77e78..fabb4bbe4 100644
--- a/requirements/requirements-coverage.txt
+++ b/requirements/requirements-coverage.txt
@@ -1 +1 @@
-coverage==7.6.3
+coverage==7.6.4
From 88e951355001982ffc0aa8b5560e5b5ee3faa9b3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Oct 2024 03:28:54 +0000
Subject: [PATCH 242/266] build(deps): bump markupsafe from 3.0.1 to 3.0.2
(#1313)
Bumps [markupsafe](https://github.com/pallets/markupsafe) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/pallets/markupsafe/releases)
- [Changelog](https://github.com/pallets/markupsafe/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/markupsafe/compare/3.0.1...3.0.2)
---
updated-dependencies:
- dependency-name: markupsafe
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-indirect.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-indirect.txt b/requirements/requirements-indirect.txt
index 2c773b0df..8cb83b094 100644
--- a/requirements/requirements-indirect.txt
+++ b/requirements/requirements-indirect.txt
@@ -7,7 +7,7 @@ Deprecated==1.2.14
exceptiongroup==1.2.2
idna==3.10
incremental==24.7.2
-MarkupSafe==3.0.1
+MarkupSafe==3.0.2
packaging==24.1
pyasn1==0.6.1
pyasn1-modules==0.4.1
From c01f29b6e7b84e79bbb6bb327bac453a27a9f21d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Oct 2024 03:36:51 +0000
Subject: [PATCH 243/266] build(deps): bump cryptography from 43.0.1 to 43.0.3
(#1315)
Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.1 to 43.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/43.0.1...43.0.3)
---
updated-dependencies:
- dependency-name: cryptography
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 4f07a2cef..27a18c0ea 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -2,7 +2,7 @@ arrow==1.3.0
attrs==24.2.0
bcrypt==4.2.0
cattrs==24.1.2
-cryptography==43.0.1
+cryptography==43.0.3
hyperlink==21.0.0
jwcrypto==1.5.6
klein==24.8.0
From af59d09aaab17ac7b55dda2955e8500313d336d6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Oct 2024 03:44:51 +0000
Subject: [PATCH 244/266] build(deps): bump hypothesis from 6.115.0 to 6.115.3
(#1314)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.115.0 to 6.115.3.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.115.0...hypothesis-python-6.115.3)
---
updated-dependencies:
- dependency-name: hypothesis
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-tests.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt
index b3006b7f0..2f9a17235 100644
--- a/requirements/requirements-tests.txt
+++ b/requirements/requirements-tests.txt
@@ -1,3 +1,3 @@
docker==7.1.0
-hypothesis==6.115.0
+hypothesis==6.115.3
mock==5.1.0
From 2fb54a42e1f21dac951077a4be522a6b6ab8f939 Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Wed, 23 Oct 2024 06:43:37 -0600
Subject: [PATCH 245/266] docs: create CHANGELOG.md
---
CHANGELOG.md | 29 +++++++++++++++++++++++++++++
MANIFEST.in | 1 +
2 files changed, 30 insertions(+)
create mode 100644 CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 000000000..8ad86809f
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,29 @@
+# Changelog
+
+This is the changelog for ranger-ims-server. This is intended to summarize changes over time,
+for example to inform the Operator team each event of any differences to expect.
+
+This file must use the [Common Changelog format](https://common-changelog.org/), with the variation
+that we use months rather than version numbers. We don't include dependency version upgrades in the
+changelog, as those would pollute this too much.
+
+## 2024-10
+
+### Added
+
+- Encourage users to log in by email address, rather than by Ranger handle ([#1293](https://github.com/burningmantech/ranger-ims-server/pull/1293))
+- Use text and datalist for "Add Ranger" on incident page, rather than a select ([#1292](https://github.com/burningmantech/ranger-ims-server/pull/1292))
+
+### Fixed
+
+- Stop using hardcoded 1-hour limit on IMS sessions; use timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
+
+## 2024-01
+
+### Added
+
+- Help user not lose unsaved changes to incident entries and incident report entries ([#1088](https://github.com/burningmantech/ranger-ims-server/pull/1088))
+
+### Fixed
+
+- Do case-insensitive sorting of Ranger handles on incident page ([#1089](https://github.com/burningmantech/ranger-ims-server/pull/1089))
diff --git a/MANIFEST.in b/MANIFEST.in
index a1fe4acbb..c1a9feb24 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -14,6 +14,7 @@ include bin/mysql-run
include bin/run
include bin/shell
include bin/test_docker
+include CHANGELOG.md
include codecov.yml
include conf/directory-sample.yaml
include conf/imsd-docker-compose-sample.conf
From 8e19d7f44daa24a402f5135bc268b1652e02222e Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Wed, 23 Oct 2024 11:58:16 -0400
Subject: [PATCH 246/266] feat: don't serialize personnel email to JSON
We have an authenticated API endpoint that lists all Rangers' handles,
names, and email addresses. That endpoint is currently only used to
serve the "Add Rangers" functionality on the incident page. Nothing
in the UI requires use of these email addresses. We can get a nice
little privacy win by not exposing them anymore. Note that this PR
uses the same approach to not serializing email that we already use
to not serialize passwords.
See here for an example of personnel:
https://ranger-ims.burningman.org/ims/api/personnel/
and note that no JS code references email:
https://github.com/search?q=repo%3Aburningmantech%2Franger-ims-server%20lang%3Ajs+email&type=code
and that the JS code in ranger-ims-web does expect the email field, but
it doesn't use it anywhere:
https://github.com/search?q=repo%3Aburningmantech%2Franger-ims-web%20lang%3Ajs+email&type=code
---
src/ims/model/_ranger.py | 4 +++-
src/ims/model/json/_ranger.py | 6 ++++--
src/ims/model/json/test/json.py | 5 +++--
src/ims/model/json/test/test_ranger.py | 5 ++++-
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/ims/model/_ranger.py b/src/ims/model/_ranger.py
index 325a5fa72..4e72b6045 100644
--- a/src/ims/model/_ranger.py
+++ b/src/ims/model/_ranger.py
@@ -73,7 +73,9 @@ class Ranger(ReplaceMixIn):
handle: str
name: str
status: RangerStatus
- email: frozenset[str] = field(converter=freezeStrings)
+ email: frozenset[str] = field(
+ converter=freezeStrings, default=frozenset[str]()
+ )
enabled: bool
directoryID: str | None
password: str | None = field(
diff --git a/src/ims/model/json/_ranger.py b/src/ims/model/json/_ranger.py
index cb6518963..850052b11 100644
--- a/src/ims/model/json/_ranger.py
+++ b/src/ims/model/json/_ranger.py
@@ -42,9 +42,10 @@ class RangerJSONKey(Enum):
handle = "handle"
name = "name"
status = "status"
- email = "email"
+ # email is intentionally not serialized, since no web client needs it
enabled = "enabled"
directoryID = "directory_id"
+ # password is intentionally not serialized, since no web client needs it
class RangerJSONType(Enum):
@@ -55,9 +56,10 @@ class RangerJSONType(Enum):
handle = str
name = str # type: ignore[assignment]
status = RangerStatus
- email = set[str]
+ # email is intentionally not serialized, since no web client needs it
enabled = bool
directoryID = Optional[str]
+ # password is intentionally not serialized, since no web client needs it
def serializeRanger(ranger: Ranger) -> dict[str, Any]:
diff --git a/src/ims/model/json/test/json.py b/src/ims/model/json/test/json.py
index 2853b8d5c..e4352e3a3 100644
--- a/src/ims/model/json/test/json.py
+++ b/src/ims/model/json/test/json.py
@@ -186,9 +186,10 @@ def jsonFromRanger(ranger: Ranger) -> dict[str, Any]:
handle=ranger.handle,
name=ranger.name,
status=jsonFromRangerStatus(ranger.status),
- directory_id=ranger.directoryID,
- email=jsonSerialize([e for e in ranger.email]),
+ # email is intentionally not serialized
enabled=ranger.enabled,
+ directory_id=ranger.directoryID,
+ # password is intentionally not serialized
)
diff --git a/src/ims/model/json/test/test_ranger.py b/src/ims/model/json/test/test_ranger.py
index 06eff9453..043df8b45 100644
--- a/src/ims/model/json/test/test_ranger.py
+++ b/src/ims/model/json/test/test_ranger.py
@@ -56,5 +56,8 @@ def test_deserialize(self, ranger: Ranger) -> None:
"""
self.assertEqual(
jsonDeserialize(jsonFromRanger(ranger), Ranger),
- ranger.replace(password=None),
+ ranger.replace(
+ email=frozenset(),
+ password=None,
+ ),
)
From 954498eb125bb9a83d2b922361abef4935f228ba Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Wed, 23 Oct 2024 11:28:51 -0600
Subject: [PATCH 247/266] docs: update CHANGELOG.md
---
CHANGELOG.md | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ad86809f..47a2bfc67 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,22 +7,32 @@ This file must use the [Common Changelog format](https://common-changelog.org/),
that we use months rather than version numbers. We don't include dependency version upgrades in the
changelog, as those would pollute this too much.
+
+
## 2024-10
-### Added
+### Changed
-- Encourage users to log in by email address, rather than by Ranger handle ([#1293](https://github.com/burningmantech/ranger-ims-server/pull/1293))
-- Use text and datalist for "Add Ranger" on incident page, rather than a select ([#1292](https://github.com/burningmantech/ranger-ims-server/pull/1292))
+- Changed login screen to encourage users to log in by email address, rather than by Ranger handle ([#1293](https://github.com/burningmantech/ranger-ims-server/pull/1293))
+- Used text and datalist for "Add Ranger" on incident page, rather than a select field ([#1292](https://github.com/burningmantech/ranger-ims-server/pull/1292))
+- Removed email address from the personnel API endpoint ([#1317](https://github.com/burningmantech/ranger-ims-server/pull/1317))
### Fixed
-- Stop using hardcoded 1-hour limit on IMS sessions; use timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
+- Stopped using hardcoded 1-hour limit on IMS sessions; use timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
## 2024-01
### Added
-- Help user not lose unsaved changes to incident entries and incident report entries ([#1088](https://github.com/burningmantech/ranger-ims-server/pull/1088))
+- Added "Changes you made may not be saved" browser popup when a user might otherwise lose data on incident entries and incident report entries ([#1088](https://github.com/burningmantech/ranger-ims-server/pull/1088))
### Fixed
From 34233bb003d57e0577aa7d1c28389506588b2baa Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Thu, 24 Oct 2024 07:11:00 -0400
Subject: [PATCH 248/266] feat: add groupings to "add incident report" dropdown
The current ordering of incident reports is confusing. This
adds optgroups to make that ordering more understandable, and
it sorts each optgroup by incident report number.
See https://github.com/burningmantech/ranger-ims-server/issues/1319
for more details and screenshots
---
src/ims/element/static/incident.js | 37 ++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/src/ims/element/static/incident.js b/src/ims/element/static/incident.js
index 904efee8d..8d0d952f1 100644
--- a/src/ims/element/static/incident.js
+++ b/src/ims/element/static/incident.js
@@ -327,7 +327,16 @@ function loadUnattachedIncidentReports(success) {
}
function ok(data, status, xhr) {
- unattachedIncidentReports = data;
+ const _unattachedIncidentReports = [];
+ for (const d of data) {
+ _unattachedIncidentReports.push(d);
+ }
+ // apply an ascending sort based on the incident report number,
+ // being cautious about incident report number being null
+ _unattachedIncidentReports.sort(function (a, b) {
+ return (a.number ?? -1) - (b.number ?? -1);
+ })
+ unattachedIncidentReports = _unattachedIncidentReports;
if (success != undefined) {
success();
@@ -789,15 +798,35 @@ function drawIncidentReportsToAttach() {
if (unattachedIncidentReports.length == 0) {
container.addClass("hidden");
} else {
- for (var i in unattachedIncidentReports) {
- var report = unattachedIncidentReports[i];
- var option = $("");
+ select.append($(""));
+
+ select.append($(""));
+
container.removeClass("hidden");
}
}
From fa688e76822524245078967df0edf6f74372578b Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Thu, 24 Oct 2024 15:23:32 -0600
Subject: [PATCH 249/266] Update CHANGELOG.md
---
CHANGELOG.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47a2bfc67..0d5dd69dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,9 +24,13 @@ Each month below should look like the following, using the same ordering for the
- Used text and datalist for "Add Ranger" on incident page, rather than a select field ([#1292](https://github.com/burningmantech/ranger-ims-server/pull/1292))
- Removed email address from the personnel API endpoint ([#1317](https://github.com/burningmantech/ranger-ims-server/pull/1317))
+### Added
+
+- Added groupings to the "add incident report" dropdown, which emphasize which incident reports are or are not attached to any other incident. This also simplified the sort order for that list ([#1321](https://github.com/burningmantech/ranger-ims-server/pull/1321))
+
### Fixed
-- Stopped using hardcoded 1-hour limit on IMS sessions; use timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
+- Stopped using hardcoded 1-hour limit on IMS sessions; used timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
## 2024-01
From b89eba2c050070a747c717badbced8eeed18b8df Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Thu, 24 Oct 2024 14:57:29 -0400
Subject: [PATCH 250/266] feat: allow more than 6 tabs per browser session
I was inspired by this comment on Reddit (the first in the list):
https://www.reddit.com/r/webdev/comments/149bjod/comment/kwm0742/
Rather than having each tab establish an eventsource connection
individually, this changes it so that all tabs share one eventsource.
That's done by having one tab become the leader (Web Locks API),
then having it fan out updates to all the other tabs in the session
(Broadcast Channel API).
If the leader tab's connection to the EventSource gets closed, then
the tab relinquishes the lock and allows another tab to set up the
connection again.
---
src/ims/element/static/ims.js | 61 +++++++++++++++++++---
src/ims/element/static/incident.js | 15 +++---
src/ims/element/static/incident_reports.js | 12 ++---
src/ims/element/static/incidents.js | 12 ++---
4 files changed, 70 insertions(+), 30 deletions(-)
diff --git a/src/ims/element/static/ims.js b/src/ims/element/static/ims.js
index 2bccdacda..ae580d2a2 100644
--- a/src/ims/element/static/ims.js
+++ b/src/ims/element/static/ims.js
@@ -831,22 +831,69 @@ function editFromElement(element, jsonKey, transform) {
// EventSource
//
-var eventSource = null;
-
-function subscribeToUpdates() {
- eventSource = new EventSource(
+const incidentChannelName = "incident_update";
+const incidentReportChannelName= "incident_report_update";
+
+// Call this from each browsing context, so that it can queue up to become a leader
+// to manage the EventSource.
+function requestEventSourceLock() {
+ // Acquire the lock, set up the event source, and start
+ // broadcasting events to other browsing contexts.
+ navigator.locks.request("ims_eventsource_lock", () => {
+ let resolve;
+ const p = new Promise((res) => {
+ resolve = res;
+ });
+ subscribeToUpdates(resolve);
+ return p;
+ });
+}
+
+// This starts the EventSource call and configures event listeners to propagate
+// updates to BroadcastChannels. The idea is that only one browsing context should
+// have an EventSource connection at any given time.
+//
+// The "closed" param is a callback to notify the caller that the EventSource has
+// been closed.
+function subscribeToUpdates(closed) {
+ const eventSource = new EventSource(
url_eventSource, { withCredentials: true }
);
- eventSource.addEventListener("open", function(e) {
+ eventSource.addEventListener("open", function() {
console.log("Event listener opened");
}, true);
- eventSource.addEventListener("error", function(e) {
- if (e.readyState == EventSource.CLOSED) {
+ eventSource.addEventListener("error", function() {
+ if (eventSource.readyState === EventSource.CLOSED) {
console.log("Event listener closed");
+ eventSource.close();
+ closed();
} else {
+ // This is likely a retriable error, and EventSource will automatically
+ // attempt reconnection.
console.log("Event listener error");
}
}, true);
+
+ eventSource.addEventListener("Incident", function(e) {
+ const jsonText = e.data;
+ const json = JSON.parse(jsonText);
+ const number = json["incident_number"];
+
+ const send = new BroadcastChannel(incidentChannelName);
+ send.postMessage(number);
+ }, true);
+
+ // TODO: this will never receive any events currently, since the server isn't configured to
+ // fire events for IncidentReports. See
+ // https://github.com/burningmantech/ranger-ims-server/blob/954498eb125bb9a83d2b922361abef4935f228ba/src/ims/application/_eventsource.py#L113-L135
+ eventSource.addEventListener("IncidentReport", function(e) {
+ const jsonText = e.data;
+ const json = JSON.parse(jsonText);
+ const number = json["incident_report_number"];
+
+ const send = new BroadcastChannel(incidentReportChannelName);
+ send.postMessage(number);
+ }, true);
}
diff --git a/src/ims/element/static/incident.js b/src/ims/element/static/incident.js
index 8d0d952f1..058a6cdf9 100644
--- a/src/ims/element/static/incident.js
+++ b/src/ims/element/static/incident.js
@@ -46,20 +46,17 @@ function initIncidentPage() {
loadAndDisplayIncident(loadedIncident);
// Updates
+ requestEventSourceLock();
- subscribeToUpdates();
-
- eventSource.addEventListener("Incident", function(e) {
- var jsonText = e.data;
- var json = JSON.parse(jsonText);
- var number = json["incident_number"];
-
+ const incidentChannel = new BroadcastChannel(incidentChannelName);
+ incidentChannel.onmessage = function (e) {
+ const number = e.data;
if (number == incidentNumber) {
- console.log("Got incident update");
+ console.log("Got incident update: " + number);
loadAndDisplayIncident();
loadAndDisplayIncidentReports();
}
- }, true);
+ }
// Keyboard shortcuts
diff --git a/src/ims/element/static/incident_reports.js b/src/ims/element/static/incident_reports.js
index 56b2a0ad7..f4613f1bd 100644
--- a/src/ims/element/static/incident_reports.js
+++ b/src/ims/element/static/incident_reports.js
@@ -75,16 +75,14 @@ function initIncidentReportsTable() {
enableEditing();
}
- subscribeToUpdates();
-
- eventSource.addEventListener("IncidentReport", function(e) {
- var jsonText = e.data;
- var json = JSON.parse(jsonText);
- var number = json["incident_report_number"];
+ requestEventSourceLock();
+ const incidentReportChannel = new BroadcastChannel(incidentReportChannelName);
+ incidentReportChannel.onmessageonmessage = function (e) {
+ const number = e.data;
console.log("Got incident report update: " + number);
incidentReportsTable.ajax.reload();
- }, true);
+ }
}
diff --git a/src/ims/element/static/incidents.js b/src/ims/element/static/incidents.js
index c33f676fd..05f0ca38a 100644
--- a/src/ims/element/static/incidents.js
+++ b/src/ims/element/static/incidents.js
@@ -113,16 +113,14 @@ function initIncidentsTable() {
enableEditing();
}
- subscribeToUpdates();
-
- eventSource.addEventListener("Incident", function(e) {
- var jsonText = e.data;
- var json = JSON.parse(jsonText);
- var number = json["incident_number"];
+ requestEventSourceLock();
+ const incidentChannel = new BroadcastChannel(incidentChannelName);
+ incidentChannel.onmessage = function (e) {
+ const number = e.data;
console.log("Got incident update: " + number);
incidentsTable.ajax.reload();
- }, true);
+ }
}
From 700df87c703f291906e64c7f77bceac3ba4fea4e Mon Sep 17 00:00:00 2001
From: "Sean R. Abraham"
Date: Sun, 27 Oct 2024 10:01:43 -0600
Subject: [PATCH 251/266] Update CHANGELOG.md
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d5dd69dc..f2d4e0567 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ Each month below should look like the following, using the same ordering for the
### Changed
+- Resolved IMS's longstanding 6-open-tab limitation ([#1320](https://github.com/burningmantech/ranger-ims-server/issues/1320)) ([#1322](https://github.com/burningmantech/ranger-ims-server/pull/1322))
- Changed login screen to encourage users to log in by email address, rather than by Ranger handle ([#1293](https://github.com/burningmantech/ranger-ims-server/pull/1293))
- Used text and datalist for "Add Ranger" on incident page, rather than a select field ([#1292](https://github.com/burningmantech/ranger-ims-server/pull/1292))
- Removed email address from the personnel API endpoint ([#1317](https://github.com/burningmantech/ranger-ims-server/pull/1317))
From dc7115014832c834a19f9053a3cf11267b49dc5d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 27 Oct 2024 23:35:53 +0000
Subject: [PATCH 252/266] Bump mypy from 1.9.0 to 1.11.2 (#1273)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Bump mypy from 1.9.0 to 1.11.2
Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.11.2.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/1.9.0...v1.11.2)
---
updated-dependencies:
- dependency-name: mypy
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
* Update all
* Revert "Update all"
This reverts commit 6a71bbbce4179065b12122198b897adf0c716706.
* Bump mypy-zope to 1.0.8
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wilfredo Sánchez
From 9a2eb903ad1cc89b62b273d0af814f018c8173f0 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 03:42:23 +0000
Subject: [PATCH 253/266] build(deps): bump service-identity from 24.1.0 to
24.2.0 (#1329)
Bumps [service-identity](https://github.com/sponsors/hynek) from 24.1.0 to 24.2.0.
- [Commits](https://github.com/sponsors/hynek/commits)
---
updated-dependencies:
- dependency-name: service-identity
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 27a18c0ea..6cc458753 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -9,7 +9,7 @@ klein==24.8.0
PyMySQL==1.1.1
pyOpenSSL==24.2.1
PyYAML==6.0.2
-service-identity==24.1.0
+service-identity==24.2.0
Twisted==24.7.0
Werkzeug==3.0.4
zope.interface==7.1.0
From 3d00f9efb110db49c86182c8de057de1dc496994 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 03:50:15 +0000
Subject: [PATCH 254/266] build(deps): bump twisted from 24.7.0 to 24.10.0
(#1331)
Bumps [twisted](https://github.com/twisted/twisted) from 24.7.0 to 24.10.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-24.7.0...twisted-24.10.0)
---
updated-dependencies:
- dependency-name: twisted
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 6cc458753..7314ccd82 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -10,6 +10,6 @@ PyMySQL==1.1.1
pyOpenSSL==24.2.1
PyYAML==6.0.2
service-identity==24.2.0
-Twisted==24.7.0
+Twisted==24.10.0
Werkzeug==3.0.4
zope.interface==7.1.0
From ee8ea3046f2229cb38f2464d3bd422f64c5f716f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 03:57:54 +0000
Subject: [PATCH 255/266] build(deps): bump hypothesis from 6.115.3 to 6.115.5
(#1332)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.115.3 to 6.115.5.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.115.3...hypothesis-python-6.115.5)
---
updated-dependencies:
- dependency-name: hypothesis
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-tests.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt
index 2f9a17235..651bbb1d6 100644
--- a/requirements/requirements-tests.txt
+++ b/requirements/requirements-tests.txt
@@ -1,3 +1,3 @@
docker==7.1.0
-hypothesis==6.115.3
+hypothesis==6.115.5
mock==5.1.0
From 9cf28621cbfcdde3e28a72e03c2b65d104dcea54 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 04:05:42 +0000
Subject: [PATCH 256/266] build(deps): bump mypy-zope from 1.0.7 to 1.0.8
(#1334)
Bumps [mypy-zope](https://github.com/Shoobx/mypy-zope) from 1.0.7 to 1.0.8.
- [Changelog](https://github.com/Shoobx/mypy-zope/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shoobx/mypy-zope/compare/1.0.7...1.0.8)
---
updated-dependencies:
- dependency-name: mypy-zope
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-mypy.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-mypy.txt b/requirements/requirements-mypy.txt
index 1e7c2abd4..b022a7b2e 100644
--- a/requirements/requirements-mypy.txt
+++ b/requirements/requirements-mypy.txt
@@ -1,7 +1,7 @@
# Note: mypy-zope pins the mypy version
mypy==1.9.0
-mypy-zope==1.0.7
+mypy-zope==1.0.8
types-PyMySQL==1.1.0.20240524
types-PyYAML==6.0.12.20240917
From a96616a0e25cced3deca545875d6885a1792f4fa Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 04:13:27 +0000
Subject: [PATCH 257/266] build(deps): bump werkzeug from 3.0.4 to 3.0.6
(#1330)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.4 to 3.0.6.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.4...3.0.6)
---
updated-dependencies:
- dependency-name: werkzeug
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 7314ccd82..2533a7bdb 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -11,5 +11,5 @@ pyOpenSSL==24.2.1
PyYAML==6.0.2
service-identity==24.2.0
Twisted==24.10.0
-Werkzeug==3.0.4
+Werkzeug==3.0.6
zope.interface==7.1.0
From 0c201ea2c2a6ef527566071212ab6ab0088acbe2 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 04:21:27 +0000
Subject: [PATCH 258/266] build(deps): bump zope-interface from 7.1.0 to 7.1.1
(#1333)
Bumps [zope-interface](https://github.com/zopefoundation/zope.interface) from 7.1.0 to 7.1.1.
- [Changelog](https://github.com/zopefoundation/zope.interface/blob/master/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/zope.interface/compare/7.1.0...7.1.1)
---
updated-dependencies:
- dependency-name: zope-interface
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements/requirements-direct.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements/requirements-direct.txt b/requirements/requirements-direct.txt
index 2533a7bdb..763927f15 100644
--- a/requirements/requirements-direct.txt
+++ b/requirements/requirements-direct.txt
@@ -12,4 +12,4 @@ PyYAML==6.0.2
service-identity==24.2.0
Twisted==24.10.0
Werkzeug==3.0.6
-zope.interface==7.1.0
+zope.interface==7.1.1
From cb8b241da99ac9333b1b03366a140b2603358ca3 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 16:59:20 +0000
Subject: [PATCH 259/266] [pre-commit.ci] pre-commit autoupdate (#1336)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
updates:
- [github.com/asottile/pyupgrade: v3.18.0 → v3.19.0](https://github.com/asottile/pyupgrade/compare/v3.18.0...v3.19.0)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.pre-commit-config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a32396944..337dca09f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -5,7 +5,7 @@ ci:
repos:
- repo: https://github.com/asottile/pyupgrade
- rev: "v3.18.0"
+ rev: "v3.19.0"
hooks:
- id: pyupgrade
args: ["--py312-plus"]
From 377ac8dc6a3baaaa4094c9ad3dfeda45b258e9bb Mon Sep 17 00:00:00 2001
From: Sean Abraham
Date: Mon, 28 Oct 2024 09:28:45 -0400
Subject: [PATCH 260/266] feat: display errors on pages rather than with
browser alerts
I wrote a lot more about this here. The short story is that IMS
uses browser alert popups almost every time something goes wrong.
Those become menaces when the user's session is no longer valid,
but when they still have browser tabs open to IMS, because the
SSEs keep coming through, encouraging those tabs to reload data
they won't be able to load.
https://github.com/burningmantech/ranger-ims-server/issues/1327
This instead puts red error text at the top of a page when an
error has occurred. I had to do some unexpected work to get the
DataTables part to stop alerting, because DataTables itself
normally fires alerts on errors too.
---
CHANGELOG.md | 1 +
.../incident/incident_template/template.xhtml | 4 ++
.../incidents_template/template.xhtml | 5 ++
.../incident/report_template/template.xhtml | 5 ++
.../incident/reports_template/template.xhtml | 5 ++
src/ims/element/static/incident.js | 65 +++++++++++--------
src/ims/element/static/incident_report.js | 28 ++++++--
src/ims/element/static/incident_reports.js | 28 +++++++-
src/ims/element/static/incidents.js | 33 ++++++++--
9 files changed, 133 insertions(+), 41 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f2d4e0567..3a9cefc37 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ Each month below should look like the following, using the same ordering for the
### Fixed
- Stopped using hardcoded 1-hour limit on IMS sessions; used timeout from JWT instead ([#1301](https://github.com/burningmantech/ranger-ims-server/pull/1301))
+- Got rid of the browser popup alerts that occurred frequently on JavaScript errors. Instead, error messages will now be written to a text field near the top of each page ([#1335](https://github.com/burningmantech/ranger-ims-server/pull/1335))
## 2024-01
diff --git a/src/ims/element/incident/incident_template/template.xhtml b/src/ims/element/incident/incident_template/template.xhtml
index 9801d27a5..c97aa3abc 100644
--- a/src/ims/element/incident/incident_template/template.xhtml
+++ b/src/ims/element/incident/incident_template/template.xhtml
@@ -1,6 +1,10 @@