package auth import "context" const runnerContextKey contextKey = iota + 1 // RunnerIdentity represents an authenticated runner in the request context. type RunnerIdentity struct { ID string Name string Tags []string } // RunnerFromContext extracts the authenticated runner from the request context. // Returns nil if no runner is present. func RunnerFromContext(ctx context.Context) *RunnerIdentity { r, _ := ctx.Value(runnerContextKey).(*RunnerIdentity) return r } // ContextWithRunner returns a new context carrying the given runner identity. func ContextWithRunner(ctx context.Context, r *RunnerIdentity) context.Context { return context.WithValue(ctx, runnerContextKey, r) }