laniakea-api-server 0.2.0__tar.gz → 0.2.2__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.
Files changed (23) hide show
  1. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/PKG-INFO +1 -1
  2. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/__init__.py +1 -1
  3. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/main.py +1 -1
  4. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/models.py +2 -0
  5. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/queue.py +20 -2
  6. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/pyproject.toml +1 -1
  7. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/.github/workflows/publish.yml +0 -0
  8. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/.gitignore +0 -0
  9. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/LICENSE +0 -0
  10. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/README.md +0 -0
  11. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/auth.py +0 -0
  12. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/cli.py +0 -0
  13. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/config.py +0 -0
  14. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/credential_parser.py +0 -0
  15. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/database.py +0 -0
  16. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/installer.py +0 -0
  17. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/.health.py.swp +0 -0
  18. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/__init__.py +0 -0
  19. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/agent.py +0 -0
  20. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/agents.py +0 -0
  21. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/credentials.py +0 -0
  22. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/laniakea_api/routers/deployments.py +0 -0
  23. {laniakea_api_server-0.2.0 → laniakea_api_server-0.2.2}/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.0
3
+ Version: 0.2.2
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
@@ -2,4 +2,4 @@
2
2
  OIDC-authenticated gateway for enqueuing cloud deployment jobs.
3
3
  """
4
4
 
5
- __version__ = "0.1.4"
5
+ __version__ = "0.2.2"
@@ -15,7 +15,7 @@ app = FastAPI(
15
15
  title="Laniakea Queue API",
16
16
  description="OIDC-authenticated gateway for enqueuing cloud deployment jobs.",
17
17
  # FIXME: automatizza versione
18
- version="0.1.4",
18
+ version="0.2.2",
19
19
  )
20
20
 
21
21
  # NOTE: CHANGE HERE for path
@@ -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
@@ -62,6 +63,7 @@ class DeploymentRequest(BaseModel):
62
63
  auth: dict # { aai_token, sub, group }
63
64
  orchestrator: dict # target_provider, desired_orchestrator, endpoint
64
65
  selected_provider: str # OpenStack | AWS
66
+ service_type: Optional[str] = "galaxy"
65
67
  cloud_providers: dict
66
68
 
67
69
 
@@ -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=creds,
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.0"
7
+ version = "0.2.2"
8
8
  description = "Laniakea Queue API — OIDC-authenticated gateway for cloud deployment orchestration"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }