laniakea-api-server 0.3.1__tar.gz → 0.3.3__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.3.1 → laniakea_api_server-0.3.3}/PKG-INFO +1 -1
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/queue.py +16 -6
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/pyproject.toml +1 -1
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/.github/workflows/publish.yml +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/.gitignore +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/LICENSE +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/README.md +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/__init__.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/auth.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/cli.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/config.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/credential_parser.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/database.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/installer.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/main.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/models.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/.health.py.swp +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/__init__.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/agent.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/agents.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/credentials.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/deployments.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/health.py +0 -0
- {laniakea_api_server-0.3.1 → laniakea_api_server-0.3.3}/laniakea_api/routers/tfstate.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: laniakea-api-server
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -3,6 +3,7 @@ Redis connection and RQ queue setup
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import hvac
|
|
6
|
+
import os
|
|
6
7
|
from fastapi import HTTPException, status
|
|
7
8
|
from redis import Redis
|
|
8
9
|
from rq import Queue
|
|
@@ -33,6 +34,15 @@ PROVIDER_TO_QUEUE: dict = {
|
|
|
33
34
|
"Aws": "aws",
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
|
|
38
|
+
def _vault():
|
|
39
|
+
"""Build the Vault client at call time (env vars are loaded by then)."""
|
|
40
|
+
return hvac.Client(
|
|
41
|
+
url=os.getenv("VAULT_ADDR", ""),
|
|
42
|
+
token=os.getenv("VAULT_WRITER_TOKEN", ""),
|
|
43
|
+
verify=os.getenv("VAULT_TLS_VERIFY", "false").lower() == "true",
|
|
44
|
+
)
|
|
45
|
+
|
|
36
46
|
def get_queue(provider: str) -> tuple:
|
|
37
47
|
"""
|
|
38
48
|
Returns (queue_name, Queue) for the given provider string.
|
|
@@ -132,7 +142,7 @@ def _infer_service_type(data: dict) -> str:
|
|
|
132
142
|
|
|
133
143
|
|
|
134
144
|
def vault_list_service_creds(user_sub: str) -> list:
|
|
135
|
-
client =
|
|
145
|
+
client = _vault()
|
|
136
146
|
try:
|
|
137
147
|
resp = client.secrets.kv.v2.list_secrets(path=_sc_path(user_sub), mount_point=VAULT_MOUNT)
|
|
138
148
|
names = [k.rstrip("/") for k in resp["data"]["keys"]]
|
|
@@ -145,7 +155,7 @@ def vault_list_service_creds(user_sub: str) -> list:
|
|
|
145
155
|
return out
|
|
146
156
|
|
|
147
157
|
def vault_read_service_creds(user_sub: str, name: str) -> dict:
|
|
148
|
-
client =
|
|
158
|
+
client = _vault()
|
|
149
159
|
try:
|
|
150
160
|
resp = client.secrets.kv.v2.read_secret_version(path=_sc_path(user_sub, name), mount_point=VAULT_MOUNT)
|
|
151
161
|
return resp["data"]["data"] or {}
|
|
@@ -153,18 +163,18 @@ def vault_read_service_creds(user_sub: str, name: str) -> dict:
|
|
|
153
163
|
return {}
|
|
154
164
|
|
|
155
165
|
def vault_write_service_creds(user_sub: str, name: str, data: dict) -> None:
|
|
156
|
-
client =
|
|
166
|
+
client = _vault()
|
|
157
167
|
client.secrets.kv.v2.create_or_update_secret(
|
|
158
168
|
path=_sc_path(user_sub, name), secret=data, mount_point=VAULT_MOUNT)
|
|
159
169
|
|
|
160
170
|
def vault_delete_service_creds(user_sub: str, name: str) -> None:
|
|
161
|
-
client =
|
|
171
|
+
client = _vault()
|
|
162
172
|
client.secrets.kv.v2.delete_metadata_and_all_versions(
|
|
163
173
|
path=_sc_path(user_sub, name), mount_point=VAULT_MOUNT)
|
|
164
174
|
|
|
165
175
|
|
|
166
176
|
def vault_read_global(user_sub: str) -> dict:
|
|
167
|
-
client =
|
|
177
|
+
client = _vault()
|
|
168
178
|
try:
|
|
169
179
|
resp = client.secrets.kv.v2.read_secret_version(
|
|
170
180
|
path=f"{user_sub}/credentials", mount_point=VAULT_MOUNT)
|
|
@@ -177,6 +187,6 @@ def vault_strip_global_keys(user_sub: str, keys: list) -> None:
|
|
|
177
187
|
data = vault_read_global(user_sub)
|
|
178
188
|
for k in keys:
|
|
179
189
|
data.pop(k, None)
|
|
180
|
-
client =
|
|
190
|
+
client = _vault()
|
|
181
191
|
client.secrets.kv.v2.create_or_update_secret(
|
|
182
192
|
path=f"{user_sub}/credentials", secret=data, mount_point=VAULT_MOUNT)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "laniakea-api-server"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.3"
|
|
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
|
|
File without changes
|
|
File without changes
|