feat(platform): forward protected requests to run

This commit is contained in:
npc0-hue
2026-07-30 09:58:41 +08:00
parent 99be8f0f3a
commit 1e004dc9ec
16 changed files with 484 additions and 7 deletions
+1
View File
@@ -131,6 +131,7 @@ type GameClientBridgeCommand struct {
ProfileKey string
CommandType string
Payload map[string]any
RunJobID string
IdempotencyKey string
Priority int
State GameClientBridgeCommandState
+31
View File
@@ -22,6 +22,7 @@ type RunJobAssignment struct {
ExecutionInput JobExecutionInput
LeaseToken string
Attempt int
FencingToken uint64
MaxAttempts int
AckDeadlineAt time.Time
LeaseExpiresAt time.Time
@@ -168,6 +169,32 @@ type SourceRCONExecutionInput struct {
Command string
}
// ProtectedRequestExecutionInput is returned exactly once to the active,
// fenced Run lease. RequestText is never persisted in a job or bridge command.
type ProtectedRequestExecutionInputRequest struct {
RunEndpointID string
SessionToken string
JobID string
LeaseToken string
Attempt int
FencingToken uint64
}
type ProtectedRequestExecutionInput struct {
JobID string
ServerInstanceID string
RunEndpointID string
FencingToken uint64
Authorized bool
ApprovalState string
QueueState string
ExpiresAt time.Time
Kind string
TransportKey string
TargetKey string
RequestText string
}
type RunUpdateInputRequest struct {
RunEndpointID string
SessionToken string
@@ -355,6 +382,10 @@ func CopySourceRCONExecutionInput(input SourceRCONExecutionInput) SourceRCONExec
return input
}
func CopyProtectedRequestExecutionInput(input ProtectedRequestExecutionInput) ProtectedRequestExecutionInput {
return input
}
func CopyRunUpdateChunk(chunk RunUpdateChunk) RunUpdateChunk {
chunk.Payload = append([]byte(nil), chunk.Payload...)
return chunk