Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/routes_admin.py +8 -1
- platform/core/store_pg.py +5 -7
RELEASES.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v55",
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "2970b72",
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v55",
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
2970b72
|
api/routes_admin.py
CHANGED
|
@@ -2061,7 +2061,14 @@ def _store_binding(session):
|
|
| 2061 |
import core.store as store # noqa: PLC0415
|
| 2062 |
bound = getattr(session.runtime, "store_handle", None)
|
| 2063 |
repo = getattr(bound, "repo", None) or store.REPO
|
| 2064 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2065 |
except Exception as e: # noqa: BLE001
|
| 2066 |
return {"deployment": "unknown", "production": False, "repo": "",
|
| 2067 |
"writable": False, "refusal": f"could not resolve the store binding: {e}",
|
|
|
|
| 2061 |
import core.store as store # noqa: PLC0415
|
| 2062 |
bound = getattr(session.runtime, "store_handle", None)
|
| 2063 |
repo = getattr(bound, "repo", None) or store.REPO
|
| 2064 |
+
result = data_binding.describe(repo)
|
| 2065 |
+
if result.get("backend") == "pg":
|
| 2066 |
+
import core.store_pg as store_pg # noqa: PLC0415
|
| 2067 |
+
slug = getattr(bound, "tenant_slug", None) or session.tenant
|
| 2068 |
+
refusal = store_pg.write_refusal(slug)
|
| 2069 |
+
result.update(writable=refusal is None, refusal=refusal,
|
| 2070 |
+
allowlist=sorted(store_pg.sandbox_tenants()))
|
| 2071 |
+
return result
|
| 2072 |
except Exception as e: # noqa: BLE001
|
| 2073 |
return {"deployment": "unknown", "production": False, "repo": "",
|
| 2074 |
"writable": False, "refusal": f"could not resolve the store binding: {e}",
|
platform/core/store_pg.py
CHANGED
|
@@ -167,14 +167,12 @@ def write_refusal(tenant_slug=None):
|
|
| 167 |
thing being classified changes, from a dataset repo to a tenant slug:
|
| 168 |
|
| 169 |
1. the PRODUCTION deployment -> may write any tenant
|
| 170 |
-
2. any other deployment writing a PRODUCTION tenant -> REFUSED
|
| 171 |
3. any other deployment writing a tenant it was HANDED -> allowed
|
| 172 |
4. anything else -> REFUSED
|
| 173 |
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
over unchanged — a Space that is not production gets NO override, because that is the case the
|
| 177 |
-
owner said "EVER" about.
|
| 178 |
"""
|
| 179 |
slug = _effective_slug(tenant_slug)
|
| 180 |
if data_binding.is_production_deployment():
|
|
@@ -189,8 +187,8 @@ def write_refusal(tenant_slug=None):
|
|
| 189 |
if data_binding.is_space():
|
| 190 |
return (f'{who} is not the production deployment, so it may not write tenant {where}, '
|
| 191 |
f'which holds real customer data. Point this deployment at its own database, '
|
| 192 |
-
f'or
|
| 193 |
-
f'
|
| 194 |
return (f'{who} may not write tenant {where}, which holds real customer data. Set '
|
| 195 |
f'AIOS_TENANT to a sandbox tenant, or set '
|
| 196 |
f'{data_binding._LOCAL_OPT_IN_VAR}=1 to opt in deliberately.')
|
|
|
|
| 167 |
thing being classified changes, from a dataset repo to a tenant slug:
|
| 168 |
|
| 169 |
1. the PRODUCTION deployment -> may write any tenant
|
| 170 |
+
2. any other deployment writing a PRODUCTION tenant -> REFUSED, except exact isolated staging
|
| 171 |
3. any other deployment writing a tenant it was HANDED -> allowed
|
| 172 |
4. anything else -> REFUSED
|
| 173 |
|
| 174 |
+
Rule 2 permits one narrow exception: the exact staging Space, an explicitly handed tenant,
|
| 175 |
+
and a DATABASE_URL host matching the isolated host stamped by the deploy must all agree.
|
|
|
|
|
|
|
| 176 |
"""
|
| 177 |
slug = _effective_slug(tenant_slug)
|
| 178 |
if data_binding.is_production_deployment():
|
|
|
|
| 187 |
if data_binding.is_space():
|
| 188 |
return (f'{who} is not the production deployment, so it may not write tenant {where}, '
|
| 189 |
f'which holds real customer data. Point this deployment at its own database, '
|
| 190 |
+
f'or bind exact isolated staging and name its writable tenants in '
|
| 191 |
+
f'{_SANDBOX_TENANTS_VAR}. A non-live build never writes the live database.')
|
| 192 |
return (f'{who} may not write tenant {where}, which holds real customer data. Set '
|
| 193 |
f'AIOS_TENANT to a sandbox tenant, or set '
|
| 194 |
f'{data_binding._LOCAL_OPT_IN_VAR}=1 to opt in deliberately.')
|