toolframe-auth 0.2.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.
@@ -0,0 +1,79 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ workflow_dispatch:
7
+ workflow_call:
8
+ inputs:
9
+ release-ref:
10
+ description: Require this ref to match the package version before validation
11
+ type: string
12
+ default: ""
13
+ secrets:
14
+ TOOLFRAME_READ_TOKEN:
15
+ description: Optional read-only token for private sibling repositories
16
+ required: false
17
+ TOOLFRAME_DEPENDENCIES_TOKEN:
18
+ description: Optional read-only token for private sibling repositories
19
+ required: false
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ validate:
26
+ runs-on: ubuntu-24.04
27
+ timeout-minutes: 20
28
+ steps:
29
+ - name: Check out the revision being validated
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ ref: ${{ github.sha }}
33
+ path: toolframe-auth
34
+ persist-credentials: false
35
+
36
+ - name: Check out the pinned SDK
37
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
38
+ with:
39
+ repository: ${{ vars.TOOLFRAME_REPOSITORY_OWNER || github.repository_owner }}/toolframe-sdk
40
+ ref: ef91b609137a5fe7bae8e0c893e74b096ff06ffe
41
+ path: toolframe-sdk
42
+ token: ${{ secrets.TOOLFRAME_READ_TOKEN || secrets.TOOLFRAME_DEPENDENCIES_TOKEN || github.token }}
43
+ persist-credentials: false
44
+
45
+ - name: Check out the pinned SQLite provider
46
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
47
+ with:
48
+ repository: ${{ vars.TOOLFRAME_REPOSITORY_OWNER || github.repository_owner }}/toolframe-storage-sqlite
49
+ ref: 67c3b0ac4365db81c6c866083330c6405f299dfd
50
+ path: toolframe-storage-sqlite
51
+ token: ${{ secrets.TOOLFRAME_READ_TOKEN || secrets.TOOLFRAME_DEPENDENCIES_TOKEN || github.token }}
52
+ persist-credentials: false
53
+
54
+ - name: Set up Python
55
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
56
+ with:
57
+ python-version: "3.14.7"
58
+
59
+ - name: Set up uv
60
+ uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
61
+ with:
62
+ version: "0.12.8"
63
+ enable-cache: false
64
+
65
+ - name: Lint, test, build and install the distributions
66
+ working-directory: toolframe-auth
67
+ env:
68
+ RELEASE_REF: ${{ inputs.release-ref || '' }}
69
+ run: python scripts/ci.py --release-ref "$RELEASE_REF" --output "$RUNNER_TEMP/auth-dist"
70
+
71
+ - name: Save validated distributions
72
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
73
+ with:
74
+ name: toolframe-auth-dist
75
+ path: |
76
+ ${{ runner.temp }}/auth-dist/*.whl
77
+ ${{ runner.temp }}/auth-dist/*.tar.gz
78
+ if-no-files-found: error
79
+ retention-days: 7
@@ -0,0 +1,55 @@
1
+ name: Publish Python package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ repository:
7
+ description: Package index (run this workflow on a v<project.version> tag)
8
+ type: choice
9
+ options:
10
+ - testpypi
11
+ - pypi
12
+ default: testpypi
13
+ required: true
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ concurrency:
19
+ group: publish-${{ github.repository }}-${{ github.ref }}-${{ inputs.repository }}
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ validate:
24
+ uses: ./.github/workflows/ci.yml
25
+ secrets: inherit
26
+ with:
27
+ release-ref: ${{ github.ref }}
28
+
29
+ publish:
30
+ needs: validate
31
+ runs-on: ubuntu-24.04
32
+ timeout-minutes: 10
33
+ environment:
34
+ name: ${{ inputs.repository }}
35
+ permissions:
36
+ id-token: write
37
+ steps:
38
+ - name: Download the distributions from this run
39
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
40
+ with:
41
+ name: toolframe-auth-dist
42
+ path: dist
43
+
44
+ - name: Publish to TestPyPI
45
+ if: inputs.repository == 'testpypi'
46
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
47
+ with:
48
+ repository-url: https://test.pypi.org/legacy/
49
+ packages-dir: dist/
50
+
51
+ - name: Publish to PyPI
52
+ if: inputs.repository == 'pypi'
53
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
54
+ with:
55
+ packages-dir: dist/
@@ -0,0 +1,13 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ dist/
6
+ /build/
7
+ /.coverage
8
+ /htmlcov/
9
+
10
+ # Local working documents, issue state, and development worktrees.
11
+ /.local/
12
+ /.issues/
13
+ /.worktrees/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ toolframe-auth
2
+ Copyright 2026 byfb
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.5
2
+ Name: toolframe-auth
3
+ Version: 0.2.0
4
+ Summary: Managed access passwords and sessions for Toolframe
5
+ Project-URL: Homepage, https://github.com/toolframe/toolframe-auth
6
+ Project-URL: Repository, https://github.com/toolframe/toolframe-auth
7
+ Project-URL: Documentation, https://github.com/toolframe/toolframe-auth#readme
8
+ Project-URL: Issues, https://github.com/toolframe/toolframe-auth/issues
9
+ Author-email: byfb <62798989+byfb@users.noreply.github.com>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Requires-Python: >=3.14
14
+ Requires-Dist: toolframe-sdk==0.3.0
15
+ Description-Content-Type: text/markdown
16
+
17
+ # Toolframe Auth
18
+
19
+ Authentication and grant decisions for access passwords, federated users and
20
+ revocable agent delegation. This provider owns `auth`'s managed SQL store; it never opens
21
+ database files itself. It requires SDK 0.3.0 and `toolframe.storage.sql`.
22
+
23
+ ## Install
24
+
25
+ With a running Toolframe application and an active SQL storage provider:
26
+
27
+ ```sh
28
+ toolframe --home APP plugin add pypi:toolframe-auth==0.2.0 --enable
29
+ ```
30
+
31
+ The [Entry Register template](https://github.com/toolframe/toolframe-core#readme)
32
+ includes Auth and Dashboard Auth. The host resolves the SDK and the plugin's
33
+ isolated environment automatically.
34
+
35
+ Core supplies the private `password-lookup` key separately from configuration.
36
+ Credential records store a keyed HMAC-SHA256 lookup plus a per-record salted
37
+ scrypt verifier (`N=131072`, `r=8`, `p=1`, 32-byte output). At most two hashes run
38
+ concurrently. Core also limits login attempts. Sessions use random opaque tokens;
39
+ only SHA-256 digests of those high-entropy tokens are persisted. Metadata/list
40
+ responses exclude lookup values, salts and verifiers.
41
+
42
+ The internal `toolframe.auth` service implements login, resolve/touch, logout,
43
+ create/list/update/revoke. Core admits administrators and passes their trusted
44
+ principal/catalog. These methods are not directly published business APIs.
45
+ `toolframe-dashboard-auth` supplies presentation through core's protected API.
46
+
47
+ New passwords accept 8–32 characters; omitted passwords generate a random
48
+ 32-character secret. Existing longer passwords issued by 0.1.0 can still log in.
49
+ The password-length policy preserves existing password records and sessions.
50
+
51
+ ## Federated users and agent grants
52
+
53
+ Enable `toolframe-oidc-auth` for OIDC login. Auth remains the local identity and
54
+ permission authority; it does not implement provider discovery or OAuth endpoints.
55
+ Configure the trusted plugin ID with `identity_provider` (default `oidc-auth`) and
56
+ initial admission with exact `federated_identities` entries:
57
+
58
+ ```toml
59
+ [plugins.auth.config]
60
+ identity_provider = "oidc-auth"
61
+ federated_identities = [
62
+ { issuer = "https://accounts.google.com", subject = "VERIFIED_SUB", label = "Alice", scopes = ["notes.read"] },
63
+ ]
64
+ ```
65
+
66
+ The trusted plugin must supply verified issuer/subject claims. No email matching
67
+ or automatic account merging occurs. The admission entry creates a local user
68
+ once; later permission/disablement changes use the protected user-management API.
69
+ Changing admission configuration does not overwrite existing users. Every user
70
+ gets `system.auth.self`; `system.auth.users` permits bounded administration.
71
+
72
+ The internal service additionally implements `federated_login`, `users`,
73
+ `user_update`, `grant_create`, `grant_check`, `grants` and `revoke_grant`.
74
+ Core verifies administrative/self-service callers; only the configured identity
75
+ provider may admit external identities or issue/check delegated grants.
76
+ Agent grants include user, issuer, client, resource, explicit business scopes and
77
+ expiry. Grant checks intersect current user permissions. Revocation does not end
78
+ the browser session; disabling a user invalidates sessions and revokes all their
79
+ agent grants. Password and MCP-key credentials retain their independent behavior.
80
+
81
+ This feature introduces additive **store revision v2**. Existing v1 stores require
82
+ Core's explicit `migrate plan auth` / `migrate apply auth --plan-id ...` workflow
83
+ after staging a compatible Auth build. Back up the store and retained secrets
84
+ first. The migration leaves existing password/session tables intact.
85
+
86
+ Active secret uniqueness is transactional. Expired/revoked secrets can be reused
87
+ in a new record with a new grant; old sessions remain tied to the old record.
88
+ Revoked records cannot be restored. Editing a grant invalidates its sessions.
89
+ Delegation is limited by the administrator's own scopes, dynamic-business selector
90
+ and expiry. Issued grants do not inherit a revocation dependency on their creator.
91
+
92
+ Configuration: `session_max_seconds` defaults to 604800; `session_idle_seconds`
93
+ defaults to 86400. Password expiry caps both. Successful logins and authorized
94
+ functional activity update usage; polling and denied attempts do not.
95
+
96
+ Back up the consistent auth SQLite store and retained private key together. A
97
+ missing key with an existing store is a recovery error, not a reason to regenerate
98
+ the key. Removing/reloading the plugin retains both. Runtime validation uses
99
+ temporary storage and secrets.
100
+
101
+ ```sh
102
+ uv sync
103
+ uv run pytest -q
104
+ uv run ruff check src tests
105
+ uv build --wheel
106
+ ```
107
+
108
+ For the same isolated lint, tests, distribution and wheel-install checks used by
109
+ GitHub Actions, run `python3.14 scripts/ci.py`. See [CI and publishing](docs/ci.md)
110
+ for pinned sibling sources, local requirements and TestPyPI/PyPI setup.
111
+
112
+ Core owns access policy. Its compatible OIDC integration supports
113
+ `access.failure_mode = "closed"` for protected deployments; the default preserves
114
+ legacy public business fallback. MCP, llms and explicitly public business APIs
115
+ have independent policies.
116
+
117
+ For release validation and Trusted Publisher setup, see [releasing](docs/releasing.md).
118
+
119
+ ## License
120
+
121
+ Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
122
+
123
+ ## PostgreSQL storage
124
+
125
+ Version 0.2 requires SDK 0.3 and declares PostgreSQL migration SQL alongside the
126
+ unchanged SQLite history. Provision this plugin’s stable store owner with the
127
+ PostgreSQL provider before enabling it. The application still runs one Core;
128
+ retain its private keys and configuration with the application home. Existing
129
+ SQLite records are not imported automatically.
@@ -0,0 +1,113 @@
1
+ # Toolframe Auth
2
+
3
+ Authentication and grant decisions for access passwords, federated users and
4
+ revocable agent delegation. This provider owns `auth`'s managed SQL store; it never opens
5
+ database files itself. It requires SDK 0.3.0 and `toolframe.storage.sql`.
6
+
7
+ ## Install
8
+
9
+ With a running Toolframe application and an active SQL storage provider:
10
+
11
+ ```sh
12
+ toolframe --home APP plugin add pypi:toolframe-auth==0.2.0 --enable
13
+ ```
14
+
15
+ The [Entry Register template](https://github.com/toolframe/toolframe-core#readme)
16
+ includes Auth and Dashboard Auth. The host resolves the SDK and the plugin's
17
+ isolated environment automatically.
18
+
19
+ Core supplies the private `password-lookup` key separately from configuration.
20
+ Credential records store a keyed HMAC-SHA256 lookup plus a per-record salted
21
+ scrypt verifier (`N=131072`, `r=8`, `p=1`, 32-byte output). At most two hashes run
22
+ concurrently. Core also limits login attempts. Sessions use random opaque tokens;
23
+ only SHA-256 digests of those high-entropy tokens are persisted. Metadata/list
24
+ responses exclude lookup values, salts and verifiers.
25
+
26
+ The internal `toolframe.auth` service implements login, resolve/touch, logout,
27
+ create/list/update/revoke. Core admits administrators and passes their trusted
28
+ principal/catalog. These methods are not directly published business APIs.
29
+ `toolframe-dashboard-auth` supplies presentation through core's protected API.
30
+
31
+ New passwords accept 8–32 characters; omitted passwords generate a random
32
+ 32-character secret. Existing longer passwords issued by 0.1.0 can still log in.
33
+ The password-length policy preserves existing password records and sessions.
34
+
35
+ ## Federated users and agent grants
36
+
37
+ Enable `toolframe-oidc-auth` for OIDC login. Auth remains the local identity and
38
+ permission authority; it does not implement provider discovery or OAuth endpoints.
39
+ Configure the trusted plugin ID with `identity_provider` (default `oidc-auth`) and
40
+ initial admission with exact `federated_identities` entries:
41
+
42
+ ```toml
43
+ [plugins.auth.config]
44
+ identity_provider = "oidc-auth"
45
+ federated_identities = [
46
+ { issuer = "https://accounts.google.com", subject = "VERIFIED_SUB", label = "Alice", scopes = ["notes.read"] },
47
+ ]
48
+ ```
49
+
50
+ The trusted plugin must supply verified issuer/subject claims. No email matching
51
+ or automatic account merging occurs. The admission entry creates a local user
52
+ once; later permission/disablement changes use the protected user-management API.
53
+ Changing admission configuration does not overwrite existing users. Every user
54
+ gets `system.auth.self`; `system.auth.users` permits bounded administration.
55
+
56
+ The internal service additionally implements `federated_login`, `users`,
57
+ `user_update`, `grant_create`, `grant_check`, `grants` and `revoke_grant`.
58
+ Core verifies administrative/self-service callers; only the configured identity
59
+ provider may admit external identities or issue/check delegated grants.
60
+ Agent grants include user, issuer, client, resource, explicit business scopes and
61
+ expiry. Grant checks intersect current user permissions. Revocation does not end
62
+ the browser session; disabling a user invalidates sessions and revokes all their
63
+ agent grants. Password and MCP-key credentials retain their independent behavior.
64
+
65
+ This feature introduces additive **store revision v2**. Existing v1 stores require
66
+ Core's explicit `migrate plan auth` / `migrate apply auth --plan-id ...` workflow
67
+ after staging a compatible Auth build. Back up the store and retained secrets
68
+ first. The migration leaves existing password/session tables intact.
69
+
70
+ Active secret uniqueness is transactional. Expired/revoked secrets can be reused
71
+ in a new record with a new grant; old sessions remain tied to the old record.
72
+ Revoked records cannot be restored. Editing a grant invalidates its sessions.
73
+ Delegation is limited by the administrator's own scopes, dynamic-business selector
74
+ and expiry. Issued grants do not inherit a revocation dependency on their creator.
75
+
76
+ Configuration: `session_max_seconds` defaults to 604800; `session_idle_seconds`
77
+ defaults to 86400. Password expiry caps both. Successful logins and authorized
78
+ functional activity update usage; polling and denied attempts do not.
79
+
80
+ Back up the consistent auth SQLite store and retained private key together. A
81
+ missing key with an existing store is a recovery error, not a reason to regenerate
82
+ the key. Removing/reloading the plugin retains both. Runtime validation uses
83
+ temporary storage and secrets.
84
+
85
+ ```sh
86
+ uv sync
87
+ uv run pytest -q
88
+ uv run ruff check src tests
89
+ uv build --wheel
90
+ ```
91
+
92
+ For the same isolated lint, tests, distribution and wheel-install checks used by
93
+ GitHub Actions, run `python3.14 scripts/ci.py`. See [CI and publishing](docs/ci.md)
94
+ for pinned sibling sources, local requirements and TestPyPI/PyPI setup.
95
+
96
+ Core owns access policy. Its compatible OIDC integration supports
97
+ `access.failure_mode = "closed"` for protected deployments; the default preserves
98
+ legacy public business fallback. MCP, llms and explicitly public business APIs
99
+ have independent policies.
100
+
101
+ For release validation and Trusted Publisher setup, see [releasing](docs/releasing.md).
102
+
103
+ ## License
104
+
105
+ Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
106
+
107
+ ## PostgreSQL storage
108
+
109
+ Version 0.2 requires SDK 0.3 and declares PostgreSQL migration SQL alongside the
110
+ unchanged SQLite history. Provision this plugin’s stable store owner with the
111
+ PostgreSQL provider before enabling it. The application still runs one Core;
112
+ retain its private keys and configuration with the application home. Existing
113
+ SQLite records are not imported automatically.