ci: introduce ZitPlane P05 verification foundation
This commit is contained in:
1 parent
7ecf531697
commit
42b79362c1
32 files changed
+1731
-471
No files matched your search
@@ -0,0 +1,39 @@
|
||||
"""Read-only OIDC smoke: disposable Docker network only; not a login E2E."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from urllib.parse import urlparse
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
PROXY = os.environ.get("ZITPLANE_CI_PROXY", "http://proxy")
|
||||
EXPECTED_ISSUER = "http://localhost:8080"
|
||||
HOST = "localhost:8080"
|
||||
|
||||
def fetch(path: str):
|
||||
request = Request(PROXY + path, headers={"Host": HOST, "Accept": "application/json"})
|
||||
with urlopen(request, timeout=20) as reply:
|
||||
if reply.status != 200:
|
||||
raise RuntimeError(f"HTTP {reply.status}: {path}")
|
||||
return reply.read()
|
||||
|
||||
def main() -> None:
|
||||
fetch("/debug/ready")
|
||||
print("ZITPLANE_BACKEND_READY_PASS")
|
||||
discovery = json.loads(fetch("/.well-known/openid-configuration"))
|
||||
if discovery.get("issuer") != EXPECTED_ISSUER:
|
||||
raise RuntimeError("OIDC issuer does not match local dev origin")
|
||||
for field in ("authorization_endpoint", "token_endpoint", "jwks_uri"):
|
||||
value = discovery.get(field)
|
||||
if not isinstance(value, str) or not value.startswith(EXPECTED_ISSUER + "/"):
|
||||
raise RuntimeError(f"Missing/unsafe OIDC {field}")
|
||||
print("ZITPLANE_OIDC_DISCOVERY_PASS")
|
||||
jwks_path = urlparse(discovery["jwks_uri"]).path
|
||||
jwks = json.loads(fetch(jwks_path))
|
||||
if not isinstance(jwks.get("keys"), list):
|
||||
raise RuntimeError("Invalid JWKS shape")
|
||||
print("ZITPLANE_OIDC_JWKS_PASS")
|
||||
print("ZITPLANE_OIDC_INTERACTIVE_E2E_BLOCKED: no disposable OIDC app/user provisioning in P05")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user