feat: validate workload-bound result credentials

This commit is contained in:
Josh Creek
2026-08-31 21:20:12 +01:00
parent 8d1b407bb0
commit 79e66c7a95
7 changed files with 149 additions and 8 deletions
+2 -1
View File
@@ -55,6 +55,7 @@ type WorkloadBinding struct {
ServiceAcct string
PodUID string
GameServerUID string
AllocationID string
MatchID string
ServerID string
}
@@ -169,7 +170,7 @@ func RatingEligible(receipt ResultReceipt) bool {
}
func validateBinding(binding WorkloadBinding) error {
if binding.Issuer == "" || binding.Audience == "" || binding.Namespace == "" || binding.ServiceAcct == "" || binding.PodUID == "" || binding.GameServerUID == "" || binding.MatchID == "" || binding.ServerID == "" {
if binding.Issuer == "" || binding.Audience == "" || binding.Namespace == "" || binding.ServiceAcct == "" || binding.PodUID == "" || binding.GameServerUID == "" || binding.AllocationID == "" || binding.MatchID == "" || binding.ServerID == "" {
return ErrResultBinding
}
return nil