laniakea-api-server 0.2.0__tar.gz → 0.2.1__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.
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/PKG-INFO +1 -1
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/models.py +1 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/queue.py +20 -2
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/pyproject.toml +1 -1
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/.github/workflows/publish.yml +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/.gitignore +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/LICENSE +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/README.md +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/__init__.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/auth.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/cli.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/config.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/credential_parser.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/database.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/installer.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/main.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/.health.py.swp +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/__init__.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/agent.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/agents.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/credentials.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/deployments.py +0 -0
- {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.1}/laniakea_api/routers/health.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: laniakea-api-server
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Laniakea Queue API — OIDC-authenticated gateway for cloud deployment orchestration
|
|
5
5
|
Project-URL: Homepage, https://github.com/laniakea/laniakea-api
|
|
6
6
|
Project-URL: Issues, https://github.com/laniakea/laniakea-api/issues
|
|
@@ -35,6 +35,7 @@ class UserCredentials(BaseModel):
|
|
|
35
35
|
"""
|
|
36
36
|
# NOTE: now no credentials is essential. Consider changing this logic
|
|
37
37
|
# OpenStack
|
|
38
|
+
ssh_private_key: Optional[str] = None
|
|
38
39
|
openstack_ssh_key: Optional[str] = None
|
|
39
40
|
openstack_app_credential_id: Optional[str] = None
|
|
40
41
|
openstack_app_credential_secret: Optional[str] = None
|
|
@@ -65,16 +65,35 @@ vault_client = hvac.Client(
|
|
|
65
65
|
verify=VAULT_TLS_VERIFY,
|
|
66
66
|
)
|
|
67
67
|
|
|
68
|
+
|
|
68
69
|
def vault_write_credentials(user_sub: str, creds: dict) -> str:
|
|
69
70
|
"""
|
|
70
71
|
Write user credentials to Vault under secret/data/<sub>/credentials.
|
|
72
|
+
|
|
73
|
+
MERGE semantics: the existing secret is read first and only the fields
|
|
74
|
+
provided in `creds` are overwritten. Fields already in Vault but not in
|
|
75
|
+
this request are preserved (e.g. ssh_private_key must survive a
|
|
76
|
+
GARR-only app-credentials update).
|
|
77
|
+
|
|
71
78
|
Returns the vault path on success; raises HTTP 502 on failure.
|
|
72
79
|
"""
|
|
73
80
|
vault_path = f"{user_sub}/credentials"
|
|
74
81
|
try:
|
|
82
|
+
# Read existing secret (if any) to merge with incoming fields
|
|
83
|
+
try:
|
|
84
|
+
existing = vault_client.secrets.kv.v2.read_secret_version(
|
|
85
|
+
path=vault_path,
|
|
86
|
+
mount_point=VAULT_MOUNT,
|
|
87
|
+
raise_on_deleted_version=True,
|
|
88
|
+
)["data"]["data"]
|
|
89
|
+
except Exception:
|
|
90
|
+
existing = {}
|
|
91
|
+
|
|
92
|
+
merged = {**existing, **creds}
|
|
93
|
+
|
|
75
94
|
vault_client.secrets.kv.v2.create_or_update_secret(
|
|
76
95
|
path=vault_path,
|
|
77
|
-
secret=
|
|
96
|
+
secret=merged,
|
|
78
97
|
mount_point=VAULT_MOUNT,
|
|
79
98
|
)
|
|
80
99
|
except Exception as exc:
|
|
@@ -84,7 +103,6 @@ def vault_write_credentials(user_sub: str, creds: dict) -> str:
|
|
|
84
103
|
)
|
|
85
104
|
return vault_path
|
|
86
105
|
|
|
87
|
-
|
|
88
106
|
def check_vault() -> str:
|
|
89
107
|
"""
|
|
90
108
|
Returns 'authenticated' or an error string.
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "laniakea-api-server"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "Laniakea Queue API — OIDC-authenticated gateway for cloud deployment orchestration"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
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
|