auth-guide 0.5.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.
- auth_guide-0.5.0/LICENSE +21 -0
- auth_guide-0.5.0/PKG-INFO +146 -0
- auth_guide-0.5.0/README.md +115 -0
- auth_guide-0.5.0/pyproject.toml +80 -0
- auth_guide-0.5.0/pyproject.toml.orig +76 -0
- auth_guide-0.5.0/src/auth_guide/__init__.py +5 -0
- auth_guide-0.5.0/src/auth_guide/__main__.py +6 -0
- auth_guide-0.5.0/src/auth_guide/accounts/__init__.py +322 -0
- auth_guide-0.5.0/src/auth_guide/accounts/migrations/0001_initial.py +63 -0
- auth_guide-0.5.0/src/auth_guide/accounts/migrations/__init__.py +1 -0
- auth_guide-0.5.0/src/auth_guide/accounts/models.py +206 -0
- auth_guide-0.5.0/src/auth_guide/accounts/passwords.py +172 -0
- auth_guide-0.5.0/src/auth_guide/accounts/tokens.py +41 -0
- auth_guide-0.5.0/src/auth_guide/bootstrap.py +76 -0
- auth_guide-0.5.0/src/auth_guide/certificate_operations.py +129 -0
- auth_guide-0.5.0/src/auth_guide/cli/__init__.py +898 -0
- auth_guide-0.5.0/src/auth_guide/cli/client.py +83 -0
- auth_guide-0.5.0/src/auth_guide/cli/config.py +157 -0
- auth_guide-0.5.0/src/auth_guide/cli/logging.py +365 -0
- auth_guide-0.5.0/src/auth_guide/cli/redaction.py +11 -0
- auth_guide-0.5.0/src/auth_guide/config_paths.py +28 -0
- auth_guide-0.5.0/src/auth_guide/management_api.py +591 -0
- auth_guide-0.5.0/src/auth_guide/platform_trust/__init__.py +1 -0
- auth_guide-0.5.0/src/auth_guide/platform_trust/common.py +85 -0
- auth_guide-0.5.0/src/auth_guide/platform_trust/debian.py +50 -0
- auth_guide-0.5.0/src/auth_guide/platform_trust/macos.py +83 -0
- auth_guide-0.5.0/src/auth_guide/platform_trust/redhat.py +50 -0
- auth_guide-0.5.0/src/auth_guide/secrets.py +286 -0
- auth_guide-0.5.0/src/auth_guide/server/__init__.py +5 -0
- auth_guide-0.5.0/src/auth_guide/server/lifecycle.py +209 -0
- auth_guide-0.5.0/src/auth_guide/server/runtime.py +235 -0
- auth_guide-0.5.0/src/auth_guide/system_trust.py +145 -0
- auth_guide-0.5.0/src/auth_guide/tls.py +835 -0
auth_guide-0.5.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 David Nugent
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: auth-guide
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Local account and bearer-token service for mcp-guide
|
|
5
|
+
Author: David Nugent
|
|
6
|
+
Author-email: David Nugent <davidn@uniquode.io>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Requires-Dist: anyio>=4.15.1
|
|
18
|
+
Requires-Dist: argon2-cffi>=25.1.0
|
|
19
|
+
Requires-Dist: click>=8.5.0
|
|
20
|
+
Requires-Dist: cryptography>=50.0.2
|
|
21
|
+
Requires-Dist: email-validator>=2.3.0
|
|
22
|
+
Requires-Dist: fastapi>=0.143.0
|
|
23
|
+
Requires-Dist: httpx>=0.28.1
|
|
24
|
+
Requires-Dist: keyring>=25.7.0
|
|
25
|
+
Requires-Dist: rich>=15.0.0
|
|
26
|
+
Requires-Dist: tortoise-sqlcipher>=0.5.0
|
|
27
|
+
Requires-Dist: truststore>=0.10.4
|
|
28
|
+
Requires-Dist: uvicorn>=0.54.0
|
|
29
|
+
Requires-Python: >=3.12
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# auth-guide
|
|
33
|
+
|
|
34
|
+
[](https://github.com/deeprave/auth-guide/actions/workflows/test.yaml)
|
|
35
|
+
[](https://github.com/deeprave/auth-guide)
|
|
36
|
+
[](https://pypi.org/project/auth-guide/)
|
|
37
|
+
[](https://pypi.org/project/auth-guide/)
|
|
38
|
+
[](https://pypi.org/project/auth-guide/)
|
|
39
|
+
|
|
40
|
+
auth-guide is a **reference authentication provider** for [mcp-guide](https://pypi.org/project/mcp-guide/) version 2.0.0 and later, used only when running the MCP in https mode.
|
|
41
|
+
|
|
42
|
+
This implementation is a local account and bearer-token service supporting Guide authentication decisions, and an HTTPS management API with an administration CLI. Persistent account data uses an encrypted SQLite database. This reference implementation does not support mTLS.
|
|
43
|
+
|
|
44
|
+
auth-guide requires Python 3.12 or later.
|
|
45
|
+
|
|
46
|
+
## Local TLS authority
|
|
47
|
+
|
|
48
|
+
The library provides a provider-owned local certificate authority for the reference service. Initialise it once before any other certificate operation; the CA and server private keys remain in the platform secret store, while public certificate lifecycle metadata is kept under the configuration directory, `~/.config/mcp-guide/auth/` by default. The administration CLI provides the supported initialisation and trust-management commands.
|
|
49
|
+
|
|
50
|
+
System trust changes are explicit privileged operations. Debian-family systems use `update-ca-certificates`; Red Hat-family systems use `update-ca-trust` and the p11-kit anchor directory. The latter is supported by its platform facade, but native Red Hat validation remains an operator/CI responsibility. macOS uses the System Keychain with an SSL-only trust setting. Linux systems that use Java-style trust stores such as Amazon Corretto require manual integration of the generated CA certificate.
|
|
51
|
+
|
|
52
|
+
## Platform secret store
|
|
53
|
+
|
|
54
|
+
Provider-owned secret values are held outside configuration and database files. The runtime asks [`keyring`](https://pypi.org/project/keyring/) for the sensible backend on the current operating system: normally macOS Keychain on macOS and Freedesktop Secret Service on Linux. Linux deployments need a running D-Bus session and a Secret-Service-compatible keyring, such as GNOME Keyring.
|
|
55
|
+
|
|
56
|
+
Operators can configure a compatible non-default backend using the standard `keyring` configuration mechanism. That choice is part of the host's security boundary; auth-guide neither substitutes a fallback nor attempts to classify the configured backend's storage security.
|
|
57
|
+
|
|
58
|
+
## Running the local provider
|
|
59
|
+
|
|
60
|
+
The local HTTPS provider is operated with `auth-guide server`. First create any optional configuration scaffold, initialise the local certificate authority, and create the first administrator. `init` displays the initial password and bearer token once, so run it from a terminal and store those credentials safely.
|
|
61
|
+
|
|
62
|
+
```console
|
|
63
|
+
$ auth-guide config init
|
|
64
|
+
$ auth-guide ca init
|
|
65
|
+
$ auth-guide init admin@example.com
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Start the provider as a detached local process, then inspect its structured JSON status:
|
|
69
|
+
|
|
70
|
+
```console
|
|
71
|
+
$ auth-guide server start
|
|
72
|
+
$ auth-guide server status
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`server start` waits for HTTPS readiness for up to 30 seconds. It does not create or migrate a certificate authority, encrypted account database, or platform-secret-store key; complete the explicit setup above first. Use `--listen` (or `-L`) only with `server start` or `server foreground` to override the configured listener for that invocation.
|
|
76
|
+
|
|
77
|
+
For development or external supervision, run the service in the foreground:
|
|
78
|
+
|
|
79
|
+
```console
|
|
80
|
+
$ auth-guide server foreground --listen https://localhost:8443
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The lifecycle commands use state files that reside in the configuration directory. `server restart` rebuilds the running service in place after rereading its TOML configuration, while retaining its PID.
|
|
84
|
+
|
|
85
|
+
`server stop` requests graceful shutdown and never escalates to SIGKILL automatically.
|
|
86
|
+
|
|
87
|
+
```console
|
|
88
|
+
$ auth-guide server restart
|
|
89
|
+
$ auth-guide server stop
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## API reference
|
|
93
|
+
|
|
94
|
+
This reference implementation exposes a bearer-authentication decision endpoint and a separate HTTPS management API. Alternative providers can implement the same contracts without using this database, CLI, or internal code.
|
|
95
|
+
|
|
96
|
+
Authentication and management endpoints require an `Authorization: Bearer <token>` header and return JSON. UUID values are strings; timestamps are ISO 8601 strings. An `Account` response contains `id`, `email`, `grants`, `created_at`, `expires_at`, `full_name`, and `must_change_password`. A `Token` response contains `id`, `account_id`, `label`, `scopes`, and `created_at`. Successful deletion returns `204 No Content`.
|
|
97
|
+
|
|
98
|
+
`GET /openapi.json` does not require bearer authentication and returns the machine-readable OpenAPI description of the authentication and management endpoints. Interactive API documentation is disabled.
|
|
99
|
+
|
|
100
|
+
### Guide authentication decision
|
|
101
|
+
|
|
102
|
+
| Method | Path | Request | Response |
|
|
103
|
+
| --- | --- | --- | --- |
|
|
104
|
+
| `POST` | `/v1/authenticate` | No body | `200` `{"account_id": "UUID", "scopes": ["admin"]}`; `scopes` is empty for a non-administrator. |
|
|
105
|
+
|
|
106
|
+
### Management API
|
|
107
|
+
|
|
108
|
+
Management operations use the same bearer authentication. Account operations that target another account require the appropriate account-management grant; token operations for another account require `tokens:manage`.
|
|
109
|
+
|
|
110
|
+
| Method | Path | Request parameters or JSON body | Response |
|
|
111
|
+
| --- | --- | --- | --- |
|
|
112
|
+
| `GET` | `/v1/accounts/me` | None | `200` `Account` |
|
|
113
|
+
| `PATCH` | `/v1/accounts/me` | JSON: optional `email`, `full_name` | `200` `Account` |
|
|
114
|
+
| `POST` | `/v1/accounts/me/password` | JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
115
|
+
| `POST` | `/v1/accounts/me/close` | None | `200` `Account` with an immediate expiry |
|
|
116
|
+
| `GET` | `/v1/accounts` | Optional query: `email` | `200` `Account[]`, or one `Account` when `email` is supplied |
|
|
117
|
+
| `POST` | `/v1/accounts` | JSON: `email`, `password`, `grants`; optional `full_name`, timezone-aware `expires_at` | `201` `Account` |
|
|
118
|
+
| `GET` | `/v1/accounts/{account_id}` | Path: `account_id` | `200` `Account` |
|
|
119
|
+
| `PATCH` | `/v1/accounts/{account_id}` | Path: `account_id`; JSON: one complete `grants` list or `add_grants`/`remove_grants`, optional `reactivate` | `200` `Account` |
|
|
120
|
+
| `DELETE` | `/v1/accounts/{account_id}` | Path: `account_id` | `204` |
|
|
121
|
+
| `PATCH` | `/v1/accounts?email={email}` | Query: `email`; JSON: as for the UUID-targeted `PATCH` | `200` `Account` |
|
|
122
|
+
| `POST` | `/v1/accounts/password?email={email}` | Query: `email`; JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
123
|
+
| `DELETE` | `/v1/accounts?email={email}` | Query: `email` | `204` |
|
|
124
|
+
| `POST` | `/v1/accounts/{account_id}/password` | Path: `account_id`; JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
125
|
+
| `GET` | `/v1/tokens` | Optional query: exactly one of `account_id`, `account_email` | `200` `Token[]` |
|
|
126
|
+
| `POST` | `/v1/tokens` | JSON: `label`, `scopes`; optional exactly one of `account_id`, `account_email` | `201` `Token` plus once-only `token` bearer string |
|
|
127
|
+
| `PATCH` | `/v1/tokens/{token_id}` | Path: `token_id`; JSON: `label` | `200` `Token` |
|
|
128
|
+
| `DELETE` | `/v1/tokens/{token_id}` | Path: `token_id` | `204` |
|
|
129
|
+
|
|
130
|
+
## CLI reference
|
|
131
|
+
|
|
132
|
+
The administration CLI is an HTTPS API client, not a direct database interface. Supply an operator bearer through `AUTH_GUIDE_TOKEN` or `--token`; use `--address`/`-A` to select the provider address.
|
|
133
|
+
|
|
134
|
+
| Commands | Management operation |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `account list`, `account show ACCOUNT`, `account me` | List accounts, retrieve an account by UUID or email, or retrieve the authenticated account. |
|
|
137
|
+
| `account create EMAIL`, `account delete ACCOUNT` | Create or permanently delete an account; creation prompts for the initial password. |
|
|
138
|
+
| `account update`, `account reactivate ACCOUNT`, `account password`, `account reset-password ACCOUNT`, `account close` | Update the authenticated profile, reactivate an account, replace a password, or close the authenticated account. Password commands use hidden prompts. |
|
|
139
|
+
| `grant list ACCOUNT`, `grant set ACCOUNT`, `grant add ACCOUNT GRANT`, `grant remove ACCOUNT GRANT` | Read, replace, add, or remove an account's grants. Replacing with no grants requires `--clear`. |
|
|
140
|
+
| `token create LABEL`, `token list`, `token relabel TOKEN_ID LABEL`, `token revoke TOKEN_ID` | Create, list, relabel, or revoke bearer tokens. Token creation displays the new bearer value once. |
|
|
141
|
+
|
|
142
|
+
Run `auth-guide --help` or `auth-guide COMMAND --help` for command-specific options, including configuration, certificate-authority, and server lifecycle commands.
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# auth-guide
|
|
2
|
+
|
|
3
|
+
[](https://github.com/deeprave/auth-guide/actions/workflows/test.yaml)
|
|
4
|
+
[](https://github.com/deeprave/auth-guide)
|
|
5
|
+
[](https://pypi.org/project/auth-guide/)
|
|
6
|
+
[](https://pypi.org/project/auth-guide/)
|
|
7
|
+
[](https://pypi.org/project/auth-guide/)
|
|
8
|
+
|
|
9
|
+
auth-guide is a **reference authentication provider** for [mcp-guide](https://pypi.org/project/mcp-guide/) version 2.0.0 and later, used only when running the MCP in https mode.
|
|
10
|
+
|
|
11
|
+
This implementation is a local account and bearer-token service supporting Guide authentication decisions, and an HTTPS management API with an administration CLI. Persistent account data uses an encrypted SQLite database. This reference implementation does not support mTLS.
|
|
12
|
+
|
|
13
|
+
auth-guide requires Python 3.12 or later.
|
|
14
|
+
|
|
15
|
+
## Local TLS authority
|
|
16
|
+
|
|
17
|
+
The library provides a provider-owned local certificate authority for the reference service. Initialise it once before any other certificate operation; the CA and server private keys remain in the platform secret store, while public certificate lifecycle metadata is kept under the configuration directory, `~/.config/mcp-guide/auth/` by default. The administration CLI provides the supported initialisation and trust-management commands.
|
|
18
|
+
|
|
19
|
+
System trust changes are explicit privileged operations. Debian-family systems use `update-ca-certificates`; Red Hat-family systems use `update-ca-trust` and the p11-kit anchor directory. The latter is supported by its platform facade, but native Red Hat validation remains an operator/CI responsibility. macOS uses the System Keychain with an SSL-only trust setting. Linux systems that use Java-style trust stores such as Amazon Corretto require manual integration of the generated CA certificate.
|
|
20
|
+
|
|
21
|
+
## Platform secret store
|
|
22
|
+
|
|
23
|
+
Provider-owned secret values are held outside configuration and database files. The runtime asks [`keyring`](https://pypi.org/project/keyring/) for the sensible backend on the current operating system: normally macOS Keychain on macOS and Freedesktop Secret Service on Linux. Linux deployments need a running D-Bus session and a Secret-Service-compatible keyring, such as GNOME Keyring.
|
|
24
|
+
|
|
25
|
+
Operators can configure a compatible non-default backend using the standard `keyring` configuration mechanism. That choice is part of the host's security boundary; auth-guide neither substitutes a fallback nor attempts to classify the configured backend's storage security.
|
|
26
|
+
|
|
27
|
+
## Running the local provider
|
|
28
|
+
|
|
29
|
+
The local HTTPS provider is operated with `auth-guide server`. First create any optional configuration scaffold, initialise the local certificate authority, and create the first administrator. `init` displays the initial password and bearer token once, so run it from a terminal and store those credentials safely.
|
|
30
|
+
|
|
31
|
+
```console
|
|
32
|
+
$ auth-guide config init
|
|
33
|
+
$ auth-guide ca init
|
|
34
|
+
$ auth-guide init admin@example.com
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Start the provider as a detached local process, then inspect its structured JSON status:
|
|
38
|
+
|
|
39
|
+
```console
|
|
40
|
+
$ auth-guide server start
|
|
41
|
+
$ auth-guide server status
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`server start` waits for HTTPS readiness for up to 30 seconds. It does not create or migrate a certificate authority, encrypted account database, or platform-secret-store key; complete the explicit setup above first. Use `--listen` (or `-L`) only with `server start` or `server foreground` to override the configured listener for that invocation.
|
|
45
|
+
|
|
46
|
+
For development or external supervision, run the service in the foreground:
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
$ auth-guide server foreground --listen https://localhost:8443
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The lifecycle commands use state files that reside in the configuration directory. `server restart` rebuilds the running service in place after rereading its TOML configuration, while retaining its PID.
|
|
53
|
+
|
|
54
|
+
`server stop` requests graceful shutdown and never escalates to SIGKILL automatically.
|
|
55
|
+
|
|
56
|
+
```console
|
|
57
|
+
$ auth-guide server restart
|
|
58
|
+
$ auth-guide server stop
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## API reference
|
|
62
|
+
|
|
63
|
+
This reference implementation exposes a bearer-authentication decision endpoint and a separate HTTPS management API. Alternative providers can implement the same contracts without using this database, CLI, or internal code.
|
|
64
|
+
|
|
65
|
+
Authentication and management endpoints require an `Authorization: Bearer <token>` header and return JSON. UUID values are strings; timestamps are ISO 8601 strings. An `Account` response contains `id`, `email`, `grants`, `created_at`, `expires_at`, `full_name`, and `must_change_password`. A `Token` response contains `id`, `account_id`, `label`, `scopes`, and `created_at`. Successful deletion returns `204 No Content`.
|
|
66
|
+
|
|
67
|
+
`GET /openapi.json` does not require bearer authentication and returns the machine-readable OpenAPI description of the authentication and management endpoints. Interactive API documentation is disabled.
|
|
68
|
+
|
|
69
|
+
### Guide authentication decision
|
|
70
|
+
|
|
71
|
+
| Method | Path | Request | Response |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| `POST` | `/v1/authenticate` | No body | `200` `{"account_id": "UUID", "scopes": ["admin"]}`; `scopes` is empty for a non-administrator. |
|
|
74
|
+
|
|
75
|
+
### Management API
|
|
76
|
+
|
|
77
|
+
Management operations use the same bearer authentication. Account operations that target another account require the appropriate account-management grant; token operations for another account require `tokens:manage`.
|
|
78
|
+
|
|
79
|
+
| Method | Path | Request parameters or JSON body | Response |
|
|
80
|
+
| --- | --- | --- | --- |
|
|
81
|
+
| `GET` | `/v1/accounts/me` | None | `200` `Account` |
|
|
82
|
+
| `PATCH` | `/v1/accounts/me` | JSON: optional `email`, `full_name` | `200` `Account` |
|
|
83
|
+
| `POST` | `/v1/accounts/me/password` | JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
84
|
+
| `POST` | `/v1/accounts/me/close` | None | `200` `Account` with an immediate expiry |
|
|
85
|
+
| `GET` | `/v1/accounts` | Optional query: `email` | `200` `Account[]`, or one `Account` when `email` is supplied |
|
|
86
|
+
| `POST` | `/v1/accounts` | JSON: `email`, `password`, `grants`; optional `full_name`, timezone-aware `expires_at` | `201` `Account` |
|
|
87
|
+
| `GET` | `/v1/accounts/{account_id}` | Path: `account_id` | `200` `Account` |
|
|
88
|
+
| `PATCH` | `/v1/accounts/{account_id}` | Path: `account_id`; JSON: one complete `grants` list or `add_grants`/`remove_grants`, optional `reactivate` | `200` `Account` |
|
|
89
|
+
| `DELETE` | `/v1/accounts/{account_id}` | Path: `account_id` | `204` |
|
|
90
|
+
| `PATCH` | `/v1/accounts?email={email}` | Query: `email`; JSON: as for the UUID-targeted `PATCH` | `200` `Account` |
|
|
91
|
+
| `POST` | `/v1/accounts/password?email={email}` | Query: `email`; JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
92
|
+
| `DELETE` | `/v1/accounts?email={email}` | Query: `email` | `204` |
|
|
93
|
+
| `POST` | `/v1/accounts/{account_id}/password` | Path: `account_id`; JSON: `password` (minimum 12 characters) | `200` `Account` |
|
|
94
|
+
| `GET` | `/v1/tokens` | Optional query: exactly one of `account_id`, `account_email` | `200` `Token[]` |
|
|
95
|
+
| `POST` | `/v1/tokens` | JSON: `label`, `scopes`; optional exactly one of `account_id`, `account_email` | `201` `Token` plus once-only `token` bearer string |
|
|
96
|
+
| `PATCH` | `/v1/tokens/{token_id}` | Path: `token_id`; JSON: `label` | `200` `Token` |
|
|
97
|
+
| `DELETE` | `/v1/tokens/{token_id}` | Path: `token_id` | `204` |
|
|
98
|
+
|
|
99
|
+
## CLI reference
|
|
100
|
+
|
|
101
|
+
The administration CLI is an HTTPS API client, not a direct database interface. Supply an operator bearer through `AUTH_GUIDE_TOKEN` or `--token`; use `--address`/`-A` to select the provider address.
|
|
102
|
+
|
|
103
|
+
| Commands | Management operation |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `account list`, `account show ACCOUNT`, `account me` | List accounts, retrieve an account by UUID or email, or retrieve the authenticated account. |
|
|
106
|
+
| `account create EMAIL`, `account delete ACCOUNT` | Create or permanently delete an account; creation prompts for the initial password. |
|
|
107
|
+
| `account update`, `account reactivate ACCOUNT`, `account password`, `account reset-password ACCOUNT`, `account close` | Update the authenticated profile, reactivate an account, replace a password, or close the authenticated account. Password commands use hidden prompts. |
|
|
108
|
+
| `grant list ACCOUNT`, `grant set ACCOUNT`, `grant add ACCOUNT GRANT`, `grant remove ACCOUNT GRANT` | Read, replace, add, or remove an account's grants. Replacing with no grants requires `--clear`. |
|
|
109
|
+
| `token create LABEL`, `token list`, `token relabel TOKEN_ID LABEL`, `token revoke TOKEN_ID` | Create, list, relabel, or revoke bearer tokens. Token creation displays the new bearer value once. |
|
|
110
|
+
|
|
111
|
+
Run `auth-guide --help` or `auth-guide COMMAND --help` for command-specific options, including configuration, certificate-authority, and server lifecycle commands.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "auth-guide"
|
|
3
|
+
version = "0.5.0"
|
|
4
|
+
description = "Local account and bearer-token service for mcp-guide"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.12"
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
11
|
+
"Operating System :: OS Independent",
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
"Topic :: Security",
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"anyio>=4.15.1",
|
|
21
|
+
"argon2-cffi>=25.1.0",
|
|
22
|
+
"click>=8.5.0",
|
|
23
|
+
"cryptography>=50.0.2",
|
|
24
|
+
"email-validator>=2.3.0",
|
|
25
|
+
"fastapi>=0.143.0",
|
|
26
|
+
"httpx>=0.28.1",
|
|
27
|
+
"keyring>=25.7.0",
|
|
28
|
+
"rich>=15.0.0",
|
|
29
|
+
"tortoise-sqlcipher>=0.5.0",
|
|
30
|
+
"truststore>=0.10.4",
|
|
31
|
+
"uvicorn>=0.54.0",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[[project.authors]]
|
|
35
|
+
name = "David Nugent"
|
|
36
|
+
email = "davidn@uniquode.io"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
auth-guide = "auth_guide.cli:cli"
|
|
40
|
+
|
|
41
|
+
[build-system]
|
|
42
|
+
requires = ["uv_build>=0.12.15,<0.15.0"]
|
|
43
|
+
build-backend = "uv_build"
|
|
44
|
+
|
|
45
|
+
[tool.uv]
|
|
46
|
+
package = true
|
|
47
|
+
|
|
48
|
+
[tool.ruff]
|
|
49
|
+
src = ["src"]
|
|
50
|
+
target-version = "py312"
|
|
51
|
+
line-length = 120
|
|
52
|
+
|
|
53
|
+
[tool.ruff.lint]
|
|
54
|
+
select = [
|
|
55
|
+
"I",
|
|
56
|
+
"F401",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.ruff.lint.isort]
|
|
60
|
+
known-first-party = ["auth_guide"]
|
|
61
|
+
|
|
62
|
+
[tool.ty.environment]
|
|
63
|
+
python-version = "3.12"
|
|
64
|
+
|
|
65
|
+
[tool.ty.analysis]
|
|
66
|
+
respect-type-ignore-comments = true
|
|
67
|
+
|
|
68
|
+
[tool.ty.terminal]
|
|
69
|
+
error-on-warning = true
|
|
70
|
+
|
|
71
|
+
[dependency-groups]
|
|
72
|
+
dev = [
|
|
73
|
+
"ruff>=0.13.2",
|
|
74
|
+
"ty",
|
|
75
|
+
"watchdog>=6.0.0",
|
|
76
|
+
"bandit>=1.9.2",
|
|
77
|
+
"pytest>=9.1.1",
|
|
78
|
+
"pytest-cov>=7.1.0",
|
|
79
|
+
"coverage>=7.16.2",
|
|
80
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "auth-guide"
|
|
3
|
+
version = "0.5.0"
|
|
4
|
+
description = "Local account and bearer-token service for mcp-guide"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "David Nugent", email = "davidn@uniquode.io" }
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.12"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Programming Language :: Python :: 3.14",
|
|
20
|
+
"Topic :: Security",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"anyio>=4.15.1",
|
|
24
|
+
"argon2-cffi>=25.1.0",
|
|
25
|
+
"click>=8.5.0",
|
|
26
|
+
"cryptography>=50.0.2",
|
|
27
|
+
"email-validator>=2.3.0",
|
|
28
|
+
"fastapi>=0.143.0",
|
|
29
|
+
"httpx>=0.28.1",
|
|
30
|
+
"keyring>=25.7.0",
|
|
31
|
+
"rich>=15.0.0",
|
|
32
|
+
"tortoise-sqlcipher>=0.5.0",
|
|
33
|
+
"truststore>=0.10.4",
|
|
34
|
+
"uvicorn>=0.54.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.scripts]
|
|
38
|
+
auth-guide = "auth_guide.cli:cli"
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ["uv_build>=0.12.15,<0.15.0"]
|
|
42
|
+
build-backend = "uv_build"
|
|
43
|
+
|
|
44
|
+
[tool.uv]
|
|
45
|
+
package = true
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
src = ["src"]
|
|
49
|
+
target-version = "py312"
|
|
50
|
+
line-length = 120
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint]
|
|
53
|
+
select = ["I", "F401"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint.isort]
|
|
56
|
+
known-first-party = ["auth_guide"]
|
|
57
|
+
|
|
58
|
+
[tool.ty.environment]
|
|
59
|
+
python-version = "3.12"
|
|
60
|
+
|
|
61
|
+
[tool.ty.analysis]
|
|
62
|
+
respect-type-ignore-comments = true
|
|
63
|
+
|
|
64
|
+
[tool.ty.terminal]
|
|
65
|
+
error-on-warning = true
|
|
66
|
+
|
|
67
|
+
[dependency-groups]
|
|
68
|
+
dev = [
|
|
69
|
+
"ruff>=0.13.2",
|
|
70
|
+
"ty",
|
|
71
|
+
"watchdog>=6.0.0",
|
|
72
|
+
"bandit>=1.9.2",
|
|
73
|
+
"pytest>=9.1.1",
|
|
74
|
+
"pytest-cov>=7.1.0",
|
|
75
|
+
"coverage>=7.16.2",
|
|
76
|
+
]
|