添加嵌套 CI 的 SPIRE JWT broker
test / python (pull_request) Successful in 8s
test / shell (pull_request) Successful in 17s

This commit is contained in:
2026-09-16 13:37:40 +00:00
parent 0785d9a403
commit 7c3cd6a921
5 changed files with 114 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
import pytest
from gitea_microvm_runner.jwt_broker import extract_svid
def test_extract_svid_from_spire_json():
assert extract_svid([
{"svids": [{"hint": "", "spiffe_id": "spiffe://example/ci", "svid": "jwt"}]},
{"bundles": {}},
]) == "jwt"
@pytest.mark.parametrize("document", [{}, [], [{"bundles": {}}]])
def test_extract_svid_rejects_unexpected_response(document):
with pytest.raises(ValueError):
extract_svid(document)