toolframe-auth 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/.github/workflows/ci.yml +5 -4
- toolframe_auth-0.3.0/.github/workflows/quality.yml +63 -0
- toolframe_auth-0.3.0/.pre-commit-config.yaml +29 -0
- toolframe_auth-0.3.0/CONTRIBUTING.md +47 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/PKG-INFO +6 -4
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/README.md +4 -2
- toolframe_auth-0.3.0/cchk.toml +10 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/docs/ci.md +4 -4
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/docs/releasing.md +2 -2
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/pyproject.toml +4 -4
- toolframe_auth-0.3.0/scripts/check_branch_name.py +59 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/scripts/ci.py +6 -6
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/plugin.py +2 -2
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/tests/test_auth.py +3 -3
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/uv.lock +7 -7
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/.github/workflows/publish.yml +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/.gitignore +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/LICENSE +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/NOTICE +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/__init__.py +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/crypto.py +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/identities.py +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/migrations/v1.postgresql.sql +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/migrations/v2.postgresql.sql +0 -0
- {toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/tests/test_identities.py +0 -0
|
@@ -3,6 +3,7 @@ name: Python CI
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
5
|
push:
|
|
6
|
+
branches: [main]
|
|
6
7
|
workflow_dispatch:
|
|
7
8
|
workflow_call:
|
|
8
9
|
inputs:
|
|
@@ -37,7 +38,7 @@ jobs:
|
|
|
37
38
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
38
39
|
with:
|
|
39
40
|
repository: ${{ vars.TOOLFRAME_REPOSITORY_OWNER || github.repository_owner }}/toolframe-sdk
|
|
40
|
-
ref:
|
|
41
|
+
ref: 2cd153ec36c585a9adb5ad566effc2985d9e222d
|
|
41
42
|
path: toolframe-sdk
|
|
42
43
|
token: ${{ secrets.TOOLFRAME_READ_TOKEN || secrets.TOOLFRAME_DEPENDENCIES_TOKEN || github.token }}
|
|
43
44
|
persist-credentials: false
|
|
@@ -45,9 +46,9 @@ jobs:
|
|
|
45
46
|
- name: Check out the pinned SQLite provider
|
|
46
47
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
47
48
|
with:
|
|
48
|
-
repository: ${{ vars.TOOLFRAME_REPOSITORY_OWNER || github.repository_owner }}/toolframe-
|
|
49
|
-
ref:
|
|
50
|
-
path: toolframe-
|
|
49
|
+
repository: ${{ vars.TOOLFRAME_REPOSITORY_OWNER || github.repository_owner }}/toolframe-sql-sqlite
|
|
50
|
+
ref: a2764f83840fb8ad71d7eaf138c7e09799ce19bd
|
|
51
|
+
path: toolframe-sql-sqlite
|
|
51
52
|
token: ${{ secrets.TOOLFRAME_READ_TOKEN || secrets.TOOLFRAME_DEPENDENCIES_TOKEN || github.token }}
|
|
52
53
|
persist-credentials: false
|
|
53
54
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Code quality
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
types: [opened, synchronize, reopened, edited]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
branch-policy:
|
|
15
|
+
runs-on: ubuntu-24.04
|
|
16
|
+
timeout-minutes: 5
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
|
+
with:
|
|
20
|
+
persist-credentials: false
|
|
21
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.14.7'
|
|
24
|
+
- name: Check the actual source branch
|
|
25
|
+
env:
|
|
26
|
+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
27
|
+
run: python scripts/check_branch_name.py "$BRANCH_NAME"
|
|
28
|
+
|
|
29
|
+
code-quality:
|
|
30
|
+
runs-on: ubuntu-24.04
|
|
31
|
+
timeout-minutes: 10
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
34
|
+
with:
|
|
35
|
+
persist-credentials: false
|
|
36
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
37
|
+
with:
|
|
38
|
+
version: '0.12.8'
|
|
39
|
+
enable-cache: false
|
|
40
|
+
- name: Check Python lint and formatting
|
|
41
|
+
run: uvx prek==0.5.5 run ruff-check ruff-format --all-files --show-diff-on-failure
|
|
42
|
+
|
|
43
|
+
commit-policy:
|
|
44
|
+
if: github.event_name == 'pull_request'
|
|
45
|
+
runs-on: ubuntu-24.04
|
|
46
|
+
timeout-minutes: 10
|
|
47
|
+
permissions:
|
|
48
|
+
contents: read
|
|
49
|
+
pull-requests: read
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
52
|
+
with:
|
|
53
|
+
fetch-depth: 0
|
|
54
|
+
persist-credentials: false
|
|
55
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
56
|
+
with:
|
|
57
|
+
python-version: '3.14.7'
|
|
58
|
+
- uses: commit-check/commit-check-action@a61779784a953fd9047c001c102cfeac5cf26964 # commit-check 2.18.3
|
|
59
|
+
with:
|
|
60
|
+
message: true
|
|
61
|
+
branch: false
|
|
62
|
+
pr-title: true
|
|
63
|
+
pr-comments: false
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
default_install_hook_types: [pre-commit, commit-msg]
|
|
2
|
+
default_stages: [pre-commit]
|
|
3
|
+
default_language_version:
|
|
4
|
+
python: python3.11
|
|
5
|
+
|
|
6
|
+
repos:
|
|
7
|
+
- repo: local
|
|
8
|
+
hooks:
|
|
9
|
+
- id: check-branch-name
|
|
10
|
+
name: Check branch naming policy
|
|
11
|
+
entry: python scripts/check_branch_name.py
|
|
12
|
+
language: python
|
|
13
|
+
always_run: true
|
|
14
|
+
pass_filenames: false
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.16.8
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff-check
|
|
19
|
+
types_or: [python, pyi]
|
|
20
|
+
files: '^(src|tests|scripts)/'
|
|
21
|
+
- id: ruff-format
|
|
22
|
+
types_or: [python, pyi]
|
|
23
|
+
args: [--check]
|
|
24
|
+
files: '^(src|tests|scripts)/'
|
|
25
|
+
- repo: https://github.com/commit-check/commit-check
|
|
26
|
+
rev: v2.18.3
|
|
27
|
+
hooks:
|
|
28
|
+
- id: check-message
|
|
29
|
+
stages: [commit-msg]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Commit hooks
|
|
4
|
+
|
|
5
|
+
Install [prek](https://prek.j178.dev/) and enable the repository's hooks:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
uv tool install prek==0.5.5
|
|
9
|
+
prek install --allow-missing-config
|
|
10
|
+
prek run --all-files
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The missing-config option allows older worktrees without this configuration to
|
|
14
|
+
keep working. Worktrees containing `.pre-commit-config.yaml` still run the checks.
|
|
15
|
+
The `pre-commit` hook checks the branch name, Python lint, and formatting. The
|
|
16
|
+
`commit-msg` hook checks Conventional Commits. Both Ruff hooks only check files;
|
|
17
|
+
they do not rewrite a commit's contents. Fix lint and formatting explicitly:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
uvx ruff==0.16.8 check --fix src tests scripts
|
|
21
|
+
uvx ruff==0.16.8 format src tests scripts
|
|
22
|
+
prek run --all-files
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The Ruff version and checked paths are pinned in
|
|
26
|
+
[the hook configuration](.pre-commit-config.yaml); the Python rules remain in
|
|
27
|
+
[pyproject.toml](pyproject.toml). CI uses these same hooks on all tracked files
|
|
28
|
+
within their configured paths. Existing package, integration, and release checks
|
|
29
|
+
run independently.
|
|
30
|
+
|
|
31
|
+
## Branches and commits
|
|
32
|
+
|
|
33
|
+
[cchk.toml](cchk.toml) defines the allowed branch and commit types. Work branches
|
|
34
|
+
use `feat/`, `fix/`, `release/`, or `chore/`, followed by lowercase ASCII letters
|
|
35
|
+
and digits separated by single hyphens. Release versions may also contain dots,
|
|
36
|
+
as in `release/v1.2.0-rc.1`; every separator must have an alphanumeric character on
|
|
37
|
+
both sides. The default branch `main` is the standalone exception.
|
|
38
|
+
|
|
39
|
+
Commit types are independent of branch types: for example,
|
|
40
|
+
`docs: clarify setup` is valid on `chore/update-docs`. Commit-check uses Conventional
|
|
41
|
+
Commits with its default subject length of 5–80 characters. Pull requests check
|
|
42
|
+
their commits and title so the title can be used for a Conventional Commit when
|
|
43
|
+
squash merging.
|
|
44
|
+
|
|
45
|
+
Local hooks can be bypassed. CI reports `branch-policy`, `code-quality`, and
|
|
46
|
+
`commit-policy`; maintainers must configure required status checks separately to
|
|
47
|
+
make passing checks a merge requirement.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: toolframe-auth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Managed access passwords and sessions for Toolframe
|
|
5
5
|
Project-URL: Homepage, https://github.com/toolframe/toolframe-auth
|
|
6
6
|
Project-URL: Repository, https://github.com/toolframe/toolframe-auth
|
|
@@ -11,21 +11,21 @@ License-Expression: Apache-2.0
|
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
License-File: NOTICE
|
|
13
13
|
Requires-Python: >=3.14
|
|
14
|
-
Requires-Dist: toolframe-sdk==0.
|
|
14
|
+
Requires-Dist: toolframe-sdk==0.4.0
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
|
|
17
17
|
# Toolframe Auth
|
|
18
18
|
|
|
19
19
|
Authentication and grant decisions for access passwords, federated users and
|
|
20
20
|
revocable agent delegation. This provider owns `auth`'s managed SQL store; it never opens
|
|
21
|
-
database files itself. It requires SDK 0.
|
|
21
|
+
database files itself. It requires SDK 0.4.0 and `toolframe.sql`.
|
|
22
22
|
|
|
23
23
|
## Install
|
|
24
24
|
|
|
25
25
|
With a running Toolframe application and an active SQL storage provider:
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
toolframe --home APP plugin add pypi:toolframe-auth==0.
|
|
28
|
+
toolframe --home APP plugin add pypi:toolframe-auth==0.3.0 --enable
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
The [Entry Register template](https://github.com/toolframe/toolframe-core#readme)
|
|
@@ -127,3 +127,5 @@ unchanged SQLite history. Provision this plugin’s stable store owner with the
|
|
|
127
127
|
PostgreSQL provider before enabling it. The application still runs one Core;
|
|
128
128
|
retain its private keys and configuration with the application home. Existing
|
|
129
129
|
SQLite records are not imported automatically.
|
|
130
|
+
|
|
131
|
+
For development hooks and contribution rules, see [Contributing](CONTRIBUTING.md).
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Authentication and grant decisions for access passwords, federated users and
|
|
4
4
|
revocable agent delegation. This provider owns `auth`'s managed SQL store; it never opens
|
|
5
|
-
database files itself. It requires SDK 0.
|
|
5
|
+
database files itself. It requires SDK 0.4.0 and `toolframe.sql`.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
With a running Toolframe application and an active SQL storage provider:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
toolframe --home APP plugin add pypi:toolframe-auth==0.
|
|
12
|
+
toolframe --home APP plugin add pypi:toolframe-auth==0.3.0 --enable
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The [Entry Register template](https://github.com/toolframe/toolframe-core#readme)
|
|
@@ -111,3 +111,5 @@ unchanged SQLite history. Provision this plugin’s stable store owner with the
|
|
|
111
111
|
PostgreSQL provider before enabling it. The application still runs one Core;
|
|
112
112
|
retain its private keys and configuration with the application home. Existing
|
|
113
113
|
SQLite records are not imported automatically.
|
|
114
|
+
|
|
115
|
+
For development hooks and contribution rules, see [Contributing](CONTRIBUTING.md).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[commit]
|
|
2
|
+
conventional_commits = true
|
|
3
|
+
allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf", "build", "ci"]
|
|
4
|
+
|
|
5
|
+
[branch]
|
|
6
|
+
conventional_branch = true
|
|
7
|
+
allow_branch_types = ["feat", "fix", "release", "chore"]
|
|
8
|
+
allow_branch_names = ["main"]
|
|
9
|
+
# scripts/check_branch_name.py enforces these names literally, without the
|
|
10
|
+
# additional standalone branch exceptions built into commit-check.
|
|
@@ -14,8 +14,8 @@ never used or modified.
|
|
|
14
14
|
|
|
15
15
|
| Repository | Required commit |
|
|
16
16
|
| --- | --- |
|
|
17
|
-
| `toolframe-sdk` | `
|
|
18
|
-
| `toolframe-
|
|
17
|
+
| `toolframe-sdk` | `2cd153ec36c585a9adb5ad566effc2985d9e222d` |
|
|
18
|
+
| `toolframe-sql-sqlite` | `a2764f83840fb8ad71d7eaf138c7e09799ce19bd` |
|
|
19
19
|
|
|
20
20
|
By default, both repositories are siblings of this checkout. Use `--sdk-repo`
|
|
21
21
|
and `--storage-repo` to point to other local clones. Internet access is required
|
|
@@ -51,8 +51,8 @@ uses editable installs or `--no-deps`.
|
|
|
51
51
|
|
|
52
52
|
## GitHub Actions
|
|
53
53
|
|
|
54
|
-
`ci.yml` runs for pushes
|
|
55
|
-
publish workflow. It runs the local script on `ubuntu-24.04`, Python 3.14.7 and
|
|
54
|
+
`ci.yml` runs for pushes to `main`, pull requests, manual dispatch and calls from
|
|
55
|
+
the publish workflow. It runs the local script on `ubuntu-24.04`, Python 3.14.7 and
|
|
56
56
|
uv 0.12.8, then stores `toolframe-auth-dist` for seven days. Validation has a
|
|
57
57
|
20-minute timeout and read-only `contents` permission. Action versions are
|
|
58
58
|
pinned to full commit SHAs. The reusable workflow has no concurrency group that
|
|
@@ -10,7 +10,7 @@ artifacts produced by that successful run.
|
|
|
10
10
|
Run the repository's existing validation workflow; its local commands and
|
|
11
11
|
integration coverage are described in [CI](ci.md).
|
|
12
12
|
|
|
13
|
-
Publish `toolframe-sdk==0.
|
|
13
|
+
Publish `toolframe-sdk==0.4.0` first. The coordinated order and native CLI channels are documented in
|
|
14
14
|
[Toolframe's release guide](https://github.com/toolframe/toolframe-core/blob/main/docs/releasing.md).
|
|
15
15
|
|
|
16
16
|
## Trusted Publishers
|
|
@@ -49,7 +49,7 @@ After PyPI publication, verify a clean installation:
|
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
51
|
uv venv --python 3.14.7 build/consumer
|
|
52
|
-
uv pip install --python build/consumer/bin/python 'toolframe-auth==0.
|
|
52
|
+
uv pip install --python build/consumer/bin/python 'toolframe-auth==0.3.0'
|
|
53
53
|
uv pip check --python build/consumer/bin/python
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "toolframe-auth"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "Managed access passwords and sessions for Toolframe"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
11
11
|
license-files = ["LICENSE", "NOTICE"]
|
|
12
12
|
authors = [{ name = "byfb", email = "62798989+byfb@users.noreply.github.com" }]
|
|
13
13
|
requires-python = ">=3.14"
|
|
14
|
-
dependencies = ["toolframe-sdk==0.
|
|
14
|
+
dependencies = ["toolframe-sdk==0.4.0"]
|
|
15
15
|
|
|
16
16
|
[project.urls]
|
|
17
17
|
Homepage = "https://github.com/toolframe/toolframe-auth"
|
|
@@ -23,11 +23,11 @@ Issues = "https://github.com/toolframe/toolframe-auth/issues"
|
|
|
23
23
|
auth = "toolframe_auth.plugin:plugin"
|
|
24
24
|
|
|
25
25
|
[dependency-groups]
|
|
26
|
-
dev = ["pytest>=8,<10", "pytest-asyncio>=1,<2", "ruff>=0.12,<1", "toolframe-
|
|
26
|
+
dev = ["pytest>=8,<10", "pytest-asyncio>=1,<2", "ruff>=0.12,<1", "toolframe-sql-sqlite==0.4.0"]
|
|
27
27
|
|
|
28
28
|
[tool.uv.sources]
|
|
29
29
|
toolframe-sdk = { path = "../toolframe-sdk", editable = true }
|
|
30
|
-
toolframe-
|
|
30
|
+
toolframe-sql-sqlite = { path = "../toolframe-sql-sqlite", editable = true }
|
|
31
31
|
|
|
32
32
|
[tool.pytest.ini_options]
|
|
33
33
|
testpaths = ["tests"]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Validate a working branch using the repository's cchk.toml policy."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import re
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
import tomllib
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def main() -> int:
|
|
12
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
13
|
+
parser.add_argument("branch", nargs="?", help="actual source branch in CI")
|
|
14
|
+
args = parser.parse_args()
|
|
15
|
+
root = Path(__file__).resolve().parent.parent
|
|
16
|
+
policy = tomllib.loads((root / "cchk.toml").read_text())["branch"]
|
|
17
|
+
branch = args.branch
|
|
18
|
+
if branch is None:
|
|
19
|
+
result = subprocess.run(
|
|
20
|
+
["git", "symbolic-ref", "--quiet", "--short", "HEAD"],
|
|
21
|
+
cwd=root,
|
|
22
|
+
capture_output=True,
|
|
23
|
+
text=True,
|
|
24
|
+
check=False,
|
|
25
|
+
)
|
|
26
|
+
if result.returncode:
|
|
27
|
+
print(
|
|
28
|
+
"Pass the actual source branch when HEAD is detached.", file=sys.stderr
|
|
29
|
+
)
|
|
30
|
+
return 1
|
|
31
|
+
branch = result.stdout.strip()
|
|
32
|
+
|
|
33
|
+
if branch in policy["allow_branch_names"]:
|
|
34
|
+
return 0
|
|
35
|
+
prefix, separator, description = branch.partition("/")
|
|
36
|
+
pattern = (
|
|
37
|
+
r"[a-z0-9]+(?:[.-][a-z0-9]+)*"
|
|
38
|
+
if prefix == "release"
|
|
39
|
+
else r"[a-z0-9]+(?:-[a-z0-9]+)*"
|
|
40
|
+
)
|
|
41
|
+
if (
|
|
42
|
+
separator
|
|
43
|
+
and prefix in policy["allow_branch_types"]
|
|
44
|
+
and re.fullmatch(pattern, description)
|
|
45
|
+
):
|
|
46
|
+
return 0
|
|
47
|
+
|
|
48
|
+
allowed = ", ".join(policy["allow_branch_types"])
|
|
49
|
+
print(
|
|
50
|
+
f"Invalid branch {branch!r}. Use <type>/<description> with type: {allowed}. "
|
|
51
|
+
"Use lowercase letters and digits separated by single hyphens; "
|
|
52
|
+
"release versions may also contain dots.",
|
|
53
|
+
file=sys.stderr,
|
|
54
|
+
)
|
|
55
|
+
return 1
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if __name__ == "__main__":
|
|
59
|
+
raise SystemExit(main())
|
|
@@ -16,8 +16,8 @@ from pathlib import Path
|
|
|
16
16
|
|
|
17
17
|
ROOT = Path(__file__).resolve().parents[1]
|
|
18
18
|
DEPENDENCIES = {
|
|
19
|
-
"toolframe-sdk": "
|
|
20
|
-
"toolframe-
|
|
19
|
+
"toolframe-sdk": "2cd153ec36c585a9adb5ad566effc2985d9e222d",
|
|
20
|
+
"toolframe-sql-sqlite": "a2764f83840fb8ad71d7eaf138c7e09799ce19bd",
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
@@ -57,7 +57,7 @@ def main():
|
|
|
57
57
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
58
58
|
parser.add_argument("--sdk-repo", type=Path, default=ROOT.parent / "toolframe-sdk")
|
|
59
59
|
parser.add_argument(
|
|
60
|
-
"--storage-repo", type=Path, default=ROOT.parent / "toolframe-
|
|
60
|
+
"--storage-repo", type=Path, default=ROOT.parent / "toolframe-sql-sqlite"
|
|
61
61
|
)
|
|
62
62
|
parser.add_argument(
|
|
63
63
|
"--output", type=Path, help="Empty directory for validated artifacts"
|
|
@@ -110,7 +110,7 @@ def main():
|
|
|
110
110
|
wheelhouse = workspace / "dependency-wheels"
|
|
111
111
|
for name, repository in (
|
|
112
112
|
("toolframe-sdk", args.sdk_repo),
|
|
113
|
-
("toolframe-
|
|
113
|
+
("toolframe-sql-sqlite", args.storage_repo),
|
|
114
114
|
):
|
|
115
115
|
destination = workspace / name
|
|
116
116
|
destination.mkdir()
|
|
@@ -229,11 +229,11 @@ from toolframe_auth.crypto import new_verifier, verifier
|
|
|
229
229
|
location = pathlib.Path(toolframe_auth.__file__).resolve()
|
|
230
230
|
assert location.is_relative_to(pathlib.Path(sys.prefix).resolve())
|
|
231
231
|
assert metadata.version("toolframe-auth") == sys.argv[1]
|
|
232
|
-
assert metadata.version("toolframe-sdk") == "0.
|
|
232
|
+
assert metadata.version("toolframe-sdk") == "0.4.0"
|
|
233
233
|
entry_point, = metadata.distribution("toolframe-auth").entry_points
|
|
234
234
|
assert entry_point.group == "toolframe.plugins" and entry_point.name == "auth"
|
|
235
235
|
assert entry_point.load() is plugin
|
|
236
|
-
assert importlib.util.find_spec("
|
|
236
|
+
assert importlib.util.find_spec("toolframe_sql_sqlite") is None
|
|
237
237
|
assert importlib.util.find_spec("pytest") is None
|
|
238
238
|
salt, hashed = new_verifier("smoke-password")
|
|
239
239
|
assert verifier("smoke-password", salt) == hashed
|
|
@@ -99,7 +99,7 @@ class AuthProvider(Plugin):
|
|
|
99
99
|
super().__init__(context)
|
|
100
100
|
self.lock = asyncio.Lock()
|
|
101
101
|
self.key = None
|
|
102
|
-
self.store = context.
|
|
102
|
+
self.store = context.sql()
|
|
103
103
|
self.idle = context.config.get("session_idle_seconds", 86400)
|
|
104
104
|
self.lifetime = context.config.get("session_max_seconds", 604800)
|
|
105
105
|
self.pending_hashes = 0
|
|
@@ -413,7 +413,7 @@ plugin = PluginDefinition(
|
|
|
413
413
|
factory="toolframe_auth.plugin:AuthProvider",
|
|
414
414
|
authorization=AuthorizationSpec(),
|
|
415
415
|
private_secrets=("password-lookup",),
|
|
416
|
-
requires={"
|
|
416
|
+
requires={"sql": Requirement(service="toolframe.sql")},
|
|
417
417
|
services={
|
|
418
418
|
SERVICE: ServiceSpec(
|
|
419
419
|
methods={
|
|
@@ -7,7 +7,7 @@ from contextlib import contextmanager
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
from toolframe_sdk import PluginError, Principal, RuntimeContext, call_context
|
|
10
|
-
from
|
|
10
|
+
from toolframe_sql_sqlite.plugin import ADMIN_SERVICE, SQL_SERVICE, SqliteProvider
|
|
11
11
|
|
|
12
12
|
from toolframe_auth.crypto import lookup, new_verifier
|
|
13
13
|
from toolframe_auth.plugin import SERVICE, AuthProvider, plugin
|
|
@@ -43,7 +43,7 @@ class StoragePeer:
|
|
|
43
43
|
self.provider = provider
|
|
44
44
|
|
|
45
45
|
async def request(self, method, params, timeout=None):
|
|
46
|
-
assert method == "service.call" and params["alias"] == "
|
|
46
|
+
assert method == "service.call" and params["alias"] == "sql"
|
|
47
47
|
token = call_context.set(
|
|
48
48
|
{
|
|
49
49
|
"application_id": "test",
|
|
@@ -65,7 +65,7 @@ class StoragePeer:
|
|
|
65
65
|
async def auth(tmp_path):
|
|
66
66
|
storage = SqliteProvider(
|
|
67
67
|
RuntimeContext(
|
|
68
|
-
None, plugin_id="
|
|
68
|
+
None, plugin_id="sql-sqlite", generation="one", state_directory=tmp_path
|
|
69
69
|
)
|
|
70
70
|
)
|
|
71
71
|
await storage.activate()
|
|
@@ -282,7 +282,7 @@ wheels = [
|
|
|
282
282
|
|
|
283
283
|
[[package]]
|
|
284
284
|
name = "toolframe-auth"
|
|
285
|
-
version = "0.
|
|
285
|
+
version = "0.3.0"
|
|
286
286
|
source = { editable = "." }
|
|
287
287
|
dependencies = [
|
|
288
288
|
{ name = "toolframe-sdk" },
|
|
@@ -293,7 +293,7 @@ dev = [
|
|
|
293
293
|
{ name = "pytest" },
|
|
294
294
|
{ name = "pytest-asyncio" },
|
|
295
295
|
{ name = "ruff" },
|
|
296
|
-
{ name = "toolframe-
|
|
296
|
+
{ name = "toolframe-sql-sqlite" },
|
|
297
297
|
]
|
|
298
298
|
|
|
299
299
|
[package.metadata]
|
|
@@ -304,12 +304,12 @@ dev = [
|
|
|
304
304
|
{ name = "pytest", specifier = ">=8,<10" },
|
|
305
305
|
{ name = "pytest-asyncio", specifier = ">=1,<2" },
|
|
306
306
|
{ name = "ruff", specifier = ">=0.12,<1" },
|
|
307
|
-
{ name = "toolframe-
|
|
307
|
+
{ name = "toolframe-sql-sqlite", editable = "../toolframe-sql-sqlite" },
|
|
308
308
|
]
|
|
309
309
|
|
|
310
310
|
[[package]]
|
|
311
311
|
name = "toolframe-sdk"
|
|
312
|
-
version = "0.
|
|
312
|
+
version = "0.4.0"
|
|
313
313
|
source = { editable = "../toolframe-sdk" }
|
|
314
314
|
dependencies = [
|
|
315
315
|
{ name = "jsonschema" },
|
|
@@ -335,9 +335,9 @@ dev = [
|
|
|
335
335
|
]
|
|
336
336
|
|
|
337
337
|
[[package]]
|
|
338
|
-
name = "toolframe-
|
|
339
|
-
version = "0.
|
|
340
|
-
source = { editable = "../toolframe-
|
|
338
|
+
name = "toolframe-sql-sqlite"
|
|
339
|
+
version = "0.4.0"
|
|
340
|
+
source = { editable = "../toolframe-sql-sqlite" }
|
|
341
341
|
dependencies = [
|
|
342
342
|
{ name = "toolframe-sdk" },
|
|
343
343
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/migrations/v1.postgresql.sql
RENAMED
|
File without changes
|
{toolframe_auth-0.2.0 → toolframe_auth-0.3.0}/src/toolframe_auth/migrations/v2.postgresql.sql
RENAMED
|
File without changes
|
|
File without changes
|