From 1e1b189d773e134c67d643021fcd045c66733d7e Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 9 Jun 2023 12:54:41 -0700 Subject: [PATCH 01/78] Remove py3.7 (#234) * Remove py3.7 * Restore cache action --- .github/workflows/ci.yml | 2 +- dev-requirements.txt | 2 +- requirements.txt | 2 +- tox.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 714342dd..c6ca4a3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v3 diff --git a/dev-requirements.txt b/dev-requirements.txt index e5ecac73..e1dcf948 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==6.4.1 -fakeredis==1.7.5 +fakeredis==2.10.2 flake8==6.0.0 freezegun==1.2.1 pytest==7.1.2 diff --git a/requirements.txt b/requirements.txt index 76c5b71c..43d34c4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ Flask==2.1.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 -redis==4.3.3 +redis==4.5.3 Werkzeug==2.2.3 diff --git a/tox.ini b/tox.ini index 5430e6b3..92223a8a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37, py38, py39, py310, flake8 +envlist = py38, py39, py310, flake8 [testenv] setenv = From 6f02f6e2b73250b2e66cd0f421d296df90c4bdca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:01:50 -0700 Subject: [PATCH 02/78] Bump cryptography from 39.0.2 to 41.0.1 (#260) Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.2 to 41.0.1. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/39.0.2...41.0.1) --- updated-dependencies: - dependency-name: cryptography 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.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 43d34c4e..7a122aec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==39.0.2 +cryptography==41.0.1 Flask==2.1.2 itsdangerous==2.1.2 Jinja2==3.1.2 From 013c0d1e775ab552625196aa3a73158821700f64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:15:29 -0700 Subject: [PATCH 03/78] Bump tox from 3.25.0 to 4.6.0 (#262) Bumps [tox](https://github.com/tox-dev/tox) from 3.25.0 to 4.6.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.25.0...4.6.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index e1dcf948..072b621f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,4 +4,4 @@ flake8==6.0.0 freezegun==1.2.1 pytest==7.1.2 pytest-cov==3.0.0 -tox==3.25.0 +tox==4.6.0 From 95f5c352914eafe448d6d8fb6964a656498f16ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:19:43 -0700 Subject: [PATCH 04/78] Bump fakeredis from 1.7.5 to 2.14.1 (#263) Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 1.7.5 to 2.14.1. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v1.7.5...v2.14.1) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 072b621f..eb109d80 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==6.4.1 -fakeredis==2.10.2 +fakeredis==2.14.1 flake8==6.0.0 freezegun==1.2.1 pytest==7.1.2 From 147bdf390a126b1be34b110874fcf4778a962d8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:30:50 -0700 Subject: [PATCH 05/78] Bump flask from 2.1.2 to 2.3.2 (#250) Bumps [flask](https://github.com/pallets/flask) from 2.1.2 to 2.3.2. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.1.2...2.3.2) --- updated-dependencies: - dependency-name: flask dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7a122aec..f25b7102 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cryptography==41.0.1 -Flask==2.1.2 +Flask==2.3.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 redis==4.5.3 -Werkzeug==2.2.3 +Werkzeug==2.3.3 From 6fec10eaab1757fdc76a00d5953d2828c77aaab4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:38:04 -0700 Subject: [PATCH 06/78] Bump pytest from 7.1.2 to 7.3.1 (#243) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.2 to 7.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index eb109d80..5aff2e1a 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,6 +2,6 @@ coverage==6.4.1 fakeredis==2.14.1 flake8==6.0.0 freezegun==1.2.1 -pytest==7.1.2 +pytest==7.3.1 pytest-cov==3.0.0 tox==4.6.0 From a34aaf8bb4c4fb5a6c75fa935393a6fe71443849 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:38:27 -0700 Subject: [PATCH 07/78] Bump redis from 4.5.3 to 4.5.5 (#253) Bump redis from 4.3.3 to 4.5.5 Bumps [redis](https://github.com/redis/redis-py) from 4.3.3 to 4.5.5. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v4.3.3...v4.5.5) --- updated-dependencies: - dependency-name: redis 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> Co-authored-by: Yuru Shao --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f25b7102..73b4777f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ Flask==2.3.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 -redis==4.5.3 +redis==4.5.5 Werkzeug==2.3.3 From 5725b0db2e416e9dfe37868f9aa3cb849a38d573 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:52:38 -0700 Subject: [PATCH 08/78] Bump coverage from 6.4.1 to 7.2.7 (#267) Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.1 to 7.2.7. - [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/6.4.1...7.2.7) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 5aff2e1a..2fc2d044 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -coverage==6.4.1 +coverage==7.2.7 fakeredis==2.14.1 flake8==6.0.0 freezegun==1.2.1 From 4c118cf022a2ddcd601c5c1a08b3965da5851e82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:52:57 -0700 Subject: [PATCH 09/78] Bump pytest-cov from 3.0.0 to 4.1.0 (#266) Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 3.0.0 to 4.1.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v3.0.0...v4.1.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 2fc2d044..2d133e5f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,5 +3,5 @@ fakeredis==2.14.1 flake8==6.0.0 freezegun==1.2.1 pytest==7.3.1 -pytest-cov==3.0.0 +pytest-cov==4.1.0 tox==4.6.0 From 9d68d6b0587a95352bb905816f60d098f81ccfea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:22:23 -0700 Subject: [PATCH 10/78] Bump actions/checkout from 3 to 4 (#282) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout 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> --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6ca4a3d..59d42e4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: python-version: ['3.8', '3.9', '3.10'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b0058ba3..046220f4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 31ae18d57d330e7992728b9636810f98414c342f Mon Sep 17 00:00:00 2001 From: Devin Lundberg Date: Mon, 25 Sep 2023 11:24:35 -0500 Subject: [PATCH 11/78] [Snyk] Security upgrade cryptography from 41.0.1 to 41.0.4 (#284) fix: requirements.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5914629 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73b4777f..cf2fe38d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==41.0.1 +cryptography==41.0.4 Flask==2.3.2 itsdangerous==2.1.2 Jinja2==3.1.2 From f3edccdd1ff4823c719945f844b284b4af2339f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 23:36:02 -0700 Subject: [PATCH 12/78] Bump tox from 4.6.0 to 4.11.3 (#287) Bumps [tox](https://github.com/tox-dev/tox) from 4.6.0 to 4.11.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.6.0...4.11.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 2d133e5f..6eb4a2ff 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,4 +4,4 @@ flake8==6.0.0 freezegun==1.2.1 pytest==7.3.1 pytest-cov==4.1.0 -tox==4.6.0 +tox==4.11.3 From 03bf76fbccb59e758031a320049eb118efc2d0c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 02:56:17 +0000 Subject: [PATCH 13/78] Bump fakeredis from 2.14.1 to 2.20.0 Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.14.1 to 2.20.0. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v2.14.1...v2.20.0) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 6eb4a2ff..d86e0804 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==7.2.7 -fakeredis==2.14.1 +fakeredis==2.20.0 flake8==6.0.0 freezegun==1.2.1 pytest==7.3.1 From 1a9824d24d125ae5f420526f011d05ac24833a05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:35:54 +0000 Subject: [PATCH 14/78] Bump redis from 4.5.5 to 5.0.1 Bumps [redis](https://github.com/redis/redis-py) from 4.5.5 to 5.0.1. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v4.5.5...v5.0.1) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cf2fe38d..1b5e88e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ Flask==2.3.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 -redis==4.5.5 +redis==5.0.1 Werkzeug==2.3.3 From 99028bff16b61b7139ea5b737a19daccbf29bd6c Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 1 Dec 2023 09:35:00 -0800 Subject: [PATCH 15/78] Install deps from requirements.txt (#303) --- .dockerignore | 1 - Dockerfile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 67d158d7..5935edca 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,7 +6,6 @@ CONTRIBUTING.rst docker-compose.yml Dockerfile -requirements.txt tests.py tox.ini diff --git a/Dockerfile b/Dockerfile index d8cccbc6..70e18c50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,13 @@ RUN groupadd -r snappass && \ WORKDIR $APP_DIR -COPY ["setup.py", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"] +COPY ["setup.py", "requirements.txt", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"] COPY ["./snappass", "$APP_DIR/snappass"] RUN python setup.py install && \ chown -R snappass $APP_DIR && \ chgrp -R snappass $APP_DIR +RUN pip install -r requirements.txt USER snappass From baa921f1cb9af1997320ae4eab3de1daa8c5432e Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 1 Dec 2023 17:04:38 -0800 Subject: [PATCH 16/78] Prepare 1.6.1 release (#304) * Prepare 1.6.1 release * Update configs * Fix dev requirements --- .bumpversion.cfg | 6 ------ README.rst | 2 +- dev-requirements.txt | 2 ++ setup.cfg | 2 +- setup.py | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 560db08d..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[bumpversion] -files = setup.py -commit = True -tag = True -current_version = 1.5.0 - diff --git a/README.rst b/README.rst index 1781f158..cb20c9e2 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ Requirements ------------ * `Redis`_ -* Python 3.7+ +* Python 3.8+ .. _Redis: https://redis.io/ diff --git a/dev-requirements.txt b/dev-requirements.txt index d86e0804..b7191fad 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,3 +5,5 @@ freezegun==1.2.1 pytest==7.3.1 pytest-cov==4.1.0 tox==4.11.3 +bumpversion==0.6.0 +wheel==0.42.0 diff --git a/setup.cfg b/setup.cfg index 64ce37d8..398abb2f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ current_version = 1.6.0 commit = True tag = True -files = setup.py snappass/__init__.py +files = setup.py [flake8] show-source = True diff --git a/setup.py b/setup.py index b5410d74..e088fba6 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ ], }, include_package_data=True, - python_requires='>=3.7, <4', + python_requires='>=3.8, <4', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -27,7 +27,6 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', From 8103cb4adba827e6c0ce1e9999e9a70cf79c46a7 Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 1 Dec 2023 17:11:30 -0800 Subject: [PATCH 17/78] =?UTF-8?q?Bump=20version:=201.6.0=20=E2=86=92=201.6?= =?UTF-8?q?.1=20(#305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 3 +-- setup.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 398abb2f..095b615f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.6.0 +current_version = 1.6.1 commit = True tag = True files = setup.py @@ -7,4 +7,3 @@ files = setup.py [flake8] show-source = True max-line-length = 120 - diff --git a/setup.py b/setup.py index e088fba6..b4ae3329 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='snappass', - version='1.6.0', + version='1.6.1', description="It's like SnapChat... for Passwords.", long_description=(open('README.rst').read() + '\n\n' + open('AUTHORS.rst').read()), From ae2747311ae1c1f0171cc86bb909b12bf7e756ad Mon Sep 17 00:00:00 2001 From: vin01 <30344579+vin01@users.noreply.github.com> Date: Sat, 2 Dec 2023 02:54:51 +0100 Subject: [PATCH 18/78] Use urllib.parse for quoting/unquoting plus instead of deprecated werkzeug.urls (#300) Use urllib.parse for quoting/unquoting plus werkzeug.urls.url_quote_plus and werkzeug.urls.url_unquote_plus were deprecated and are removed in 3.0.0 and newer versions. --- snappass/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index 00c4d018..50b51f01 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -7,8 +7,8 @@ from cryptography.fernet import Fernet from flask import abort, Flask, render_template, request, jsonify from redis.exceptions import ConnectionError -from werkzeug.urls import url_quote_plus -from werkzeug.urls import url_unquote_plus +from urllib.parse import quote_plus +from urllib.parse import unquote_plus from distutils.util import strtobool NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False'))) @@ -176,7 +176,7 @@ def handle_password(): base_url = request.url_root.replace("http://", "https://") if URL_PREFIX: base_url = base_url + URL_PREFIX.strip("/") + "/" - link = base_url + url_quote_plus(token) + link = base_url + quote_plus(token) if request.accept_mimetypes.accept_json and not request.accept_mimetypes.accept_html: return jsonify(link=link, ttl=ttl) else: @@ -185,7 +185,7 @@ def handle_password(): @app.route('/', methods=['GET']) def preview_password(password_key): - password_key = url_unquote_plus(password_key) + password_key = unquote_plus(password_key) if not password_exists(password_key): return render_template('expired.html'), 404 @@ -194,7 +194,7 @@ def preview_password(password_key): @app.route('/', methods=['POST']) def show_password(password_key): - password_key = url_unquote_plus(password_key) + password_key = unquote_plus(password_key) password = get_password(password_key) if not password: return render_template('expired.html'), 404 From fd27ab7d4a624205b435d2e4210b2e2942c3c7ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 13:53:47 -0800 Subject: [PATCH 19/78] Bump actions/setup-python from 4 to 5 (#306) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python 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> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59d42e4f..2f03bcfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v3 From b53ceed6eb47070264d52077b29d4e78fddd82a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 13:54:08 -0800 Subject: [PATCH 20/78] Bump github/codeql-action from 2 to 3 (#309) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action 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> --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 046220f4..0c0dbfa2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,10 +36,10 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} config-file: ./.github/codeql-config.yml - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From b66b1e1bb2da340ea2bf7ab8a99a942b6c9ad5fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 14:00:16 -0800 Subject: [PATCH 21/78] Bump werkzeug from 2.3.3 to 3.0.1 (#295) Bumps [werkzeug](https://github.com/pallets/werkzeug) from 2.3.3 to 3.0.1. - [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/2.3.3...3.0.1) --- updated-dependencies: - dependency-name: werkzeug 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.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1b5e88e0..ad8b3b83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 redis==5.0.1 -Werkzeug==2.3.3 +Werkzeug==3.0.1 From 7db0be7a90c578b6e11f4ea540da09ce29d94c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 14:08:29 -0800 Subject: [PATCH 22/78] Bump flask from 2.3.2 to 3.0.0 (#294) Bumps [flask](https://github.com/pallets/flask) from 2.3.2 to 3.0.0. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.3.2...3.0.0) --- updated-dependencies: - dependency-name: flask 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.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ad8b3b83..1813bab4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cryptography==41.0.4 -Flask==2.3.2 +Flask==3.0.0 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 From 3871c39b05158aaaaba62d52cdf6790db8a636a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 02:24:33 +0000 Subject: [PATCH 23/78] Bump pytest from 7.3.1 to 7.4.4 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.4.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.4.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index b7191fad..7c2f4fd8 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,7 @@ coverage==7.2.7 fakeredis==2.20.0 flake8==6.0.0 freezegun==1.2.1 -pytest==7.3.1 +pytest==7.4.4 pytest-cov==4.1.0 tox==4.11.3 bumpversion==0.6.0 From a8e4312a6c16e6a8161a609066b7939f5991598a Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Tue, 2 Jan 2024 17:17:27 -0800 Subject: [PATCH 24/78] =?UTF-8?q?Bump=20version:=201.6.1=20=E2=86=92=201.6?= =?UTF-8?q?.2=20(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 095b615f..632eff56 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.6.1 +current_version = 1.6.2 commit = True tag = True files = setup.py diff --git a/setup.py b/setup.py index b4ae3329..44679724 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='snappass', - version='1.6.1', + version='1.6.2', description="It's like SnapChat... for Passwords.", long_description=(open('README.rst').read() + '\n\n' + open('AUTHORS.rst').read()), From 6798a262b36dc57a90191924d1eec8d37a1f1014 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:46:05 +0000 Subject: [PATCH 25/78] Bump freezegun from 1.2.1 to 1.4.0 Bumps [freezegun](https://github.com/spulec/freezegun) from 1.2.1 to 1.4.0. - [Release notes](https://github.com/spulec/freezegun/releases) - [Changelog](https://github.com/spulec/freezegun/blob/master/CHANGELOG) - [Commits](https://github.com/spulec/freezegun/compare/1.2.1...1.4.0) --- updated-dependencies: - dependency-name: freezegun dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 7c2f4fd8..54432588 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ coverage==7.2.7 fakeredis==2.20.0 flake8==6.0.0 -freezegun==1.2.1 +freezegun==1.4.0 pytest==7.4.4 pytest-cov==4.1.0 tox==4.11.3 From d8c05a9d62053c6f2a343b01553adb403595ce2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 02:20:16 +0000 Subject: [PATCH 26/78] Bump flake8 from 6.0.0 to 7.0.0 Bumps [flake8](https://github.com/pycqa/flake8) from 6.0.0 to 7.0.0. - [Commits](https://github.com/pycqa/flake8/compare/6.0.0...7.0.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 54432588..f3e4c9c8 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,6 +1,6 @@ coverage==7.2.7 fakeredis==2.20.0 -flake8==6.0.0 +flake8==7.0.0 freezegun==1.4.0 pytest==7.4.4 pytest-cov==4.1.0 From 455db36189ee7ba778fc61433d4a6bd019199d95 Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 2 Feb 2024 16:14:51 -0800 Subject: [PATCH 27/78] Add health check endpoint (#329) * Add health check endpoint * Add assertion on status --- snappass/main.py | 6 ++++++ tests.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/snappass/main.py b/snappass/main.py index 50b51f01..0568154f 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -202,6 +202,12 @@ def show_password(password_key): return render_template('password.html', password=password) +@app.route('/_/_/health', methods=['GET']) +@check_redis_alive +def health_check(): + return {} + + @check_redis_alive def main(): app.run(host='0.0.0.0') diff --git a/tests.py b/tests.py index 1c385f91..b92eeeb7 100644 --- a/tests.py +++ b/tests.py @@ -106,6 +106,11 @@ def setUp(self): snappass.app.config['TESTING'] = True self.app = snappass.app.test_client() + def test_health_check(self): + response = self.app.get('/_/_/health') + self.assertEqual('200 OK', response.status) + self.assertEqual('{}', response.get_data(as_text=True).strip()) + def test_preview_password(self): password = "I like novelty kitten statues!" key = snappass.set_password(password, 30) From 6d294c63fd3175650fa65985b72996488eafd873 Mon Sep 17 00:00:00 2001 From: systeembeheerder <19684880+systeembeheerder@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:38:23 +0100 Subject: [PATCH 28/78] add i18n to Snappass --- .gitignore | 4 + babel.cfg | 10 ++ snappass/main.py | 11 +- snappass/templates/base.html | 6 +- snappass/templates/confirm.html | 6 +- snappass/templates/expired.html | 6 +- snappass/templates/password.html | 8 +- snappass/templates/preview.html | 8 +- snappass/templates/set_password.html | 14 +-- .../translations/nl/LC_MESSAGES/messages.po | 112 ++++++++++++++++++ 10 files changed, 157 insertions(+), 28 deletions(-) create mode 100644 babel.cfg create mode 100644 snappass/translations/nl/LC_MESSAGES/messages.po diff --git a/.gitignore b/.gitignore index 6c53d83e..ac9ab389 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,7 @@ htmlcov/ # virtualenv venv/ ENV/ + +# Translatio catalogs +*.mo +*.pot diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..d6a43f62 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,10 @@ +# Update Translations: +# (venv) $ pybabel extract -F babel.cfg -o messages.pot . +# (venv) $ pybabel update -i messages.pot -d snappass/translations +# (venv) $ pybabel compile -d snappass/translations +# Add a new language: +# (venv) $ pybabel extract -F babel.cfg -o messages.pot . +# (venv) $ pybabel init -i messages.pot -d snapppass/translations -l +[python: snappass/**.py] +[jinja2: snappass/templates/**.html] + diff --git a/snappass/main.py b/snappass/main.py index 0568154f..17ec84c8 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -5,18 +5,18 @@ import redis from cryptography.fernet import Fernet -from flask import abort, Flask, render_template, request, jsonify +from flask import abort, Flask, render_template, request, jsonify, g from redis.exceptions import ConnectionError from urllib.parse import quote_plus from urllib.parse import unquote_plus from distutils.util import strtobool +from flask_babel import Babel NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False'))) URL_PREFIX = os.environ.get('URL_PREFIX', None) HOST_OVERRIDE = os.environ.get('HOST_OVERRIDE', None) TOKEN_SEPARATOR = '~' - # Initialize Flask Application app = Flask(__name__) if os.environ.get('DEBUG'): @@ -25,6 +25,11 @@ app.config.update( dict(STATIC_URL=os.environ.get('STATIC_URL', 'static'))) +# Set up Babel +def get_locale(): + return request.accept_languages.best_match(['en', 'nl']) +babel = Babel(app, locale_selector=get_locale) + # Initialize Redis if os.environ.get('MOCK_REDIS'): from fakeredis import FakeStrictRedis @@ -56,7 +61,6 @@ def inner(*args, **kwargs): return abort(500) return inner - def encrypt(password): """ Take a password string, encrypt it with Fernet symmetric encryption, @@ -212,6 +216,5 @@ def health_check(): def main(): app.run(host='0.0.0.0') - if __name__ == '__main__': main() diff --git a/snappass/templates/base.html b/snappass/templates/base.html index b199f428..1b8f910a 100644 --- a/snappass/templates/base.html +++ b/snappass/templates/base.html @@ -1,7 +1,7 @@ - + - Snappass - Share Secrets + {{ _('Snappass - Share Secrets') }} @@ -13,7 +13,7 @@ diff --git a/snappass/templates/confirm.html b/snappass/templates/confirm.html index 7fe8b295..df284278 100644 --- a/snappass/templates/confirm.html +++ b/snappass/templates/confirm.html @@ -3,15 +3,15 @@ {% block content %}
- -

The secret has been temporarily saved. Send the following URL to your intended recipient.

+ +

{{ _('The secret has been temporarily saved. Send the following URL to your intended recipient.') }}

-
-

The secret has now been permanently deleted from the system, and the URL will no longer work. Refresh this page to verify.

+

{{ _('The secret has now been permanently deleted from the system, and the URL will no longer work. Refresh this page to verify.' }}

{% endblock %} diff --git a/snappass/templates/preview.html b/snappass/templates/preview.html index 1e542772..7b877b6d 100644 --- a/snappass/templates/preview.html +++ b/snappass/templates/preview.html @@ -4,12 +4,12 @@
-

You can only reveal the secret once!

+

{{ _('You can only reveal the secret once!') }}

- +
@@ -20,4 +20,4 @@

Secret

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/snappass/templates/set_password.html b/snappass/templates/set_password.html index d332ace5..a05f7332 100644 --- a/snappass/templates/set_password.html +++ b/snappass/templates/set_password.html @@ -3,27 +3,27 @@ {% block content %}
- +
- +
- +
diff --git a/snappass/translations/nl/LC_MESSAGES/messages.po b/snappass/translations/nl/LC_MESSAGES/messages.po new file mode 100644 index 00000000..36185559 --- /dev/null +++ b/snappass/translations/nl/LC_MESSAGES/messages.po @@ -0,0 +1,112 @@ +# Dutch translations for PROJECT. +# Copyright (C) 2024 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2024-02-14 21:09+0100\n" +"PO-Revision-Date: 2024-02-14 21:16+0100\n" +"Last-Translator: \n" +"Language: nl\n" +"Language-Team: nl \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.14.0\n" + +#: snappass/templates/base.html:4 +msgid "Snappass - Share Secrets" +msgstr "" + +#: snappass/templates/base.html:16 +msgid "Share Secret" +msgstr "Stel wachtwoord in" + +#: snappass/templates/confirm.html:6 +msgid "Share Secret Link" +msgstr "Deel wachtwoord link" + +#: snappass/templates/confirm.html:7 +msgid "" +"The secret has been temporarily saved. Send the following URL to your " +"intended recipient." +msgstr "" +"Het wachtwoord is tijdelijk opgeslagen. Deel de volgende URL aan de " +"bedoelde ontvanger." + +#: snappass/templates/confirm.html:14 +msgid "Copy to clipboard" +msgstr "Kopieer naar het klembord" + +#: snappass/templates/expired.html:6 +msgid "Secret not found" +msgstr "Wachtwoord niet gevonden" + +#: snappass/templates/expired.html:7 +msgid "" +"The requested URL was not found on the server. This could be because this" +" URL never contained a secret, or because it expired or was revealed " +"earlier." +msgstr "" +"De gevraagde URL is niet gevonden op de server. Dat kan omdat deze geen " +"wachtwoord bevat, het is verlopen of het al eerder getoond is." + +#: snappass/templates/expired.html:8 +msgid "" +"If this URL was sent to you by someone, make sure to check your spelling " +"or ask the person who sent it to you to send a new secret." +msgstr "" +"Als deze URL naar u is toegestuurd, controleer de spelling of vraag de " +"verzender om een nieuw wachtwoord link te versturen." + +#: snappass/templates/preview.html:7 +msgid "Secret" +msgstr "Wachtwoord" + +#: snappass/templates/preview.html:9 +msgid "You can only reveal the secret once!" +msgstr "Het wachtwoord wordt slechts eenmaal getoond!" + +#: snappass/templates/preview.html:12 +msgid "Reveal secret" +msgstr "Onthul wachtwoord" + +#: snappass/templates/set_password.html:6 +msgid "Set Secret" +msgstr "Stel wachtwoord in" + +#: snappass/templates/set_password.html:12 +msgid "" +"SnapPass allows you to share secrets in a secure, ephemeral way. Input a " +"single or multi-line secret, its expiration time, and click Generate URL." +" Share the one-time use URL with your intended recipient." +msgstr "" +"We stellen je in staat om wachtwoorden op een veilige, tijdelijke manier " +"te delen. Voer een enkel- of meerregelig wachwoord in, stel de vervaltijd" +" in, en klik op 'URL genereren'. Deel de eenmalig te gebruiken URL met de" +" beoogde ontvanger." + +#: snappass/templates/set_password.html:18 +msgid "Two Weeks" +msgstr "Twee weken" + +#: snappass/templates/set_password.html:19 +msgid "Week" +msgstr "Week" + +#: snappass/templates/set_password.html:20 +msgid "Day" +msgstr "Dag" + +#: snappass/templates/set_password.html:21 +msgid "Hour" +msgstr "Uur" + +#: snappass/templates/set_password.html:26 +msgid "Generate URL" +msgstr "URL genereren" + From 62a629021a0963ef7d7c2c886bd52651295e5cf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 02:08:30 +0000 Subject: [PATCH 29/78] Bump fakeredis from 2.20.0 to 2.21.1 Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.20.0 to 2.21.1. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v2.20.0...v2.21.1) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index f3e4c9c8..b5839f25 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==7.2.7 -fakeredis==2.20.0 +fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 pytest==7.4.4 From 6d17603016d3a4ac07b2c542a30ed7ca5636d2ea Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:18:20 +0100 Subject: [PATCH 30/78] remove import of flask, g --- snappass/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snappass/main.py b/snappass/main.py index 17ec84c8..25168847 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -5,7 +5,7 @@ import redis from cryptography.fernet import Fernet -from flask import abort, Flask, render_template, request, jsonify, g +from flask import abort, Flask, render_template, request, jsonify from redis.exceptions import ConnectionError from urllib.parse import quote_plus from urllib.parse import unquote_plus From d178664d0c80a89b509bd5db9253264529368102 Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:40:13 +0100 Subject: [PATCH 31/78] Add empty translations for de and es --- babel.cfg | 2 +- requirements.txt | 1 + snappass/main.py | 2 +- snappass/templates/base.html | 2 +- .../translations/de/LC_MESSAGES/messages.po | 106 ++++++++++++++++++ .../translations/es/LC_MESSAGES/messages.po | 106 ++++++++++++++++++ .../translations/nl/LC_MESSAGES/messages.po | 8 +- 7 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 snappass/translations/de/LC_MESSAGES/messages.po create mode 100644 snappass/translations/es/LC_MESSAGES/messages.po diff --git a/babel.cfg b/babel.cfg index d6a43f62..37d5d57c 100644 --- a/babel.cfg +++ b/babel.cfg @@ -4,7 +4,7 @@ # (venv) $ pybabel compile -d snappass/translations # Add a new language: # (venv) $ pybabel extract -F babel.cfg -o messages.pot . -# (venv) $ pybabel init -i messages.pot -d snapppass/translations -l +# (venv) $ pybabel init -i messages.pot -d snappass/translations -l [python: snappass/**.py] [jinja2: snappass/templates/**.html] diff --git a/requirements.txt b/requirements.txt index 1813bab4..21ddc19b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Jinja2==3.1.2 MarkupSafe==2.1.1 redis==5.0.1 Werkzeug==3.0.1 +flask-babel diff --git a/snappass/main.py b/snappass/main.py index 25168847..826c78f2 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -27,7 +27,7 @@ # Set up Babel def get_locale(): - return request.accept_languages.best_match(['en', 'nl']) + return request.accept_languages.best_match(['en', 'es', 'de', 'nl']) babel = Babel(app, locale_selector=get_locale) # Initialize Redis diff --git a/snappass/templates/base.html b/snappass/templates/base.html index 1b8f910a..c099f209 100644 --- a/snappass/templates/base.html +++ b/snappass/templates/base.html @@ -1,5 +1,5 @@ - + {{ _('Snappass - Share Secrets') }} diff --git a/snappass/translations/de/LC_MESSAGES/messages.po b/snappass/translations/de/LC_MESSAGES/messages.po new file mode 100644 index 00000000..5ff8192f --- /dev/null +++ b/snappass/translations/de/LC_MESSAGES/messages.po @@ -0,0 +1,106 @@ +# German translations for PROJECT. +# Copyright (C) 2024 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2024-02-16 10:38+0100\n" +"PO-Revision-Date: 2024-02-16 09:29+0100\n" +"Last-Translator: FULL NAME \n" +"Language: de\n" +"Language-Team: de \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.14.0\n" + +#: snappass/templates/base.html:2 +msgid "en" +msgstr "de" + +#: snappass/templates/base.html:4 +msgid "Snappass - Share Secrets" +msgstr "" + +#: snappass/templates/base.html:16 +msgid "Share Secret" +msgstr "" + +#: snappass/templates/confirm.html:6 +msgid "Share Secret Link" +msgstr "" + +#: snappass/templates/confirm.html:7 +msgid "" +"The secret has been temporarily saved. Send the following URL to your " +"intended recipient." +msgstr "" + +#: snappass/templates/confirm.html:14 +msgid "Copy to clipboard" +msgstr "" + +#: snappass/templates/expired.html:6 +msgid "Secret not found" +msgstr "" + +#: snappass/templates/expired.html:7 +msgid "" +"The requested URL was not found on the server. This could be because this" +" URL never contained a secret, or because it expired or was revealed " +"earlier." +msgstr "" + +#: snappass/templates/expired.html:8 +msgid "" +"If this URL was sent to you by someone, make sure to check your spelling " +"or ask the person who sent it to you to send a new secret." +msgstr "" + +#: snappass/templates/preview.html:7 +msgid "Secret" +msgstr "" + +#: snappass/templates/preview.html:9 +msgid "You can only reveal the secret once!" +msgstr "" + +#: snappass/templates/preview.html:12 +msgid "Reveal secret" +msgstr "" + +#: snappass/templates/set_password.html:6 +msgid "Set Secret" +msgstr "" + +#: snappass/templates/set_password.html:12 +msgid "" +"SnapPass allows you to share secrets in a secure, ephemeral way. Input a " +"single or multi-line secret, its expiration time, and click Generate URL." +" Share the one-time use URL with your intended recipient." +msgstr "" + +#: snappass/templates/set_password.html:18 +msgid "Two Weeks" +msgstr "" + +#: snappass/templates/set_password.html:19 +msgid "Week" +msgstr "" + +#: snappass/templates/set_password.html:20 +msgid "Day" +msgstr "" + +#: snappass/templates/set_password.html:21 +msgid "Hour" +msgstr "" + +#: snappass/templates/set_password.html:26 +msgid "Generate URL" +msgstr "" + diff --git a/snappass/translations/es/LC_MESSAGES/messages.po b/snappass/translations/es/LC_MESSAGES/messages.po new file mode 100644 index 00000000..274350c9 --- /dev/null +++ b/snappass/translations/es/LC_MESSAGES/messages.po @@ -0,0 +1,106 @@ +# Spanish translations for PROJECT. +# Copyright (C) 2024 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2024-02-16 10:38+0100\n" +"PO-Revision-Date: 2024-02-16 09:29+0100\n" +"Last-Translator: FULL NAME \n" +"Language: es\n" +"Language-Team: es \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.14.0\n" + +#: snappass/templates/base.html:2 +msgid "en" +msgstr "es" + +#: snappass/templates/base.html:4 +msgid "Snappass - Share Secrets" +msgstr "" + +#: snappass/templates/base.html:16 +msgid "Share Secret" +msgstr "" + +#: snappass/templates/confirm.html:6 +msgid "Share Secret Link" +msgstr "" + +#: snappass/templates/confirm.html:7 +msgid "" +"The secret has been temporarily saved. Send the following URL to your " +"intended recipient." +msgstr "" + +#: snappass/templates/confirm.html:14 +msgid "Copy to clipboard" +msgstr "" + +#: snappass/templates/expired.html:6 +msgid "Secret not found" +msgstr "" + +#: snappass/templates/expired.html:7 +msgid "" +"The requested URL was not found on the server. This could be because this" +" URL never contained a secret, or because it expired or was revealed " +"earlier." +msgstr "" + +#: snappass/templates/expired.html:8 +msgid "" +"If this URL was sent to you by someone, make sure to check your spelling " +"or ask the person who sent it to you to send a new secret." +msgstr "" + +#: snappass/templates/preview.html:7 +msgid "Secret" +msgstr "" + +#: snappass/templates/preview.html:9 +msgid "You can only reveal the secret once!" +msgstr "" + +#: snappass/templates/preview.html:12 +msgid "Reveal secret" +msgstr "" + +#: snappass/templates/set_password.html:6 +msgid "Set Secret" +msgstr "" + +#: snappass/templates/set_password.html:12 +msgid "" +"SnapPass allows you to share secrets in a secure, ephemeral way. Input a " +"single or multi-line secret, its expiration time, and click Generate URL." +" Share the one-time use URL with your intended recipient." +msgstr "" + +#: snappass/templates/set_password.html:18 +msgid "Two Weeks" +msgstr "" + +#: snappass/templates/set_password.html:19 +msgid "Week" +msgstr "" + +#: snappass/templates/set_password.html:20 +msgid "Day" +msgstr "" + +#: snappass/templates/set_password.html:21 +msgid "Hour" +msgstr "" + +#: snappass/templates/set_password.html:26 +msgid "Generate URL" +msgstr "" + diff --git a/snappass/translations/nl/LC_MESSAGES/messages.po b/snappass/translations/nl/LC_MESSAGES/messages.po index 36185559..bc77d63c 100644 --- a/snappass/translations/nl/LC_MESSAGES/messages.po +++ b/snappass/translations/nl/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-02-14 21:09+0100\n" +"POT-Creation-Date: 2024-02-16 10:38+0100\n" "PO-Revision-Date: 2024-02-14 21:16+0100\n" "Last-Translator: \n" "Language: nl\n" @@ -18,9 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.14.0\n" +#: snappass/templates/base.html:2 +msgid "en" +msgstr "nl" + #: snappass/templates/base.html:4 msgid "Snappass - Share Secrets" -msgstr "" +msgstr "Snappass - Deel Wachtwoorden" #: snappass/templates/base.html:16 msgid "Share Secret" From 49de2bc0fb4942305fbee67b1887f3beaaf5f9a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 02:44:29 +0000 Subject: [PATCH 32/78] Bump cryptography from 41.0.4 to 42.0.3 Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.4 to 42.0.3. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/41.0.4...42.0.3) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1813bab4..b7e17bb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==41.0.4 +cryptography==42.0.3 Flask==3.0.0 itsdangerous==2.1.2 Jinja2==3.1.2 From 28c396e8598a41af0f5a9046e3b8c405b7b6f2e7 Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:05:30 +0100 Subject: [PATCH 33/78] Add German Translation --- .../translations/de/LC_MESSAGES/messages.po | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/snappass/translations/de/LC_MESSAGES/messages.po b/snappass/translations/de/LC_MESSAGES/messages.po index 5ff8192f..0ae39166 100644 --- a/snappass/translations/de/LC_MESSAGES/messages.po +++ b/snappass/translations/de/LC_MESSAGES/messages.po @@ -24,29 +24,31 @@ msgstr "de" #: snappass/templates/base.html:4 msgid "Snappass - Share Secrets" -msgstr "" +msgstr "Snappass - Passwort teilen" #: snappass/templates/base.html:16 msgid "Share Secret" -msgstr "" +msgstr "Passwort teilen" #: snappass/templates/confirm.html:6 msgid "Share Secret Link" -msgstr "" +msgstr "Geheimen Link teilen" #: snappass/templates/confirm.html:7 msgid "" "The secret has been temporarily saved. Send the following URL to your " "intended recipient." msgstr "" +"Das Geheimnis wurde vorübergehend gespeichert. Senden Sie die folgende URL an Ihre " +"gewünschten Empfänger." #: snappass/templates/confirm.html:14 msgid "Copy to clipboard" -msgstr "" +msgstr "In Zwischenablage kopieren" #: snappass/templates/expired.html:6 msgid "Secret not found" -msgstr "" +msgstr "Passwort nicht gefunden" #: snappass/templates/expired.html:7 msgid "" @@ -54,28 +56,32 @@ msgid "" " URL never contained a secret, or because it expired or was revealed " "earlier." msgstr "" +"Die angeforderte URL wurde auf dem Server nicht gefunden. Dies könnte daran liegen, dass dies" +"Die URL enthielt nie ein Passwort, oder weil sie abgelaufen ist oder offengelegt wurde " #: snappass/templates/expired.html:8 msgid "" "If this URL was sent to you by someone, make sure to check your spelling " "or ask the person who sent it to you to send a new secret." msgstr "" +"Wenn Ihnen diese URL von jemandem gesendet wurde, überprüfen Sie unbedingt Ihre Rechtschreibung " +"oder bitten Sie die Person, die es Ihnen geschickt hat, ein neues Passwort zu senden." #: snappass/templates/preview.html:7 msgid "Secret" -msgstr "" +msgstr "Geheim" #: snappass/templates/preview.html:9 msgid "You can only reveal the secret once!" -msgstr "" +msgstr "Du kannst das Passwort nur einmal lüften!" #: snappass/templates/preview.html:12 msgid "Reveal secret" -msgstr "" +msgstr "Passwort lüften" #: snappass/templates/set_password.html:6 msgid "Set Secret" -msgstr "" +msgstr "Geheimen Schlüssel festlegen" #: snappass/templates/set_password.html:12 msgid "" @@ -83,24 +89,27 @@ msgid "" "single or multi-line secret, its expiration time, and click Generate URL." " Share the one-time use URL with your intended recipient." msgstr "" +"SnapPass ermöglicht es Ihnen, Passwörter auf sichere, kurzlebige Weise zu teilen. Input a " +"ein- oder mehrzeiliges Passwort, die Ablaufzeit und klicken Sie auf URL generieren." +"Teilen Sie die URL für den einmaligen Gebrauch mit dem beabsichtigten Empfänger." #: snappass/templates/set_password.html:18 msgid "Two Weeks" -msgstr "" +msgstr "Zwei Wochen" #: snappass/templates/set_password.html:19 msgid "Week" -msgstr "" +msgstr "Woche" #: snappass/templates/set_password.html:20 msgid "Day" -msgstr "" +msgstr "Tag" #: snappass/templates/set_password.html:21 msgid "Hour" -msgstr "" +msgstr "Stunde" #: snappass/templates/set_password.html:26 msgid "Generate URL" -msgstr "" +msgstr "URL generieren" From e0b8245d46600b8e1de77f2e9eb7ebee68d4459c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 21:53:28 +0000 Subject: [PATCH 34/78] Bump pytest from 7.4.4 to 8.0.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index b5839f25..ea77c1da 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,7 @@ coverage==7.2.7 fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 -pytest==7.4.4 +pytest==8.0.1 pytest-cov==4.1.0 tox==4.11.3 bumpversion==0.6.0 From 3cba96671ecfca52eca2fc59b552bfce3354a4e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 22:40:32 +0000 Subject: [PATCH 35/78] Bump coverage from 7.2.7 to 7.4.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.7 to 7.4.2. - [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.2.7...7.4.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index ea77c1da..0e77cd29 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -coverage==7.2.7 +coverage==7.4.2 fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 From ba67b426cccef92ffb8471b9ab21afe714da84c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 22:53:49 +0000 Subject: [PATCH 36/78] Bump tox from 4.11.3 to 4.13.0 Bumps [tox](https://github.com/tox-dev/tox) from 4.11.3 to 4.13.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.11.3...4.13.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0e77cd29..00806bf3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,6 @@ flake8==7.0.0 freezegun==1.4.0 pytest==8.0.1 pytest-cov==4.1.0 -tox==4.11.3 +tox==4.13.0 bumpversion==0.6.0 wheel==0.42.0 From 9fdddab11bd8f6bf06f5957e827b7539dac69948 Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:29:19 +0100 Subject: [PATCH 37/78] fix missing bracket --- .gitignore | 2 +- snappass/templates/password.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ac9ab389..35d44eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,6 @@ htmlcov/ venv/ ENV/ -# Translatio catalogs +# Translation catalogs *.mo *.pot diff --git a/snappass/templates/password.html b/snappass/templates/password.html index 6b30f0d3..1a312528 100644 --- a/snappass/templates/password.html +++ b/snappass/templates/password.html @@ -18,7 +18,7 @@
-

{{ _('The secret has now been permanently deleted from the system, and the URL will no longer work. Refresh this page to verify.' }}

+

{{ _('The secret has now been permanently deleted from the system, and the URL will no longer work. Refresh this page to verify.') }}

{% endblock %} From 4fffb9c1d59d7563b0dafc74195f6176c900ee34 Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:29:06 +0100 Subject: [PATCH 38/78] restore extra spaces --- snappass/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snappass/main.py b/snappass/main.py index 826c78f2..ab16b2d4 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -17,6 +17,7 @@ HOST_OVERRIDE = os.environ.get('HOST_OVERRIDE', None) TOKEN_SEPARATOR = '~' + # Initialize Flask Application app = Flask(__name__) if os.environ.get('DEBUG'): @@ -28,6 +29,8 @@ # Set up Babel def get_locale(): return request.accept_languages.best_match(['en', 'es', 'de', 'nl']) + + babel = Babel(app, locale_selector=get_locale) # Initialize Redis @@ -61,6 +64,7 @@ def inner(*args, **kwargs): return abort(500) return inner + def encrypt(password): """ Take a password string, encrypt it with Fernet symmetric encryption, @@ -216,5 +220,6 @@ def health_check(): def main(): app.run(host='0.0.0.0') + if __name__ == '__main__': main() From 114b5af6c2602e16c819941b35fb5eb8d2ba5f4e Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:55:20 +0100 Subject: [PATCH 39/78] Add Spanish and fixup NL&DE --- .../translations/de/LC_MESSAGES/messages.po | 44 +++++++++----- .../translations/es/LC_MESSAGES/messages.po | 59 +++++++++++++------ .../translations/nl/LC_MESSAGES/messages.po | 22 +++++-- 3 files changed, 88 insertions(+), 37 deletions(-) diff --git a/snappass/translations/de/LC_MESSAGES/messages.po b/snappass/translations/de/LC_MESSAGES/messages.po index 0ae39166..41e47562 100644 --- a/snappass/translations/de/LC_MESSAGES/messages.po +++ b/snappass/translations/de/LC_MESSAGES/messages.po @@ -1,13 +1,13 @@ -# German translations for PROJECT. +# German translations for SNAPPASS. # Copyright (C) 2024 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2024. +# systeembeheerder , 2024. # msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-02-16 10:38+0100\n" +"POT-Creation-Date: 2024-02-22 11:01+0100\n" "PO-Revision-Date: 2024-02-16 09:29+0100\n" "Last-Translator: FULL NAME \n" "Language: de\n" @@ -39,10 +39,10 @@ msgid "" "The secret has been temporarily saved. Send the following URL to your " "intended recipient." msgstr "" -"Das Geheimnis wurde vorübergehend gespeichert. Senden Sie die folgende URL an Ihre " -"gewünschten Empfänger." +"Das Geheimnis wurde vorübergehend gespeichert. Senden Sie die folgende " +"URL an Ihre gewünschten Empfänger." -#: snappass/templates/confirm.html:14 +#: snappass/templates/confirm.html:14 snappass/templates/password.html:14 msgid "Copy to clipboard" msgstr "In Zwischenablage kopieren" @@ -56,21 +56,36 @@ msgid "" " URL never contained a secret, or because it expired or was revealed " "earlier." msgstr "" -"Die angeforderte URL wurde auf dem Server nicht gefunden. Dies könnte daran liegen, dass dies" -"Die URL enthielt nie ein Passwort, oder weil sie abgelaufen ist oder offengelegt wurde " +"Die angeforderte URL wurde auf dem Server nicht gefunden. Dies könnte " +"daran liegen, dass diesDie URL enthielt nie ein Passwort, oder weil sie " +"abgelaufen ist oder offengelegt wurde " #: snappass/templates/expired.html:8 msgid "" "If this URL was sent to you by someone, make sure to check your spelling " "or ask the person who sent it to you to send a new secret." msgstr "" -"Wenn Ihnen diese URL von jemandem gesendet wurde, überprüfen Sie unbedingt Ihre Rechtschreibung " -"oder bitten Sie die Person, die es Ihnen geschickt hat, ein neues Passwort zu senden." +"Wenn Ihnen diese URL von jemandem gesendet wurde, überprüfen Sie " +"unbedingt Ihre Rechtschreibung oder bitten Sie die Person, die es Ihnen " +"geschickt hat, ein neues Passwort zu senden." -#: snappass/templates/preview.html:7 +#: snappass/templates/password.html:6 snappass/templates/preview.html:7 msgid "Secret" msgstr "Geheim" +#: snappass/templates/password.html:7 +msgid "Save the following secret to a secure location." +msgstr "Speichern Sie dass folgende Passwort an einem sicheren Ort." + +#: snappass/templates/password.html:21 +msgid "" +"The secret has now been permanently deleted from the system, and the URL " +"will no longer work. Refresh this page to verify." +msgstr "" +" Dass Passwort wurde nun endgültig aus dem System gelöscht, und die URL " +"funktioniert nicht mehr. Aktualisieren Sie diese Seite, um dies zu " +"überprüfen." + #: snappass/templates/preview.html:9 msgid "You can only reveal the secret once!" msgstr "Du kannst das Passwort nur einmal lüften!" @@ -89,9 +104,10 @@ msgid "" "single or multi-line secret, its expiration time, and click Generate URL." " Share the one-time use URL with your intended recipient." msgstr "" -"SnapPass ermöglicht es Ihnen, Passwörter auf sichere, kurzlebige Weise zu teilen. Input a " -"ein- oder mehrzeiliges Passwort, die Ablaufzeit und klicken Sie auf URL generieren." -"Teilen Sie die URL für den einmaligen Gebrauch mit dem beabsichtigten Empfänger." +"SnapPass ermöglicht es Ihnen, Passwörter auf sichere, kurzlebige Weise zu" +" teilen. Input a ein- oder mehrzeiliges Passwort, die Ablaufzeit und " +"klicken Sie auf URL generieren.Teilen Sie die URL für den einmaligen " +"Gebrauch mit dem beabsichtigten Empfänger." #: snappass/templates/set_password.html:18 msgid "Two Weeks" diff --git a/snappass/translations/es/LC_MESSAGES/messages.po b/snappass/translations/es/LC_MESSAGES/messages.po index 274350c9..f8d31dd9 100644 --- a/snappass/translations/es/LC_MESSAGES/messages.po +++ b/snappass/translations/es/LC_MESSAGES/messages.po @@ -1,13 +1,13 @@ -# Spanish translations for PROJECT. +# Spanish translations for SNAPPASS. # Copyright (C) 2024 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2024. +# systeembeheerder , 2024. # msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-02-16 10:38+0100\n" +"POT-Creation-Date: 2024-02-22 11:01+0100\n" "PO-Revision-Date: 2024-02-16 09:29+0100\n" "Last-Translator: FULL NAME \n" "Language: es\n" @@ -24,29 +24,31 @@ msgstr "es" #: snappass/templates/base.html:4 msgid "Snappass - Share Secrets" -msgstr "" +msgstr "Snappass - Compartir secretos" #: snappass/templates/base.html:16 msgid "Share Secret" -msgstr "" +msgstr "Compartir secretos" #: snappass/templates/confirm.html:6 msgid "Share Secret Link" -msgstr "" +msgstr "Compartir enlace secreto" #: snappass/templates/confirm.html:7 msgid "" "The secret has been temporarily saved. Send the following URL to your " "intended recipient." msgstr "" +"El secreto se ha guardado temporalmente. Envíe la siguiente URL a " +"sudestinatario previsto." -#: snappass/templates/confirm.html:14 +#: snappass/templates/confirm.html:14 snappass/templates/password.html:14 msgid "Copy to clipboard" -msgstr "" +msgstr "Copiar en el portapapeles" #: snappass/templates/expired.html:6 msgid "Secret not found" -msgstr "" +msgstr "Secreto no encontrado" #: snappass/templates/expired.html:7 msgid "" @@ -54,28 +56,45 @@ msgid "" " URL never contained a secret, or because it expired or was revealed " "earlier." msgstr "" +"La URL solicitada no se encontró en el servidor. Esto podría deberse a " +"estoLa URL nunca contenía un secreto, o porque caducó o fue revelado " +"Antes." #: snappass/templates/expired.html:8 msgid "" "If this URL was sent to you by someone, make sure to check your spelling " "or ask the person who sent it to you to send a new secret." msgstr "" +"Si alguien te envió esta URL, asegúrate de revisar tu ortografíaO pídele " +"a la persona que te lo envió que te envíe un nuevo secreto." -#: snappass/templates/preview.html:7 +#: snappass/templates/password.html:6 snappass/templates/preview.html:7 msgid "Secret" +msgstr "Secreto" + +#: snappass/templates/password.html:7 +msgid "Save the following secret to a secure location." +msgstr "Guarda el siguiente secreto en un lugar seguro." + +#: snappass/templates/password.html:21 +msgid "" +"The secret has now been permanently deleted from the system, and the URL " +"will no longer work. Refresh this page to verify." msgstr "" +"El secreto ahora se ha eliminado permanentemente del sistema, y la URL Ya" +" no funcionará. Actualiza esta página para verificarlo." #: snappass/templates/preview.html:9 msgid "You can only reveal the secret once!" -msgstr "" +msgstr "¡Solo puedes revelar el secreto una vez!" #: snappass/templates/preview.html:12 msgid "Reveal secret" -msgstr "" +msgstr "Revelar secreto" #: snappass/templates/set_password.html:6 msgid "Set Secret" -msgstr "" +msgstr "Establecer secreto" #: snappass/templates/set_password.html:12 msgid "" @@ -83,24 +102,28 @@ msgid "" "single or multi-line secret, its expiration time, and click Generate URL." " Share the one-time use URL with your intended recipient." msgstr "" +"SnapPass te permite compartir secretos de forma segura y efímera. " +"Introduzca un secreto de una o varias líneas, su tiempo de caducidad y " +"haga clic en Generar URL.Comparta la URL de un solo uso con el " +"destinatario previsto\"" #: snappass/templates/set_password.html:18 msgid "Two Weeks" -msgstr "" +msgstr "Dos semanas" #: snappass/templates/set_password.html:19 msgid "Week" -msgstr "" +msgstr "Semana" #: snappass/templates/set_password.html:20 msgid "Day" -msgstr "" +msgstr "Día" #: snappass/templates/set_password.html:21 msgid "Hour" -msgstr "" +msgstr "Hora" #: snappass/templates/set_password.html:26 msgid "Generate URL" -msgstr "" +msgstr "Generar URL" diff --git a/snappass/translations/nl/LC_MESSAGES/messages.po b/snappass/translations/nl/LC_MESSAGES/messages.po index bc77d63c..b1a6a070 100644 --- a/snappass/translations/nl/LC_MESSAGES/messages.po +++ b/snappass/translations/nl/LC_MESSAGES/messages.po @@ -1,13 +1,13 @@ -# Dutch translations for PROJECT. +# Dutch translations for SNAPPASS. # Copyright (C) 2024 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2024. +# systeembeheerder , 2024. # msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-02-16 10:38+0100\n" +"POT-Creation-Date: 2024-02-22 11:01+0100\n" "PO-Revision-Date: 2024-02-14 21:16+0100\n" "Last-Translator: \n" "Language: nl\n" @@ -42,7 +42,7 @@ msgstr "" "Het wachtwoord is tijdelijk opgeslagen. Deel de volgende URL aan de " "bedoelde ontvanger." -#: snappass/templates/confirm.html:14 +#: snappass/templates/confirm.html:14 snappass/templates/password.html:14 msgid "Copy to clipboard" msgstr "Kopieer naar het klembord" @@ -67,10 +67,22 @@ msgstr "" "Als deze URL naar u is toegestuurd, controleer de spelling of vraag de " "verzender om een nieuw wachtwoord link te versturen." -#: snappass/templates/preview.html:7 +#: snappass/templates/password.html:6 snappass/templates/preview.html:7 msgid "Secret" msgstr "Wachtwoord" +#: snappass/templates/password.html:7 +msgid "Save the following secret to a secure location." +msgstr "Bewaar het wachtwoord op een veilige plek." + +#: snappass/templates/password.html:21 +msgid "" +"The secret has now been permanently deleted from the system, and the URL " +"will no longer work. Refresh this page to verify." +msgstr "" +"Het wachtwoord is permanent verwijderd van het systeem, de URL werkt niet" +" meer. Herlaad deze pagina ter verificatie" + #: snappass/templates/preview.html:9 msgid "You can only reveal the secret once!" msgstr "Het wachtwoord wordt slechts eenmaal getoond!" From 106ac26e26d5db471849fa4ab79c218ac3b8d40f Mon Sep 17 00:00:00 2001 From: Bert Roelofsen <19684880+systeembeheerder@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:59:36 +0100 Subject: [PATCH 40/78] TIL flake8 :) --- snappass/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/snappass/main.py b/snappass/main.py index ab16b2d4..d19eb1c2 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -26,6 +26,7 @@ app.config.update( dict(STATIC_URL=os.environ.get('STATIC_URL', 'static'))) + # Set up Babel def get_locale(): return request.accept_languages.best_match(['en', 'es', 'de', 'nl']) From 5d37e45517ef22f405d5f80befea9f3f10d77e46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:49:05 -0800 Subject: [PATCH 41/78] Bump actions/cache from 3 to 4 (#320) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache 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> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f03bcfb..35b02a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('.github/workflows/ci.yml') }} From 04f9402e5f489929c2ee6c558cc6a1c47caaf2d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:49:56 -0800 Subject: [PATCH 42/78] Bump jinja2 from 3.1.2 to 3.1.3 (#336) Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 36e0c67b..7e96b4c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cryptography==42.0.3 Flask==3.0.0 itsdangerous==2.1.2 -Jinja2==3.1.2 +Jinja2==3.1.3 MarkupSafe==2.1.1 redis==5.0.1 Werkzeug==3.0.1 From dc321ef79c1ffe75818d4f3a47e3780b2047002e Mon Sep 17 00:00:00 2001 From: Reinoud van Leeuwen Date: Tue, 27 Feb 2024 00:22:40 +0100 Subject: [PATCH 43/78] add /api endpoint for automated flows (#316) * add /api endpoint * pass password in request body when using API * flake8 fixed; tests added * flake8 fixed test.py --------- Co-authored-by: Reinoud van Leeuwen --- README.rst | 34 +++++++++++++++++++++++++++ snappass/main.py | 61 ++++++++++++++++++++++++++++++++++-------------- tests.py | 38 ++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index cb20c9e2..af35b5e1 100644 --- a/README.rst +++ b/README.rst @@ -96,6 +96,40 @@ need to change this. ``HOST_OVERRIDE``: (optional) Used to override the base URL if the app is unaware. Useful when running behind reverse proxies like an identity-aware SSO. Example: ``sub.domain.com`` +API +--- + +SnapPass also has a simple API that can be used to create passwords links. The advantage of using the API is that +you can create a password and retrieve the link without having to open the web interface. This is useful if you want to +embed it in a script or use it in a CI/CD pipeline. + +To create a password, send a POST request to ``/api/set_password`` like so: + +:: + + $ curl -X POST -H "Content-Type: application/json" -d '{"password": "foobar"}' http://localhost:5000/api/set_password/ + +This will return a JSON response with the password link: + +:: + + { + "link": "http://127.0.0.1:5000/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", + "ttl":1209600 + } + +the default TTL is 2 weeks (1209600 seconds), but you can override it by adding a expiration parameter: + +:: + + $ curl -X POST -H "Content-Type: application/json" -d '{"password": "foobar", "ttl": 3600 }' http://localhost:5000/api/set_password/ + +Notes: + +- When using the API, you can specify any ttl, as long as it is lower than the default. +- The password is passed in the body of the request rather than in the URL. This is to prevent the password from being logged in the server logs. +- Depending on the environment you are running it, you might want to expose the ``/api`` endpoint to your internal network only, and put the web interface behind authentication. + Docker ------ diff --git a/snappass/main.py b/snappass/main.py index d19eb1c2..597c7970 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -17,7 +17,6 @@ HOST_OVERRIDE = os.environ.get('HOST_OVERRIDE', None) TOKEN_SEPARATOR = '~' - # Initialize Flask Application app = Flask(__name__) if os.environ.get('DEBUG'): @@ -37,6 +36,7 @@ def get_locale(): # Initialize Redis if os.environ.get('MOCK_REDIS'): from fakeredis import FakeStrictRedis + redis_client = FakeStrictRedis() elif os.environ.get('REDIS_URL'): redis_client = redis.StrictRedis.from_url(os.environ.get('REDIS_URL')) @@ -48,7 +48,10 @@ def get_locale(): host=redis_host, port=redis_port, db=redis_db) REDIS_PREFIX = os.environ.get('REDIS_PREFIX', 'snappass') -TIME_CONVERSION = {'two weeks': 1209600, 'week': 604800, 'day': 86400, 'hour': 3600} +TIME_CONVERSION = {'two weeks': 1209600, 'week': 604800, 'day': 86400, + 'hour': 3600} +DEFAULT_API_TTL = 1209600 +MAX_TTL = DEFAULT_API_TTL def check_redis_alive(fn): @@ -63,6 +66,7 @@ def inner(*args, **kwargs): sys.exit(0) else: return abort(500) + return inner @@ -163,33 +167,56 @@ def clean_input(): return TIME_CONVERSION[time_period], request.form['password'] -@app.route('/', methods=['GET']) -def index(): - return render_template('set_password.html') - - -@app.route('/', methods=['POST']) -def handle_password(): - ttl, password = clean_input() - token = set_password(password, ttl) - +def set_base_url(req): if NO_SSL: if HOST_OVERRIDE: base_url = f'http://{HOST_OVERRIDE}/' else: - base_url = request.url_root + base_url = req.url_root else: if HOST_OVERRIDE: base_url = f'https://{HOST_OVERRIDE}/' else: - base_url = request.url_root.replace("http://", "https://") + base_url = req.url_root.replace("http://", "https://") if URL_PREFIX: base_url = base_url + URL_PREFIX.strip("/") + "/" - link = base_url + quote_plus(token) - if request.accept_mimetypes.accept_json and not request.accept_mimetypes.accept_html: + return base_url + + +@app.route('/', methods=['GET']) +def index(): + return render_template('set_password.html') + + +@app.route('/', methods=['POST']) +def handle_password(): + password = request.form.get('password') + ttl = request.form.get('ttl') + if clean_input(): + ttl = TIME_CONVERSION[ttl.lower()] + token = set_password(password, ttl) + base_url = set_base_url(request) + link = base_url + quote_plus(token) + if request.accept_mimetypes.accept_json and not \ + request.accept_mimetypes.accept_html: + return jsonify(link=link, ttl=ttl) + else: + return render_template('confirm.html', password_link=link) + else: + abort(500) + + +@app.route('/api/set_password/', methods=['POST']) +def api_handle_password(): + password = request.json.get('password') + ttl = int(request.json.get('ttl', DEFAULT_API_TTL)) + if password and isinstance(ttl, int) and ttl <= MAX_TTL: + token = set_password(password, ttl) + base_url = set_base_url(request) + link = base_url + quote_plus(token) return jsonify(link=link, ttl=ttl) else: - return render_template('confirm.html', password_link=link) + abort(500) @app.route('/', methods=['GET']) diff --git a/tests.py b/tests.py index b92eeeb7..4ef7f0d9 100644 --- a/tests.py +++ b/tests.py @@ -163,6 +163,44 @@ def test_set_password_json(self): frozen_time.move_to("2020-05-22 12:00:00") self.assertIsNone(snappass.get_password(key)) + def test_set_password_api(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/set_password/', + headers={'Accept': 'application/json'}, + json={'password': password, 'ttl': '1209600'}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + frozen_time.move_to("2020-05-22 11:59:59") + self.assertEqual(snappass.get_password(key), password) + + frozen_time.move_to("2020-05-22 12:00:00") + self.assertIsNone(snappass.get_password(key)) + + def test_set_password_api_default_ttl(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/set_password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + frozen_time.move_to("2020-05-22 11:59:59") + self.assertEqual(snappass.get_password(key), password) + + frozen_time.move_to("2020-05-22 12:00:00") + self.assertIsNone(snappass.get_password(key)) + if __name__ == '__main__': unittest.main() From 838cdf6d9c1d52aa31c39a53b510af3825c67688 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 02:47:37 +0000 Subject: [PATCH 44/78] Bump pytest from 8.0.1 to 8.1.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.1.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.0.1...8.1.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 00806bf3..177d57eb 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,7 @@ coverage==7.4.2 fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 -pytest==8.0.1 +pytest==8.1.0 pytest-cov==4.1.0 tox==4.13.0 bumpversion==0.6.0 From 760782259ddf940c31695be588ac143a2d0564f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 02:05:45 +0000 Subject: [PATCH 45/78] Bump pytest-cov from 4.1.0 to 5.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.1.0 to 5.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v4.1.0...v5.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 177d57eb..07a2dc7f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,7 +3,7 @@ fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 pytest==8.1.0 -pytest-cov==4.1.0 +pytest-cov==5.0.0 tox==4.13.0 bumpversion==0.6.0 wheel==0.42.0 From 05cd81c671b092cf0062445012af754ad4d51de0 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 11:46:56 +0100 Subject: [PATCH 46/78] :construction: Add a 'modern' REST API --- snappass/main.py | 41 ++++++++++++++ tests.py | 143 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/snappass/main.py b/snappass/main.py index 597c7970..0740519e 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -217,6 +217,47 @@ def api_handle_password(): return jsonify(link=link, ttl=ttl) else: abort(500) + +@app.route('/api/v2/passwords/', methods=['POST']) +def api_v2_set_password(): + password = request.json.get('password') + ttl = int(request.json.get('ttl', DEFAULT_API_TTL)) + if not password: + # Add ProblemDetails expliciting issue with Password and/or TTL + abort(400) + + if not isinstance(ttl, int) or ttl > MAX_TTL: + else: + # Return ProblemDetails expliciting issue + abort(400) + + token = set_password(password, ttl) + base_url = set_base_url(request) + link = base_url + quote_plus(token) + return jsonify(link=link, ttl=ttl) + +@app.route('/api/v2/passwords/', methods=['HEAD']) +def api_v2_check_password(): + password_key = unquote_plus(password_key) + if not password_exists(password_key): + # Return NotFound, to indicate that password does not exists (anymore or at all) + # With ProblemDetails expliciting issue (just password not found) + abort(404) + else: + # Return OK, to indicate that password still exists + abort(200) + +@app.route('/api/v2/passwords/', methods=['GET']) +def api_v2_retrieve_password(): + password_key = unquote_plus(password_key) + password = get_password(password_key) + if not password: + # Return NotFound, to indicate that password does not exists (anymore or at all) + # With ProblemDetails expliciting issue (just password not found) + abort(404) + else: + # Return OK and the password in JSON message + return jsonify(passwork=passwork) @app.route('/', methods=['GET']) diff --git a/tests.py b/tests.py index 4ef7f0d9..e143bcad 100644 --- a/tests.py +++ b/tests.py @@ -201,6 +201,149 @@ def test_set_password_api_default_ttl(self): frozen_time.move_to("2020-05-22 12:00:00") self.assertIsNone(snappass.get_password(key)) + def test_set_password_api_v2(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords/', + headers={'Accept': 'application/json'}, + json={'password': password, 'ttl': '1209600'}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + frozen_time.move_to("2020-05-22 11:59:59") + self.assertEqual(snappass.get_password(key), password) + + frozen_time.move_to("2020-05-22 12:00:00") + self.assertIsNone(snappass.get_password(key)) + + def test_set_password_api_v2_default_ttl(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/set_password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + frozen_time.move_to("2020-05-22 11:59:59") + self.assertEqual(snappass.get_password(key), password) + + frozen_time.move_to("2020-05-22 12:00:00") + self.assertIsNone(snappass.get_password(key)) + + def test_set_password_api_v2_no_password(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + rv = self.app.post( + '/api/set_password/', + headers={'Accept': 'application/json'}, + json={'password': None}, + ) + + self.assertEqual(rv.status, 400) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + # TODO : Search for ProblemDetails propreties about Password + + def test_set_password_api_v2_too_big_ttl(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords/', + headers={'Accept': 'application/json'}, + json={'password': password, 'ttl': '1209600000'}, + ) + + self.assertEqual(rv.status, 400) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + # TODO : Search for ProblemDetails propreties about TTL + + def test_check_password_api_v2(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + rvc = self.app.head('/api/v2/password/' + quote(key)) + self.assertEqual(rv.status, 200) + + def test_check_password_api_v2_bad_keys(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + rvc = self.app.head('/api/v2/password/' + quote(key + key)) + self.assertEqual(rv.status, 404) + + # TODO : Search for ProblemDetails propreties about Password + + def test_retrieve_password_api_v2(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + rvc = self.app.get('/api/v2/password/' + quote(key)) + self.assertEqual(rv.status, 200) + + json_content_retrieved = rvc.get_json() + retrieved_password = json_content['password'] + self.assertEqual(retrieved_password, password) + + def test_retrieve_password_api_v2_bad_keys(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/password/', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) + key = unquote(key) + + rvc = self.app.head('/api/v2/password/' + quote(key + key)) + self.assertEqual(rv.status, 404) + + # TODO : Search for ProblemDetails propreties about Password + if __name__ == '__main__': unittest.main() From ed9e715b68acd99543d38afb132b26d8c857ad22 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 13:31:38 +0100 Subject: [PATCH 47/78] :construction: Add RFC7807 response type --- snappass/main.py | 60 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index 0740519e..6d7d37e0 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -100,6 +100,35 @@ def parse_token(token): decryption_key = None return storage_key, decryption_key + +def as_validation_problem(request, problem_type, problem_title, invalid_params): + base_url = set_base_url(request) + + problem = { + "type": base_url + problem_type, + "title": problem_title, + "invalid-params": invalid_params + } + return as_problem_response(problem) + +def as_not_found_problem(request, problem_type, problem_title, invalid_params): + base_url = set_base_url(request) + + problem = { + "type": base_url + problem_type, + "title": problem_title, + "invalid-params": invalid_params + } + return as_problem_response(problem, 404) + + +def as_problem_response(problem, status_code=None): + if not isinstance(status_code, int) or not status_code: + status_code = 400 + + response = make_response(jsonify(problem), status_code) + response.headers['Content-Type'] = 'application/problem+json' + return response @check_redis_alive @@ -222,14 +251,25 @@ def api_handle_password(): def api_v2_set_password(): password = request.json.get('password') ttl = int(request.json.get('ttl', DEFAULT_API_TTL)) + + invalid_params = [] + if not password: - # Add ProblemDetails expliciting issue with Password and/or TTL - abort(400) - + invalid_params.append({ + "name": "password", + "reason": "The password is required and should not be null or empty." + }) + if not isinstance(ttl, int) or ttl > MAX_TTL: - else: - # Return ProblemDetails expliciting issue - abort(400) + invalid_params.append({ + "name": "ttl", + "reason": "The specified TTL is longer than the maximum supported." + }) + + if len(invalid_params) > 0: + # Return a ProblemDetails expliciting issue with Password and/or TTL + return as_validation_problem(request, "set-password-validation-error", "The password and/or the TTL are invalid.", invalid_params) + token = set_password(password, ttl) base_url = set_base_url(request) @@ -241,11 +281,10 @@ def api_v2_check_password(): password_key = unquote_plus(password_key) if not password_exists(password_key): # Return NotFound, to indicate that password does not exists (anymore or at all) - # With ProblemDetails expliciting issue (just password not found) - abort(404) + return as_not_found_problem(request, "check-password-error", "The password doesn't exists.", [{ "name": "password_key"}]) else: # Return OK, to indicate that password still exists - abort(200) + return ('', 200) @app.route('/api/v2/passwords/', methods=['GET']) def api_v2_retrieve_password(): @@ -253,8 +292,7 @@ def api_v2_retrieve_password(): password = get_password(password_key) if not password: # Return NotFound, to indicate that password does not exists (anymore or at all) - # With ProblemDetails expliciting issue (just password not found) - abort(404) + return as_not_found_problem(request, "get-password-error", "The password doesn't exist.", [{ "name": "password_key"}]) else: # Return OK and the password in JSON message return jsonify(passwork=passwork) From ff35bb649054b38ee69f3c10e7f0b26e5294cf16 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 22:24:52 +0100 Subject: [PATCH 48/78] :construction: Import missing parts --- snappass/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index 6d7d37e0..0cdb8cf2 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -5,10 +5,11 @@ import redis from cryptography.fernet import Fernet -from flask import abort, Flask, render_template, request, jsonify +from flask import abort, Flask, render_template, request, jsonify, make_response from redis.exceptions import ConnectionError from urllib.parse import quote_plus from urllib.parse import unquote_plus +from urllib.parse import urljoin from distutils.util import strtobool from flask_babel import Babel @@ -270,24 +271,23 @@ def api_v2_set_password(): # Return a ProblemDetails expliciting issue with Password and/or TTL return as_validation_problem(request, "set-password-validation-error", "The password and/or the TTL are invalid.", invalid_params) - token = set_password(password, ttl) base_url = set_base_url(request) - link = base_url + quote_plus(token) + link = urljoin(base_url, request.path + quote_plus(token)) return jsonify(link=link, ttl=ttl) @app.route('/api/v2/passwords/', methods=['HEAD']) -def api_v2_check_password(): +def api_v2_check_password(password_key): password_key = unquote_plus(password_key) if not password_exists(password_key): # Return NotFound, to indicate that password does not exists (anymore or at all) - return as_not_found_problem(request, "check-password-error", "The password doesn't exists.", [{ "name": "password_key"}]) + return ('', 404) else: # Return OK, to indicate that password still exists return ('', 200) @app.route('/api/v2/passwords/', methods=['GET']) -def api_v2_retrieve_password(): +def api_v2_retrieve_password(password_key): password_key = unquote_plus(password_key) password = get_password(password_key) if not password: @@ -295,7 +295,7 @@ def api_v2_retrieve_password(): return as_not_found_problem(request, "get-password-error", "The password doesn't exist.", [{ "name": "password_key"}]) else: # Return OK and the password in JSON message - return jsonify(passwork=passwork) + return jsonify(password=password) @app.route('/', methods=['GET']) From ad5a7de2925c2838dcd5f05d3f194e8a861d2634 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 22:24:58 +0100 Subject: [PATCH 49/78] :art: Cleanup --- snappass/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index 0cdb8cf2..1ae77a40 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -101,7 +101,7 @@ def parse_token(token): decryption_key = None return storage_key, decryption_key - + def as_validation_problem(request, problem_type, problem_title, invalid_params): base_url = set_base_url(request) @@ -247,12 +247,12 @@ def api_handle_password(): return jsonify(link=link, ttl=ttl) else: abort(500) - + @app.route('/api/v2/passwords/', methods=['POST']) def api_v2_set_password(): password = request.json.get('password') ttl = int(request.json.get('ttl', DEFAULT_API_TTL)) - + invalid_params = [] if not password: From 82d3a61afd462dbec22031850cc7a614803c2c46 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 23:47:18 +0100 Subject: [PATCH 50/78] :recycle: Use token as name for password_key --- snappass/main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index 1ae77a40..beed48c3 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -276,23 +276,23 @@ def api_v2_set_password(): link = urljoin(base_url, request.path + quote_plus(token)) return jsonify(link=link, ttl=ttl) -@app.route('/api/v2/passwords/', methods=['HEAD']) -def api_v2_check_password(password_key): - password_key = unquote_plus(password_key) - if not password_exists(password_key): +@app.route('/api/v2/passwords/', methods=['HEAD']) +def api_v2_check_password(token): + token = unquote_plus(token) + if not password_exists(token): # Return NotFound, to indicate that password does not exists (anymore or at all) return ('', 404) else: # Return OK, to indicate that password still exists return ('', 200) -@app.route('/api/v2/passwords/', methods=['GET']) -def api_v2_retrieve_password(password_key): - password_key = unquote_plus(password_key) - password = get_password(password_key) +@app.route('/api/v2/passwords/', methods=['GET']) +def api_v2_retrieve_password(token): + token = unquote_plus(token) + password = get_password(token) if not password: # Return NotFound, to indicate that password does not exists (anymore or at all) - return as_not_found_problem(request, "get-password-error", "The password doesn't exist.", [{ "name": "password_key"}]) + return as_not_found_problem(request, "get-password-error", "The password doesn't exist.", [{ "name": "token"}]) else: # Return OK and the password in JSON message return jsonify(password=password) From 2023c9dc35e9fcb509ba90d4b111a60d6ca56bad Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 23:47:30 +0100 Subject: [PATCH 51/78] :technologist: Use HATEHOAS style --- snappass/main.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index beed48c3..ab52f0c4 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -248,7 +248,7 @@ def api_handle_password(): else: abort(500) -@app.route('/api/v2/passwords/', methods=['POST']) +@app.route('/api/v2/passwords', methods=['POST']) def api_v2_set_password(): password = request.json.get('password') ttl = int(request.json.get('ttl', DEFAULT_API_TTL)) @@ -272,9 +272,18 @@ def api_v2_set_password(): return as_validation_problem(request, "set-password-validation-error", "The password and/or the TTL are invalid.", invalid_params) token = set_password(password, ttl) + url_token= quote_plus(token) base_url = set_base_url(request) - link = urljoin(base_url, request.path + quote_plus(token)) - return jsonify(link=link, ttl=ttl) + link = urljoin(base_url, request.path + "/" + url_token) + response_content = { + "token": url_token, + "links": [{ + "rel": "self", + "href": link + }], + "ttl": ttl + } + return jsonify(response_content) @app.route('/api/v2/passwords/', methods=['HEAD']) def api_v2_check_password(token): From 3cfd5f03c09383f61b793feb758608d9763a63ab Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 23:47:42 +0100 Subject: [PATCH 52/78] :white_check_mark: Finish test suite implementation --- tests.py | 102 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/tests.py b/tests.py index e143bcad..fa24902f 100644 --- a/tests.py +++ b/tests.py @@ -4,6 +4,7 @@ import uuid from unittest import TestCase from unittest import mock +from urllib.parse import quote from urllib.parse import unquote from cryptography.fernet import Fernet @@ -205,14 +206,13 @@ def test_set_password_api_v2(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/passwords/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password, 'ttl': '1209600'}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) frozen_time.move_to("2020-05-22 11:59:59") self.assertEqual(snappass.get_password(key), password) @@ -224,14 +224,13 @@ def test_set_password_api_v2_default_ttl(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/set_password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) frozen_time.move_to("2020-05-22 11:59:59") self.assertEqual(snappass.get_password(key), password) @@ -242,107 +241,124 @@ def test_set_password_api_v2_default_ttl(self): def test_set_password_api_v2_no_password(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: rv = self.app.post( - '/api/set_password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, - json={'password': None}, + json={'password': ''}, ) - self.assertEqual(rv.status, 400) + self.assertEqual(rv.status_code, 400) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) - - # TODO : Search for ProblemDetails propreties about Password + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_password = invalid_params[0] + self.assertEqual(bad_password['name'], 'password') def test_set_password_api_v2_too_big_ttl(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/passwords/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password, 'ttl': '1209600000'}, ) - self.assertEqual(rv.status, 400) + self.assertEqual(rv.status_code, 400) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_ttl = invalid_params[0] + self.assertEqual(bad_ttl['name'], 'ttl') + + def test_set_password_api_v2_no_password_and_too_big_ttl(self): + with freeze_time("2020-05-08 12:00:00") as frozen_time: + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': '', 'ttl': '1209600000'}, + ) + + self.assertEqual(rv.status_code, 400) - # TODO : Search for ProblemDetails propreties about TTL + json_content = rv.get_json() + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 2) + bad_password = invalid_params[0] + self.assertEqual(bad_password['name'], 'password') + bad_ttl = invalid_params[1] + self.assertEqual(bad_ttl['name'], 'ttl') def test_check_password_api_v2(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) - rvc = self.app.head('/api/v2/password/' + quote(key)) - self.assertEqual(rv.status, 200) + rvc = self.app.head('/api/v2/passwords/' + quote(key)) + self.assertEqual(rv.status_code, 200) def test_check_password_api_v2_bad_keys(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) - rvc = self.app.head('/api/v2/password/' + quote(key + key)) - self.assertEqual(rv.status, 404) - - # TODO : Search for ProblemDetails propreties about Password + rvc = self.app.head('/api/v2/passwords/' + quote(key[::-1])) + self.assertEqual(rvc.status_code, 404) def test_retrieve_password_api_v2(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) - rvc = self.app.get('/api/v2/password/' + quote(key)) - self.assertEqual(rv.status, 200) + rvc = self.app.get('/api/v2/passwords/' + quote(key)) + self.assertEqual(rv.status_code, 200) json_content_retrieved = rvc.get_json() - retrieved_password = json_content['password'] + retrieved_password = json_content_retrieved['password'] self.assertEqual(retrieved_password, password) def test_retrieve_password_api_v2_bad_keys(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' rv = self.app.post( - '/api/v2/password/', + '/api/v2/passwords', headers={'Accept': 'application/json'}, json={'password': password}, ) json_content = rv.get_json() - key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) - key = unquote(key) + key = unquote(json_content['token']) - rvc = self.app.head('/api/v2/password/' + quote(key + key)) - self.assertEqual(rv.status, 404) - - # TODO : Search for ProblemDetails propreties about Password + rvc = self.app.get('/api/v2/passwords/' + quote(key[::-1])) + self.assertEqual(rvc.status_code, 404) + + json_content_retrieved = rvc.get_json() + invalid_params = json_content_retrieved['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_token = invalid_params[0] + self.assertEqual(bad_token['name'], 'token') if __name__ == '__main__': From 26b26f9c2542bc0324dcaee39ab596f1593a6513 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 23:49:56 +0100 Subject: [PATCH 53/78] :memo: Add documentation about new APIs --- README.rst | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 145 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index af35b5e1..3f45ba8b 100644 --- a/README.rst +++ b/README.rst @@ -96,12 +96,17 @@ need to change this. ``HOST_OVERRIDE``: (optional) Used to override the base URL if the app is unaware. Useful when running behind reverse proxies like an identity-aware SSO. Example: ``sub.domain.com`` -API ---- +APIs +---- -SnapPass also has a simple API that can be used to create passwords links. The advantage of using the API is that -you can create a password and retrieve the link without having to open the web interface. This is useful if you want to -embed it in a script or use it in a CI/CD pipeline. +SnapPass has 2 APIs : +1. A simple API : That can be used to create passwords links, and then share them with users +2. A more REST-y API : Which facilitate programmatic interactions with SnapPass, without having to parse HTML content when retrieving the password + +Simple API +^^^^^^^^^^ + +The advantage of using the simple API is that you can create a password and retrieve the link without having to open the web interface. This is useful if you want to embed it in a script or use it in a CI/CD pipeline. To create a password, send a POST request to ``/api/set_password`` like so: @@ -124,12 +129,146 @@ the default TTL is 2 weeks (1209600 seconds), but you can override it by adding $ curl -X POST -H "Content-Type: application/json" -d '{"password": "foobar", "ttl": 3600 }' http://localhost:5000/api/set_password/ + +REST API +^^^^^^^^ + +The advantage of using the REST API is that you can fully manage the lifecycle of the password stored in SnapPass without having to interact with any web user interface. + +This is useful if you want to embed it in a script, use it in a CI/CD pipeline or share it between multiple client applications. + +Create a password +""""""""""""""""" + +To create a password, send a POST request to ``/api/v2/passwords`` like so: + +:: + + $ curl -X POST -H "Content-Type: application/json" -d '{"password": "foobar"}' http://localhost:5000/api/v2/passwords + +This will return a JSON response with a token and the password link: + +:: + + { + "token": "snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", + "links": [{ + "rel": "self", + "href": "http://127.0.0.1:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", + }], + "ttl":1209600 + } + +The default TTL is 2 weeks (1209600 seconds), but you can override it by adding a expiration parameter: + +:: + + $ curl -X POST -H "Content-Type: application/json" -d '{"password": "foobar", "ttl": 3600 }' http://localhost:5000/api/v2/passwords + +If the password is null or empty, and the TTL is larger than the max TTL of the application, the API will return an error like this: + + +Otherwise, the API will return a 404 (Not Found) response like so: + +:: + + { + "invalid-params": [{ + "name": "password", + "reason": "The password is required and should not be null or empty." + }, { + "name": "ttl", + "reason": "The specified TTL is longer than the maximum supported." + }], + "title": "The password and/or the TTL are invalid.", + "type": "https://127.0.0.1:5000/set-password-validation-error" + } + +Check if a password exists +"""""""""""""""""""""""""" + +To check if a password exists, send a HEAD request to ``/api/v2/passwords/``, where ```` is the token of the API response when a password is created, or simply use the `self` link: + +:: + + $ curl --head http://localhost:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D + +If : +- the passwork_key is valid +- the password : + - exists, + - has not been read + - is not expired + +Then the API will return a 200 (OK) response like so: + +:: + + HTTP/1.1 200 OK + Server: Werkzeug/3.0.1 Python/3.12.2 + Date: Fri, 29 Mar 2024 22:15:54 GMT + Content-Type: text/html; charset=utf-8 + Content-Length: 0 + Connection: close + +Otherwise, the API will return a 404 (Not Found) response like so: + +:: + + HTTP/1.1 404 NOT FOUND + Server: Werkzeug/3.0.1 Python/3.12.2 + Date: Fri, 29 Mar 2024 22:19:29 GMT + Content-Type: text/html; charset=utf-8 + Content-Length: 0 + Connection: close + + +Read a password +""""""""""""""" + +To read a password, send a GET request to ``/api/v2/passwords/``, where ```` is the token of the API response when a password is created, or simply use the `self` link: + +:: + + $ curl -X GET http://localhost:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D + +If : +- the passwork_key is valid +- the password : + - exists, + - has not been read + - is not expired + +Then the API will return a 200 (OK) with a JSON response containing the password : + +:: + + { + "password": "foobar" + } + +Otherwise, the API will return a 404 (Not Found) response like so: + +:: + + { + "invalid-params": [{ + "name": "token" + }], + "title": "The password doesn't exist.", + "type": "https://127.0.0.1:5000/get-password-error" + } + +Notes on APIs +^^^^^^^^^^^^^ + Notes: -- When using the API, you can specify any ttl, as long as it is lower than the default. +- When using the APIs, you can specify any ttl, as long as it is lower than the default. - The password is passed in the body of the request rather than in the URL. This is to prevent the password from being logged in the server logs. - Depending on the environment you are running it, you might want to expose the ``/api`` endpoint to your internal network only, and put the web interface behind authentication. + Docker ------ From 04235c1edc4a562a64cb5322bd4834571f1f0f38 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Fri, 29 Mar 2024 23:59:15 +0100 Subject: [PATCH 54/78] :art: flake8 --- snappass/main.py | 21 ++++- tests.py | 196 +++++++++++++++++++++++------------------------ 2 files changed, 112 insertions(+), 105 deletions(-) diff --git a/snappass/main.py b/snappass/main.py index ab52f0c4..9ef5a430 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -102,6 +102,7 @@ def parse_token(token): return storage_key, decryption_key + def as_validation_problem(request, problem_type, problem_title, invalid_params): base_url = set_base_url(request) @@ -112,6 +113,7 @@ def as_validation_problem(request, problem_type, problem_title, invalid_params): } return as_problem_response(problem) + def as_not_found_problem(request, problem_type, problem_title, invalid_params): base_url = set_base_url(request) @@ -248,6 +250,7 @@ def api_handle_password(): else: abort(500) + @app.route('/api/v2/passwords', methods=['POST']) def api_v2_set_password(): password = request.json.get('password') @@ -269,10 +272,15 @@ def api_v2_set_password(): if len(invalid_params) > 0: # Return a ProblemDetails expliciting issue with Password and/or TTL - return as_validation_problem(request, "set-password-validation-error", "The password and/or the TTL are invalid.", invalid_params) + return as_validation_problem( + request, + "set-password-validation-error", + "The password and/or the TTL are invalid.", + invalid_params + ) token = set_password(password, ttl) - url_token= quote_plus(token) + url_token = quote_plus(token) base_url = set_base_url(request) link = urljoin(base_url, request.path + "/" + url_token) response_content = { @@ -285,6 +293,7 @@ def api_v2_set_password(): } return jsonify(response_content) + @app.route('/api/v2/passwords/', methods=['HEAD']) def api_v2_check_password(token): token = unquote_plus(token) @@ -295,13 +304,19 @@ def api_v2_check_password(token): # Return OK, to indicate that password still exists return ('', 200) + @app.route('/api/v2/passwords/', methods=['GET']) def api_v2_retrieve_password(token): token = unquote_plus(token) password = get_password(token) if not password: # Return NotFound, to indicate that password does not exists (anymore or at all) - return as_not_found_problem(request, "get-password-error", "The password doesn't exist.", [{ "name": "token"}]) + return as_not_found_problem( + request, + "get-password-error", + "The password doesn't exist.", + [{"name": "token"}] + ) else: # Return OK and the password in JSON message return jsonify(password=password) diff --git a/tests.py b/tests.py index fa24902f..b4b089e9 100644 --- a/tests.py +++ b/tests.py @@ -239,126 +239,118 @@ def test_set_password_api_v2_default_ttl(self): self.assertIsNone(snappass.get_password(key)) def test_set_password_api_v2_no_password(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': ''}, - ) + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': ''}, + ) - self.assertEqual(rv.status_code, 400) + self.assertEqual(rv.status_code, 400) - json_content = rv.get_json() - invalid_params = json_content['invalid-params'] - self.assertEqual(len(invalid_params), 1) - bad_password = invalid_params[0] - self.assertEqual(bad_password['name'], 'password') - - def test_set_password_api_v2_too_big_ttl(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': password, 'ttl': '1209600000'}, - ) + json_content = rv.get_json() + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_password = invalid_params[0] + self.assertEqual(bad_password['name'], 'password') - self.assertEqual(rv.status_code, 400) + def test_set_password_api_v2_too_big_ttl(self): + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': password, 'ttl': '1209600000'}, + ) - json_content = rv.get_json() - invalid_params = json_content['invalid-params'] - self.assertEqual(len(invalid_params), 1) - bad_ttl = invalid_params[0] - self.assertEqual(bad_ttl['name'], 'ttl') - - def test_set_password_api_v2_no_password_and_too_big_ttl(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': '', 'ttl': '1209600000'}, - ) + self.assertEqual(rv.status_code, 400) - self.assertEqual(rv.status_code, 400) + json_content = rv.get_json() + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_ttl = invalid_params[0] + self.assertEqual(bad_ttl['name'], 'ttl') - json_content = rv.get_json() - invalid_params = json_content['invalid-params'] - self.assertEqual(len(invalid_params), 2) - bad_password = invalid_params[0] - self.assertEqual(bad_password['name'], 'password') - bad_ttl = invalid_params[1] - self.assertEqual(bad_ttl['name'], 'ttl') + def test_set_password_api_v2_no_password_and_too_big_ttl(self): + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': '', 'ttl': '1209600000'}, + ) + + self.assertEqual(rv.status_code, 400) + + json_content = rv.get_json() + invalid_params = json_content['invalid-params'] + self.assertEqual(len(invalid_params), 2) + bad_password = invalid_params[0] + self.assertEqual(bad_password['name'], 'password') + bad_ttl = invalid_params[1] + self.assertEqual(bad_ttl['name'], 'ttl') def test_check_password_api_v2(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': password}, - ) + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) - json_content = rv.get_json() - key = unquote(json_content['token']) - - rvc = self.app.head('/api/v2/passwords/' + quote(key)) - self.assertEqual(rv.status_code, 200) + json_content = rv.get_json() + key = unquote(json_content['token']) + + rvc = self.app.head('/api/v2/passwords/' + quote(key)) + self.assertEqual(rvc.status_code, 200) def test_check_password_api_v2_bad_keys(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': password}, - ) + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) - json_content = rv.get_json() - key = unquote(json_content['token']) - - rvc = self.app.head('/api/v2/passwords/' + quote(key[::-1])) - self.assertEqual(rvc.status_code, 404) + json_content = rv.get_json() + key = unquote(json_content['token']) + + rvc = self.app.head('/api/v2/passwords/' + quote(key[::-1])) + self.assertEqual(rvc.status_code, 404) def test_retrieve_password_api_v2(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': password}, - ) + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) - json_content = rv.get_json() - key = unquote(json_content['token']) - - rvc = self.app.get('/api/v2/passwords/' + quote(key)) - self.assertEqual(rv.status_code, 200) + json_content = rv.get_json() + key = unquote(json_content['token']) - json_content_retrieved = rvc.get_json() - retrieved_password = json_content_retrieved['password'] - self.assertEqual(retrieved_password, password) + rvc = self.app.get('/api/v2/passwords/' + quote(key)) + self.assertEqual(rv.status_code, 200) - def test_retrieve_password_api_v2_bad_keys(self): - with freeze_time("2020-05-08 12:00:00") as frozen_time: - password = 'my name is my passport. verify me.' - rv = self.app.post( - '/api/v2/passwords', - headers={'Accept': 'application/json'}, - json={'password': password}, - ) + json_content_retrieved = rvc.get_json() + retrieved_password = json_content_retrieved['password'] + self.assertEqual(retrieved_password, password) - json_content = rv.get_json() - key = unquote(json_content['token']) - - rvc = self.app.get('/api/v2/passwords/' + quote(key[::-1])) - self.assertEqual(rvc.status_code, 404) - - json_content_retrieved = rvc.get_json() - invalid_params = json_content_retrieved['invalid-params'] - self.assertEqual(len(invalid_params), 1) - bad_token = invalid_params[0] - self.assertEqual(bad_token['name'], 'token') + def test_retrieve_password_api_v2_bad_keys(self): + password = 'my name is my passport. verify me.' + rv = self.app.post( + '/api/v2/passwords', + headers={'Accept': 'application/json'}, + json={'password': password}, + ) + + json_content = rv.get_json() + key = unquote(json_content['token']) + + rvc = self.app.get('/api/v2/passwords/' + quote(key[::-1])) + self.assertEqual(rvc.status_code, 404) + + json_content_retrieved = rvc.get_json() + invalid_params = json_content_retrieved['invalid-params'] + self.assertEqual(len(invalid_params), 1) + bad_token = invalid_params[0] + self.assertEqual(bad_token['name'], 'token') if __name__ == '__main__': From b69290425a301366b26042577e74f18abcb20f3f Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Sat, 30 Mar 2024 20:46:02 +0100 Subject: [PATCH 55/78] :children_crossing: Remove URL encoding from token --- README.rst | 7 ++++--- snappass/main.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 3f45ba8b..8c55ce5f 100644 --- a/README.rst +++ b/README.rst @@ -152,6 +152,7 @@ This will return a JSON response with a token and the password link: { "token": "snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", + "token": "snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY=", "links": [{ "rel": "self", "href": "http://127.0.0.1:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", @@ -187,7 +188,7 @@ Otherwise, the API will return a 404 (Not Found) response like so: Check if a password exists """""""""""""""""""""""""" -To check if a password exists, send a HEAD request to ``/api/v2/passwords/``, where ```` is the token of the API response when a password is created, or simply use the `self` link: +To check if a password exists, send a HEAD request to ``/api/v2/passwords/``, where ```` is the token of the API response when a password is created (url encoded), or simply use the `self` link: :: @@ -233,9 +234,9 @@ To read a password, send a GET request to ``/api/v2/passwords/``, $ curl -X GET http://localhost:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D If : -- the passwork_key is valid +- the token is valid - the password : - - exists, + - exists - has not been read - is not expired diff --git a/snappass/main.py b/snappass/main.py index 9ef5a430..9b046909 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -285,6 +285,7 @@ def api_v2_set_password(): link = urljoin(base_url, request.path + "/" + url_token) response_content = { "token": url_token, + "token": token, "links": [{ "rel": "self", "href": link From e4803977c0dc6be1a88abfcbe5bd2d1accdd3b78 Mon Sep 17 00:00:00 2001 From: Emilien GUILMINEAU Date: Sat, 30 Mar 2024 20:47:03 +0100 Subject: [PATCH 56/78] :children_crossing: Add a link to web view Allowing usage of the password into a subsystem which target human --- README.rst | 4 +++- snappass/main.py | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 8c55ce5f..6e98da75 100644 --- a/README.rst +++ b/README.rst @@ -151,11 +151,13 @@ This will return a JSON response with a token and the password link: :: { - "token": "snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", "token": "snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY=", "links": [{ "rel": "self", "href": "http://127.0.0.1:5000/api/v2/passwords/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", + },{ + "rel": "web-view", + "href": "http://127.0.0.1:5000/snappassbedf19b161794fd288faec3eba15fa41~hHnILpQ50ZfJc3nurDfHCb_22rBr5gGEya68e_cZOrY%3D", }], "ttl":1209600 } diff --git a/snappass/main.py b/snappass/main.py index 9b046909..6f06572e 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -282,13 +282,16 @@ def api_v2_set_password(): token = set_password(password, ttl) url_token = quote_plus(token) base_url = set_base_url(request) - link = urljoin(base_url, request.path + "/" + url_token) + api_link = urljoin(base_url, request.path + "/" + url_token) + web_link = urljoin(base_url, url_token) response_content = { - "token": url_token, "token": token, "links": [{ "rel": "self", - "href": link + "href": api_link + }, { + "rel": "web-view", + "href": web_link }], "ttl": ttl } From cbeb61196d53d0a53e042424e530f653a6bc4b71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:13:01 +0000 Subject: [PATCH 57/78] Bump wheel from 0.42.0 to 0.43.0 Bumps [wheel](https://github.com/pypa/wheel) from 0.42.0 to 0.43.0. - [Release notes](https://github.com/pypa/wheel/releases) - [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst) - [Commits](https://github.com/pypa/wheel/compare/0.42.0...0.43.0) --- updated-dependencies: - dependency-name: wheel dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 07a2dc7f..fd1d2c9c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,4 +6,4 @@ pytest==8.1.0 pytest-cov==5.0.0 tox==4.13.0 bumpversion==0.6.0 -wheel==0.42.0 +wheel==0.43.0 From e2ca2fa8b9513a67ca84c513a34619d355cb928f Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 6 May 2024 19:37:36 +0000 Subject: [PATCH 58/78] fix: requirements.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-WERKZEUG-6808933 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7e96b4c6..1b9782e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.1 redis==5.0.1 -Werkzeug==3.0.1 +Werkzeug==3.0.3 flask-babel From e24732235a463f426e05f4a3093b78dd8625181d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:18:36 -0700 Subject: [PATCH 59/78] Bump tox from 4.13.0 to 4.16.0 (#376) Bumps [tox](https://github.com/tox-dev/tox) from 4.13.0 to 4.16.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.13.0...4.16.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index fd1d2c9c..0b67f69e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,6 @@ flake8==7.0.0 freezegun==1.4.0 pytest==8.1.0 pytest-cov==5.0.0 -tox==4.13.0 +tox==4.16.0 bumpversion==0.6.0 wheel==0.43.0 From 4c5f63b536f560bae4410734034334a9ee08bb22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:23:28 -0700 Subject: [PATCH 60/78] Bump coverage from 7.4.2 to 7.6.0 (#379) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.2 to 7.6.0. - [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.2...7.6.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0b67f69e..94b8fbc3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -coverage==7.4.2 +coverage==7.6.0 fakeredis==2.21.1 flake8==7.0.0 freezegun==1.4.0 From 91dd677cdbd088ee932e649aacfae43e8ea0790d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:26:59 -0700 Subject: [PATCH 61/78] Bump fakeredis from 2.21.1 to 2.23.4 (#381) Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.21.1 to 2.23.4. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v2.21.1...v2.23.4) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 94b8fbc3..22fee171 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==7.6.0 -fakeredis==2.21.1 +fakeredis==2.23.4 flake8==7.0.0 freezegun==1.4.0 pytest==8.1.0 From f6ad788fda7ddf9ca9a92ad61b6ad85bbb100b09 Mon Sep 17 00:00:00 2001 From: Devin Lundberg Date: Fri, 2 Aug 2024 17:27:48 -0500 Subject: [PATCH 62/78] [Snyk] Security upgrade cryptography from 42.0.3 to 42.0.8 (#371) fix: requirements.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6913422 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1b9782e8..0699f457 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==42.0.3 +cryptography==42.0.8 Flask==3.0.0 itsdangerous==2.1.2 Jinja2==3.1.3 From d3ffeac5859bbd3b84c2f8aa3df70c404c56481b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:35:01 -0700 Subject: [PATCH 63/78] Bump freezegun from 1.4.0 to 1.5.1 (#362) Bumps [freezegun](https://github.com/spulec/freezegun) from 1.4.0 to 1.5.1. - [Release notes](https://github.com/spulec/freezegun/releases) - [Changelog](https://github.com/spulec/freezegun/blob/master/CHANGELOG) - [Commits](https://github.com/spulec/freezegun/compare/1.4.0...1.5.1) --- updated-dependencies: - dependency-name: freezegun dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 22fee171..d4625590 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ coverage==7.6.0 fakeredis==2.23.4 flake8==7.0.0 -freezegun==1.4.0 +freezegun==1.5.1 pytest==8.1.0 pytest-cov==5.0.0 tox==4.16.0 From 57ec6249a6ae18bfa92289ede38e0dd4633c2f7f Mon Sep 17 00:00:00 2001 From: Devin Lundberg Date: Fri, 2 Aug 2024 17:35:50 -0500 Subject: [PATCH 64/78] [Snyk] Security upgrade jinja2 from 3.1.3 to 3.1.4 (#359) fix: requirements.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-JINJA2-6809379 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0699f457..5b6e2886 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cryptography==42.0.8 Flask==3.0.0 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.1 redis==5.0.1 Werkzeug==3.0.3 From 4e5fc2ef1fb4b10a88266e04501ebab7b2a6fc59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:39:27 -0700 Subject: [PATCH 65/78] Bump itsdangerous from 2.1.2 to 2.2.0 (#347) Bumps [itsdangerous](https://github.com/pallets/itsdangerous) from 2.1.2 to 2.2.0. - [Release notes](https://github.com/pallets/itsdangerous/releases) - [Changelog](https://github.com/pallets/itsdangerous/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/itsdangerous/compare/2.1.2...2.2.0) --- updated-dependencies: - dependency-name: itsdangerous 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> Co-authored-by: Yuru Shao --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5b6e2886..0dbc34f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ cryptography==42.0.8 Flask==3.0.0 -itsdangerous==2.1.2 +itsdangerous==2.2.0 Jinja2==3.1.4 MarkupSafe==2.1.1 redis==5.0.1 From 9e435787c6674f743c69490dcc8f3ac8595dacac Mon Sep 17 00:00:00 2001 From: Egg <45681670+Radical-Egg@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:40:39 -0700 Subject: [PATCH 66/78] Environment variables for default port and bind address (#342) * Add env vars to override default bind address and port * Update main.py Prefix bind address and port with SNAPPASS_ * Update README.rst update readme to prefix SNAPPASS_ to bind address and port --------- Co-authored-by: Yuru Shao --- README.rst | 4 ++++ snappass/main.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6e98da75..b816cea9 100644 --- a/README.rst +++ b/README.rst @@ -96,6 +96,10 @@ need to change this. ``HOST_OVERRIDE``: (optional) Used to override the base URL if the app is unaware. Useful when running behind reverse proxies like an identity-aware SSO. Example: ``sub.domain.com`` +``SNAPPASS_BIND_ADDRESS``: (optional) Used to override the default bind address of 0.0.0.0 for flask app Example: ``127.0.0.1`` + +``SNAPPASS_PORT``: (optional) Used to override the default port of 5000 Example: ``6000`` + APIs ---- diff --git a/snappass/main.py b/snappass/main.py index 6f06572e..2c16cdca 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -353,7 +353,8 @@ def health_check(): @check_redis_alive def main(): - app.run(host='0.0.0.0') + app.run(host=os.environ.get('SNAPPASS_BIND_ADDRESS', '0.0.0.0'), + port=os.environ.get('SNAPPASS_PORT', 5000)) if __name__ == '__main__': From 6370c0439d58b630d273de88176df3518bd24560 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:45:48 -0700 Subject: [PATCH 67/78] Bump cryptography from 42.0.8 to 43.0.0 (#382) Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.8 to 43.0.0. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/42.0.8...43.0.0) --- updated-dependencies: - dependency-name: cryptography 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.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0dbc34f1..a7c5df28 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==42.0.8 +cryptography==43.0.0 Flask==3.0.0 itsdangerous==2.2.0 Jinja2==3.1.4 From 7af97129412f038d4cb1264f9395677e66b9f0ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:46:33 -0700 Subject: [PATCH 68/78] Bump pytest from 8.1.0 to 8.3.2 (#385) Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.0 to 8.3.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.0...8.3.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index d4625590..00892c51 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,7 @@ coverage==7.6.0 fakeredis==2.23.4 flake8==7.0.0 freezegun==1.5.1 -pytest==8.1.0 +pytest==8.3.2 pytest-cov==5.0.0 tox==4.16.0 bumpversion==0.6.0 From 63f7d8f18d299f7daa79ae5f8609c2ce2fadcfb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:35:54 -0700 Subject: [PATCH 69/78] Bump flake8 from 7.0.0 to 7.1.1 (#383) Bumps [flake8](https://github.com/pycqa/flake8) from 7.0.0 to 7.1.1. - [Commits](https://github.com/pycqa/flake8/compare/7.0.0...7.1.1) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 00892c51..d94c4a7c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,6 +1,6 @@ coverage==7.6.0 fakeredis==2.23.4 -flake8==7.0.0 +flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 pytest-cov==5.0.0 From eea66f49e7b303100577bbac2ec2a2c5b881b9fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:36:15 -0700 Subject: [PATCH 70/78] Bump wheel from 0.43.0 to 0.44.0 (#384) Bumps [wheel](https://github.com/pypa/wheel) from 0.43.0 to 0.44.0. - [Release notes](https://github.com/pypa/wheel/releases) - [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst) - [Commits](https://github.com/pypa/wheel/compare/0.43.0...0.44.0) --- updated-dependencies: - dependency-name: wheel dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index d94c4a7c..0336b2f4 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,4 +6,4 @@ pytest==8.3.2 pytest-cov==5.0.0 tox==4.16.0 bumpversion==0.6.0 -wheel==0.43.0 +wheel==0.44.0 From ce7994e95c78bd0192052020c2c8337e1a68ce8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:09:33 -0700 Subject: [PATCH 71/78] Bump tox from 4.16.0 to 4.17.0 (#386) Bumps [tox](https://github.com/tox-dev/tox) from 4.16.0 to 4.17.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.16.0...4.17.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0336b2f4..34ff923b 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,6 @@ flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 pytest-cov==5.0.0 -tox==4.16.0 +tox==4.17.0 bumpversion==0.6.0 wheel==0.44.0 From f3af080237f17614938f5cf907a3cbe3ab1aaba7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:28:58 -0700 Subject: [PATCH 72/78] Bump tox from 4.17.0 to 4.18.0 (#388) Bumps [tox](https://github.com/tox-dev/tox) from 4.17.0 to 4.18.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.17.0...4.18.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 34ff923b..92abe454 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,6 @@ flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 pytest-cov==5.0.0 -tox==4.17.0 +tox==4.18.0 bumpversion==0.6.0 wheel==0.44.0 From 5745dd40f18ee64a71951d4e1cd4e193e8517763 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:29:15 -0700 Subject: [PATCH 73/78] Bump fakeredis from 2.23.4 to 2.24.1 (#390) Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.23.4 to 2.24.1. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v2.23.4...v2.24.1) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 92abe454..88c04797 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==7.6.0 -fakeredis==2.23.4 +fakeredis==2.24.1 flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 From c13e80bf2add34428031eb4b655b269ca1c8d7c7 Mon Sep 17 00:00:00 2001 From: Viktor Haid <52320564+viktorhaid@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:51:17 +0200 Subject: [PATCH 74/78] fix i18n (#375) * fix i18n * Ignore linter error regarding _ --- Dockerfile | 5 ++++- MANIFEST.in | 1 + snappass/main.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 70e18c50..871a0ff9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,13 @@ WORKDIR $APP_DIR COPY ["setup.py", "requirements.txt", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"] COPY ["./snappass", "$APP_DIR/snappass"] +RUN pip install -r requirements.txt + +RUN pybabel compile -d snappass/translations + RUN python setup.py install && \ chown -R snappass $APP_DIR && \ chgrp -R snappass $APP_DIR -RUN pip install -r requirements.txt USER snappass diff --git a/MANIFEST.in b/MANIFEST.in index ec67e989..e919377d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include *.rst LICENSE recursive-include snappass/static * recursive-include snappass/templates * +recursive-include snappass/translations * diff --git a/snappass/main.py b/snappass/main.py index 2c16cdca..09867e42 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -11,7 +11,8 @@ from urllib.parse import unquote_plus from urllib.parse import urljoin from distutils.util import strtobool -from flask_babel import Babel +# _ is required to get the Jinja templates translated +from flask_babel import Babel, _ # noqa: F401 NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False'))) URL_PREFIX = os.environ.get('URL_PREFIX', None) From 86e7e2e22088e8e907bd7ed334ba474d478f1d1c Mon Sep 17 00:00:00 2001 From: Devin Lundberg Date: Wed, 11 Sep 2024 12:51:49 -0500 Subject: [PATCH 75/78] [Snyk] Security upgrade cryptography from 43.0.0 to 43.0.1 (#391) fix: requirements.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-7886970 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a7c5df28..65df03dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cryptography==43.0.0 +cryptography==43.0.1 Flask==3.0.0 itsdangerous==2.2.0 Jinja2==3.1.4 From cf81a0105c5a5d7a1cb34b1e7e90b4bc61fe94bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:30:31 -0700 Subject: [PATCH 76/78] Bump tox from 4.18.0 to 4.23.0 (#405) Bumps [tox](https://github.com/tox-dev/tox) from 4.18.0 to 4.23.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.18.0...4.23.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 88c04797..320cdaac 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,6 @@ flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 pytest-cov==5.0.0 -tox==4.18.0 +tox==4.23.0 bumpversion==0.6.0 wheel==0.44.0 From 5e9054b3587c6395ed3b5f2a31b9cc6c3fdc553a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:30:48 -0700 Subject: [PATCH 77/78] Bump fakeredis from 2.24.1 to 2.25.1 (#397) Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.24.1 to 2.25.1. - [Release notes](https://github.com/cunla/fakeredis-py/releases) - [Commits](https://github.com/cunla/fakeredis-py/compare/v2.24.1...v2.25.1) --- updated-dependencies: - dependency-name: fakeredis dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 320cdaac..1f11ce37 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ coverage==7.6.0 -fakeredis==2.24.1 +fakeredis==2.25.1 flake8==7.1.1 freezegun==1.5.1 pytest==8.3.2 From b78280a4bc00673ed36b478ea01dce2b6719d30c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:31:09 -0700 Subject: [PATCH 78/78] Bump redis from 5.0.1 to 5.1.1 (#401) Bumps [redis](https://github.com/redis/redis-py) from 5.0.1 to 5.1.1. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.1...v5.1.1) --- updated-dependencies: - dependency-name: redis 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.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 65df03dc..53305fc0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ Flask==3.0.0 itsdangerous==2.2.0 Jinja2==3.1.4 MarkupSafe==2.1.1 -redis==5.0.1 +redis==5.1.1 Werkzeug==3.0.3 flask-babel