agentauthlayer 0.1.7__tar.gz → 0.1.9__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.
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/PKG-INFO +1 -1
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/cli.py +58 -2
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/client.py +23 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/PKG-INFO +1 -1
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_user_repo.py +16 -4
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/pyproject.toml +1 -1
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/MANIFEST.in +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/README.md +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/__main__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/agents.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/audit.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/auth.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/context.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/core.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/credentials.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/delegation.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/exceptions.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/models.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/policy.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/policy_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/principals.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/registry.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/runtime.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/server_runtime.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/session.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/storage.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/tokens.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/users.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/assets/index-BBJ7rinV.css +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/assets/index-DXUoW2DG.js +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/favicon.ico +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/grid.svg +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/index.html +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/placeholder.svg +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth/web_dist/robots.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agent_auth_definitive_guide.pdf +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/SOURCES.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/dependency_links.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/entry_points.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/requires.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/agentauthlayer.egg-info/top_level.txt +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/agents.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/audit.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/auth.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/bootstrap.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/health.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/policy.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/projects.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/tokens.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/api/routes/users.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/core/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/core/config.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/core/db.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/core/errors.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/core/logging.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/dependencies/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/dependencies/auth.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/dependencies/security.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/dependencies/user.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/domain/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/domain/enums.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/domain/models.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/main.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/middleware/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/middleware/correlation.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/agent_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/audit_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/constraint_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/contracts.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/delegation_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/project_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/role_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_agent_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_audit_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_constraint_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_delegation_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_permission_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_project_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_role_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_token_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/token_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/user_repo.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/agent.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/audit.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/auth.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/bootstrap.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/device_agents.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/policy.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/project.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/token.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/schemas/user.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/__init__.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/agent_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/audit_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/device_agent_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/policy_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/project_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/token_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/services/user_service.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/setup.cfg +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_agent_auth_library.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_auth_flow.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_core_first_boundary.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_health.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_iam_policy.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_project_flow.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_sqlite_repos.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_storage.py +0 -0
- {agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/tests/test_tool_registry.py +0 -0
|
@@ -6,6 +6,7 @@ import importlib
|
|
|
6
6
|
import json
|
|
7
7
|
import sys
|
|
8
8
|
import webbrowser
|
|
9
|
+
from pathlib import Path
|
|
9
10
|
|
|
10
11
|
import requests
|
|
11
12
|
|
|
@@ -41,6 +42,16 @@ def _bootstrap_status(base_url: str) -> bool | None:
|
|
|
41
42
|
|
|
42
43
|
def login_command(args) -> int:
|
|
43
44
|
base_url = (args.base_url or 'http://127.0.0.1:8002').rstrip('/')
|
|
45
|
+
|
|
46
|
+
if args.token:
|
|
47
|
+
save_credentials({
|
|
48
|
+
'base_url': base_url,
|
|
49
|
+
'token': args.token,
|
|
50
|
+
'email': args.email or 'token-auth',
|
|
51
|
+
})
|
|
52
|
+
print(f"Stored API token credentials for {base_url}")
|
|
53
|
+
return 0
|
|
54
|
+
|
|
44
55
|
setup_status = _bootstrap_status(base_url)
|
|
45
56
|
|
|
46
57
|
if setup_status is False:
|
|
@@ -71,6 +82,13 @@ def login_command(args) -> int:
|
|
|
71
82
|
'If this is your first time using this deployment, initialize it first in the UI, then try logging in again.',
|
|
72
83
|
file=sys.stderr,
|
|
73
84
|
)
|
|
85
|
+
elif response.status_code == 401 and setup_status is True:
|
|
86
|
+
print(
|
|
87
|
+
f"{detail}\n\n"
|
|
88
|
+
'This local/project deployment is already initialized. Use the same password you set during bootstrap, '
|
|
89
|
+
'or reset the local state directory if you want a fresh demo environment.',
|
|
90
|
+
file=sys.stderr,
|
|
91
|
+
)
|
|
74
92
|
else:
|
|
75
93
|
print(detail, file=sys.stderr)
|
|
76
94
|
return 1
|
|
@@ -92,7 +110,11 @@ def whoami_command(args) -> int:
|
|
|
92
110
|
return 1
|
|
93
111
|
client = AuthAPIClient()
|
|
94
112
|
me = client.me()
|
|
95
|
-
print(json.dumps(
|
|
113
|
+
print(json.dumps({
|
|
114
|
+
'auth_source': client.auth_source,
|
|
115
|
+
'base_url': client.base_url,
|
|
116
|
+
'user': me,
|
|
117
|
+
}, indent=2))
|
|
96
118
|
return 0
|
|
97
119
|
|
|
98
120
|
|
|
@@ -104,6 +126,11 @@ def logout_command(args) -> int:
|
|
|
104
126
|
|
|
105
127
|
def sync_command(args) -> int:
|
|
106
128
|
clear_registries()
|
|
129
|
+
|
|
130
|
+
cwd = str(Path.cwd())
|
|
131
|
+
if cwd not in sys.path:
|
|
132
|
+
sys.path.insert(0, cwd)
|
|
133
|
+
|
|
107
134
|
importlib.import_module(args.module)
|
|
108
135
|
|
|
109
136
|
client = AuthAPIClient()
|
|
@@ -124,11 +151,12 @@ def sync_command(args) -> int:
|
|
|
124
151
|
owner=agent.owner,
|
|
125
152
|
role=agent.role,
|
|
126
153
|
scopes=agent.scopes,
|
|
127
|
-
project_id=agent.project_id,
|
|
154
|
+
project_id=args.project or agent.project_id,
|
|
128
155
|
))
|
|
129
156
|
|
|
130
157
|
print(json.dumps({
|
|
131
158
|
'module': args.module,
|
|
159
|
+
'project': args.project,
|
|
132
160
|
'synced_tools': [tool.action for tool in tools],
|
|
133
161
|
'synced_agents': [agent['agent_id'] for agent in created_agents],
|
|
134
162
|
}, indent=2))
|
|
@@ -142,6 +170,20 @@ def delete_agent_command(args) -> int:
|
|
|
142
170
|
return 0
|
|
143
171
|
|
|
144
172
|
|
|
173
|
+
def project_list_command(args) -> int:
|
|
174
|
+
client = AuthAPIClient()
|
|
175
|
+
projects = client.list_projects()
|
|
176
|
+
print(json.dumps(projects, indent=2))
|
|
177
|
+
return 0
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def project_create_command(args) -> int:
|
|
181
|
+
client = AuthAPIClient()
|
|
182
|
+
project = client.create_project(args.project_id, args.name, args.description or "")
|
|
183
|
+
print(json.dumps(project, indent=2))
|
|
184
|
+
return 0
|
|
185
|
+
|
|
186
|
+
|
|
145
187
|
def ui_command(args) -> int:
|
|
146
188
|
creds = load_credentials() or {}
|
|
147
189
|
base_url = (args.base_url or creds.get('base_url') or DEFAULT_BASE_URL).rstrip('/')
|
|
@@ -198,6 +240,7 @@ def main():
|
|
|
198
240
|
login_parser.add_argument('--base-url', default=DEFAULT_BASE_URL)
|
|
199
241
|
login_parser.add_argument('--email')
|
|
200
242
|
login_parser.add_argument('--password')
|
|
243
|
+
login_parser.add_argument('--token', help='Store an API token directly instead of using email/password login')
|
|
201
244
|
login_parser.set_defaults(func=login_command)
|
|
202
245
|
|
|
203
246
|
whoami_parser = subparsers.add_parser('whoami', help='Show the currently stored user context')
|
|
@@ -208,8 +251,21 @@ def main():
|
|
|
208
251
|
|
|
209
252
|
sync_parser = subparsers.add_parser('sync', help='Import a module and sync its registered tools and agents')
|
|
210
253
|
sync_parser.add_argument('--module', required=True)
|
|
254
|
+
sync_parser.add_argument('--project', help='Override the project_id used when creating synced agents')
|
|
211
255
|
sync_parser.set_defaults(func=sync_command)
|
|
212
256
|
|
|
257
|
+
project_parser = subparsers.add_parser('project', help='Manage projects from the CLI')
|
|
258
|
+
project_subparsers = project_parser.add_subparsers(dest='project_command')
|
|
259
|
+
|
|
260
|
+
project_list_parser = project_subparsers.add_parser('list', help='List available projects')
|
|
261
|
+
project_list_parser.set_defaults(func=project_list_command)
|
|
262
|
+
|
|
263
|
+
project_create_parser = project_subparsers.add_parser('create', help='Create a project')
|
|
264
|
+
project_create_parser.add_argument('--project-id', required=True)
|
|
265
|
+
project_create_parser.add_argument('--name', required=True)
|
|
266
|
+
project_create_parser.add_argument('--description')
|
|
267
|
+
project_create_parser.set_defaults(func=project_create_command)
|
|
268
|
+
|
|
213
269
|
delete_agent_parser = subparsers.add_parser('delete-agent', help='Delete an agent by ID')
|
|
214
270
|
delete_agent_parser.add_argument('agent_id')
|
|
215
271
|
delete_agent_parser.set_defaults(func=delete_agent_command)
|
|
@@ -25,6 +25,15 @@ class AuthAPIClient:
|
|
|
25
25
|
self.token = token or os.getenv("AGENT_AUTH_TOKEN") or stored.get("token")
|
|
26
26
|
self.timeout = timeout
|
|
27
27
|
|
|
28
|
+
if token:
|
|
29
|
+
self.auth_source = "explicit_token"
|
|
30
|
+
elif os.getenv("AGENT_AUTH_TOKEN"):
|
|
31
|
+
self.auth_source = "env_token"
|
|
32
|
+
elif stored.get("token"):
|
|
33
|
+
self.auth_source = "stored_credentials"
|
|
34
|
+
else:
|
|
35
|
+
self.auth_source = "none"
|
|
36
|
+
|
|
28
37
|
def _headers(self) -> dict[str, str]:
|
|
29
38
|
headers = {"Content-Type": "application/json"}
|
|
30
39
|
if self.token:
|
|
@@ -59,6 +68,10 @@ class AuthAPIClient:
|
|
|
59
68
|
raise PermissionDeniedError(detail or "Permission denied")
|
|
60
69
|
if response.status_code == 404 and path.startswith("/agents/"):
|
|
61
70
|
raise AgentNotFoundError(detail or "Agent not found")
|
|
71
|
+
if response.status_code == 404 and path == "/agents" and detail and "Project not found" in detail:
|
|
72
|
+
raise AuthServiceError(
|
|
73
|
+
"Project not found. Create the project in the Agent Auth UI first, or update your agent's project_id to match an existing project."
|
|
74
|
+
)
|
|
62
75
|
raise AuthServiceError(detail or f"Request failed with status {response.status_code}")
|
|
63
76
|
|
|
64
77
|
def health(self) -> dict[str, Any]:
|
|
@@ -79,6 +92,16 @@ class AuthAPIClient:
|
|
|
79
92
|
payload["project_id"] = project_id
|
|
80
93
|
return self._request("POST", "/agents", json=payload)
|
|
81
94
|
|
|
95
|
+
def list_projects(self) -> list[dict[str, Any]]:
|
|
96
|
+
return self._request("GET", "/projects")
|
|
97
|
+
|
|
98
|
+
def create_project(self, project_id: str, name: str, description: str = "") -> dict[str, Any]:
|
|
99
|
+
return self._request(
|
|
100
|
+
"POST",
|
|
101
|
+
"/projects",
|
|
102
|
+
json={"project_id": project_id, "name": name, "description": description},
|
|
103
|
+
)
|
|
104
|
+
|
|
82
105
|
def delete_agent(self, agent_id: str) -> dict[str, Any]:
|
|
83
106
|
return self._request("DELETE", f"/agents/{agent_id}")
|
|
84
107
|
|
|
@@ -58,14 +58,26 @@ class SQLiteUserRepository(UserRepositoryProtocol):
|
|
|
58
58
|
return None
|
|
59
59
|
|
|
60
60
|
def set_admin_hash(self, password_hash: str) -> None:
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
primary_email = 'admin@agentauth.dev'
|
|
62
|
+
legacy_email = 'admin@agent-auth.local'
|
|
63
|
+
|
|
64
|
+
primary_user = self.get_user_by_email(primary_email)
|
|
65
|
+
legacy_user = self.get_user_by_email(legacy_email)
|
|
66
|
+
|
|
67
|
+
if primary_user:
|
|
63
68
|
self._conn.execute(
|
|
64
69
|
"UPDATE users SET password_hash = ? WHERE email = ?",
|
|
65
|
-
(password_hash,
|
|
70
|
+
(password_hash, primary_email)
|
|
66
71
|
)
|
|
67
72
|
else:
|
|
68
|
-
self.create_user(
|
|
73
|
+
self.create_user(primary_email, password_hash, 'admin')
|
|
74
|
+
|
|
75
|
+
if legacy_user:
|
|
76
|
+
self._conn.execute(
|
|
77
|
+
"UPDATE users SET password_hash = ? WHERE email = ?",
|
|
78
|
+
(password_hash, legacy_email)
|
|
79
|
+
)
|
|
80
|
+
|
|
69
81
|
self._conn.commit()
|
|
70
82
|
|
|
71
83
|
def create_user(self, email: str, password_hash: str, role: str, invited_by: str | None = None) -> User:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_constraint_repo.py
RENAMED
|
File without changes
|
{agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_delegation_repo.py
RENAMED
|
File without changes
|
{agentauthlayer-0.1.7 → agentauthlayer-0.1.9}/auth_app/repositories/sqlite_permission_repo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|