From a0e24fd23a30e65f8c91f88195d47f9eb9d8d8f9 Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Thu, 5 Dec 2024 02:36:13 +0100 Subject: [PATCH 1/8] Add codepsell action --- .github/workflows/codepell.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/codepell.yaml diff --git a/.github/workflows/codepell.yaml b/.github/workflows/codepell.yaml new file mode 100644 index 0000000000..5b09108bea --- /dev/null +++ b/.github/workflows/codepell.yaml @@ -0,0 +1,12 @@ +name: codespell +on: [pull_request] +jobs: + codespell: + name: runner / codespell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: codespell + uses: codespell-project/actions-codespell@v2 + with: + skip: privacyidea/static/contrib/*,privacyidea/static/components/translation/*,privacyidea/translations/*,po/* From 264b19f893189ddcdf7118b2877eaf00ab661bd7 Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Fri, 6 Dec 2024 02:36:24 +0100 Subject: [PATCH 2/8] Update spell check actions --- .../{codepell.yaml => codespell.yaml} | 0 .github/workflows/rd_codespell.yaml | 28 +++++++++++++++++++ .github/workflows/rd_misspell.yaml | 18 ++++++++++++ 3 files changed, 46 insertions(+) rename .github/workflows/{codepell.yaml => codespell.yaml} (100%) create mode 100644 .github/workflows/rd_codespell.yaml create mode 100644 .github/workflows/rd_misspell.yaml diff --git a/.github/workflows/codepell.yaml b/.github/workflows/codespell.yaml similarity index 100% rename from .github/workflows/codepell.yaml rename to .github/workflows/codespell.yaml diff --git a/.github/workflows/rd_codespell.yaml b/.github/workflows/rd_codespell.yaml new file mode 100644 index 0000000000..18551dc5d7 --- /dev/null +++ b/.github/workflows/rd_codespell.yaml @@ -0,0 +1,28 @@ +name: reviewdog-codespell +on: + pull_request: + +jobs: + reviewdog-github-check: + permissions: + checks: write + contents: read + pull-requests: write + name: reviewdog (github-check) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install codespell + run: | + python -m pip install -U codespell + + - name: Setup reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run reviewdog + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + codespell -q 3 -S ./privacyidea/static/contrib/*,./privacyidea/static/components/translation/*,./privacyidea/translations/*,./po/* . \ + | reviewdog -efm="%f:%l: %m" -name="codespell" -reporter=github-pr-check -level=warning diff --git a/.github/workflows/rd_misspell.yaml b/.github/workflows/rd_misspell.yaml new file mode 100644 index 0000000000..af1f93e220 --- /dev/null +++ b/.github/workflows/rd_misspell.yaml @@ -0,0 +1,18 @@ +name: reviewdog-misspell +on: [pull_request] +jobs: + reviewdog: + name: reviewdog + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + locale: "US" + exclude: | + ./.git/* + ./privacyidea/static/contrib/* + ./privacyidea/static/components/translation/* + ./privacyidea/translations/* + ./po/* From 758f9a124c592eb5dd39c0f36b1718949c72aecc Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Fri, 6 Dec 2024 16:59:16 +0100 Subject: [PATCH 3/8] Use reviewdog action for codespell --- .github/workflows/codespell.yaml | 12 ------------ .github/workflows/rd_codespell.yaml | 2 +- .github/workflows/rd_misspell.yaml | 18 ------------------ .github/workflows/reviewdog.yml | 14 -------------- 4 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 .github/workflows/codespell.yaml delete mode 100644 .github/workflows/rd_misspell.yaml delete mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml deleted file mode 100644 index 5b09108bea..0000000000 --- a/.github/workflows/codespell.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: codespell -on: [pull_request] -jobs: - codespell: - name: runner / codespell - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: codespell - uses: codespell-project/actions-codespell@v2 - with: - skip: privacyidea/static/contrib/*,privacyidea/static/components/translation/*,privacyidea/translations/*,po/* diff --git a/.github/workflows/rd_codespell.yaml b/.github/workflows/rd_codespell.yaml index 18551dc5d7..1920a3fa01 100644 --- a/.github/workflows/rd_codespell.yaml +++ b/.github/workflows/rd_codespell.yaml @@ -24,5 +24,5 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - codespell -q 3 -S ./privacyidea/static/contrib/*,./privacyidea/static/components/translation/*,./privacyidea/translations/*,./po/* . \ + codespell -q 3 -S ./privacyidea/static/contrib/*,translations.js,*.po -L assertIn . \ | reviewdog -efm="%f:%l: %m" -name="codespell" -reporter=github-pr-check -level=warning diff --git a/.github/workflows/rd_misspell.yaml b/.github/workflows/rd_misspell.yaml deleted file mode 100644 index af1f93e220..0000000000 --- a/.github/workflows/rd_misspell.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: reviewdog-misspell -on: [pull_request] -jobs: - reviewdog: - name: reviewdog - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: misspell - uses: reviewdog/action-misspell@v1 - with: - locale: "US" - exclude: | - ./.git/* - ./privacyidea/static/contrib/* - ./privacyidea/static/components/translation/* - ./privacyidea/translations/* - ./po/* diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml deleted file mode 100644 index ea9446dd78..0000000000 --- a/.github/workflows/reviewdog.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: reviewdog -on: [pull_request] -jobs: - misspell: - name: runner / codespell - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: codespell - uses: plettich/action-codespell@master - with: - reporter: github-pr-review - level: info - From e05abdbf426ccc98e01e4d249872925896545fcf Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Mon, 9 Dec 2024 11:21:16 +0100 Subject: [PATCH 4/8] Update codespell action Try to get a warning directly on the PR site --- .codespell_skip | 5 ++--- .github/workflows/rd_codespell.yaml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.codespell_skip b/.codespell_skip index fae947bf85..6e705a3eb7 100644 --- a/.codespell_skip +++ b/.codespell_skip @@ -1,4 +1,3 @@ ./privacyidea/static/contrib/* -./privacyidea/static/components/translation/* -./privacyidea/translations/* -./po/* +./privacyidea/static/components/translation/translations.js +*.po diff --git a/.github/workflows/rd_codespell.yaml b/.github/workflows/rd_codespell.yaml index 1920a3fa01..f33aa3a978 100644 --- a/.github/workflows/rd_codespell.yaml +++ b/.github/workflows/rd_codespell.yaml @@ -24,5 +24,5 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - codespell -q 3 -S ./privacyidea/static/contrib/*,translations.js,*.po -L assertIn . \ + codespell -q 3 -S $(paste -s -d, .codespell_skip) -L assertIn . \ | reviewdog -efm="%f:%l: %m" -name="codespell" -reporter=github-pr-check -level=warning From 3828b7a10b6d0adbd624314c38b832c7f2fd1cd0 Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Tue, 10 Dec 2024 11:01:35 +0100 Subject: [PATCH 5/8] Use local codespell workflow --- .codespell_ignore | 1 + .github/workflows/rd_codespell.yaml | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 21 deletions(-) create mode 100644 .codespell_ignore diff --git a/.codespell_ignore b/.codespell_ignore new file mode 100644 index 0000000000..bf52b4c93a --- /dev/null +++ b/.codespell_ignore @@ -0,0 +1 @@ +assertIn diff --git a/.github/workflows/rd_codespell.yaml b/.github/workflows/rd_codespell.yaml index f33aa3a978..bcbf8b4a8b 100644 --- a/.github/workflows/rd_codespell.yaml +++ b/.github/workflows/rd_codespell.yaml @@ -3,26 +3,13 @@ on: pull_request: jobs: - reviewdog-github-check: - permissions: - checks: write - contents: read - pull-requests: write - name: reviewdog (github-check) + codespell: + name: runner / codespell runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Install codespell - run: | - python -m pip install -U codespell - - - name: Setup reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run reviewdog - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - codespell -q 3 -S $(paste -s -d, .codespell_skip) -L assertIn . \ - | reviewdog -efm="%f:%l: %m" -name="codespell" -reporter=github-pr-check -level=warning + - uses: actions/checkout@v1 + - name: codespell + uses: plettich/action-codespell@master + with: + reporter: github-pr-review + level: info From 53cf2e95ac7110cfa5cdfa0096afde3f5ba8d191 Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Fri, 6 Dec 2024 10:14:39 +0100 Subject: [PATCH 6/8] Codespell reviewdog test --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 3da27beec2..1d470874f9 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ privacyIDEA privacyIDEA is an open solution for strong two-factor authentication like OTP tokens, SMS, smartphones or SSH keys. -Using privacyIDEA you can enhance your existing applications like local login +Using privacyIDEA you can enhance your existing aplications like local login (PAM, Windows Credential Provider), VPN, remote access, SSH connections, access to web sites or web portals with a second factor during authentication. Thus boosting the security of your @@ -62,7 +62,7 @@ stored. This is achieved by its totally modular architecture. privacyIDEA is not only open as far as its modular architecture is concerned. But privacyIDEA is completely licensed under the AGPLv3. -It supports a wide variety of authentication devices like OTP tokens +It suports a wide variety of authentication devices like OTP tokens (HMAC, HOTP, TOTP, OCRA, mOTP), Yubikey (HOTP, TOTP, AES), FIDO U2F, as well as FIDO2 WebAuthn devices like Yubikey and Plug-Up, smartphone Apps like Google Authenticator, FreeOTP, Token2 or TiQR, SMS, Email, SSH keys, x509 certificates @@ -71,10 +71,10 @@ and Registration Codes for easy deployment. privacyIDEA is based on Flask and SQLAlchemy as the python backend. The web UI is based on angularJS and bootstrap. A MachineToken design lets you assign tokens to machines. Thus you can use -your Yubikey to unlock LUKS, assign SSH keys to SSH servers or use Offline OTP +your Yubikey to unlock LUKS, asign SSH keys to SSH servers or use Offline OTP with PAM. -You may join the discourse discussion forum to give feedback, help other users, +You may join the discourse discusion forum to give feedback, help other users, discuss questions and ideas: https://community.privacyidea.org @@ -178,7 +178,7 @@ Code structure The database models are defined in ``models.py`` and tested in tests/test_db_model.py. -Based on the database models there are the libraries ``lib/config.py`` which is +Based on the database models there are the libraries ``lib/config.py`` whch is responsible for basic configuration in the database table ``config``. And the library ``lib/resolver.py`` which provides functions for the database table ``resolver``. This is tested in tests/test_lib_resolver.py. From f05f34675d172b27219c8a80272921ef05746018 Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Fri, 6 Dec 2024 17:03:02 +0100 Subject: [PATCH 7/8] Update codespell test... --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 1d470874f9..d4204077e2 100644 --- a/README.rst +++ b/README.rst @@ -104,6 +104,8 @@ additional dependencies:: You may also want to read the blog post about development and debugging at https://www.privacyidea.org/privacyidea-development-howto/ +And use tests with the `self.assertIn()` function... + Getting and updating submodules =============================== From 2369cf925cf1ca89c2885e2cb405ed8912e7442c Mon Sep 17 00:00:00 2001 From: Paul Lettich Date: Tue, 10 Dec 2024 11:11:05 +0100 Subject: [PATCH 8/8] Fix some errors --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d4204077e2..d05135241c 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ privacyIDEA privacyIDEA is an open solution for strong two-factor authentication like OTP tokens, SMS, smartphones or SSH keys. -Using privacyIDEA you can enhance your existing aplications like local login +Using privacyIDEA you can enhance your existing applications like local login (PAM, Windows Credential Provider), VPN, remote access, SSH connections, access to web sites or web portals with a second factor during authentication. Thus boosting the security of your @@ -62,7 +62,7 @@ stored. This is achieved by its totally modular architecture. privacyIDEA is not only open as far as its modular architecture is concerned. But privacyIDEA is completely licensed under the AGPLv3. -It suports a wide variety of authentication devices like OTP tokens +It supports a wide variety of authentication devices like OTP tokens (HMAC, HOTP, TOTP, OCRA, mOTP), Yubikey (HOTP, TOTP, AES), FIDO U2F, as well as FIDO2 WebAuthn devices like Yubikey and Plug-Up, smartphone Apps like Google Authenticator, FreeOTP, Token2 or TiQR, SMS, Email, SSH keys, x509 certificates