Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

549 B
Raw Blame
package chat

import "context"

type executeAuthorityContextKey struct{}

// WithExecuteAuthority carries trusted transport authority into read-only
// projection endpoints. The value is server-authored and cannot originate in
// a model/provider payload.
func WithExecuteAuthority(ctx context.Context, allowed bool) context.Context {
	return context.WithValue(ctx, executeAuthorityContextKey{}, allowed)
}

func executeAuthorityFromContext(ctx context.Context) bool {
	allowed, _ := ctx.Value(executeAuthorityContextKey{}).(bool)
	return allowed
}