feat: enforce allocated join roster admission

This commit is contained in:
Josh Creek
2026-09-01 08:39:56 +01:00
parent d8ea2f4ac7
commit 68d832f7bc
6 changed files with 85 additions and 2 deletions
+3
View File
@@ -75,6 +75,7 @@ static func specs() -> Array[Spec]:
out.append(Spec.new("server-image-digest", Kind.STRING, "", "allocation", "Expected immutable server image digest (sha256:...)"))
out.append(Spec.new("transport", Kind.STRING, "", "allocation", "Assigned transport: steam_sdr or enet"))
out.append(Spec.new("region", Kind.STRING, "", "allocation", "Assigned region: EU or NA"))
out.append(Spec.new("join-authorisations-file", Kind.STRING, "", "allocation", "JSON array of control-plane signed join envelopes mounted for this match"))
return out
@@ -266,6 +267,8 @@ func _validate() -> void:
errors.append("--allocated-mode requires --%s" % key)
if int(values["assignment-expiry-unix"]) <= int(Time.get_unix_time_from_system()):
errors.append("--assignment-expiry-unix must be in the future")
if String(values["join-authorisations-file"]).is_empty():
errors.append("--join-authorisations-file is required in allocated mode")
var digest := String(values["server-image-digest"])
if not _is_sha256_digest(digest):
errors.append("--server-image-digest must be sha256:<64 hex characters>")