// Package agsbridge owns the trusted context, identity mapping, and internal
// request primitives used by MeshX to call embedded AGS.
package agsbridge

import "context"

type siteAdminKey struct{}

// ContextWithSiteAdmin marks ctx as a trusted MeshX internal site-admin call.
func ContextWithSiteAdmin(ctx context.Context) context.Context {
	return context.WithValue(ctx, siteAdminKey{}, true)
}

// SiteAdminFromContext reports whether ctx came from a trusted MeshX internal
// site-admin caller.
func SiteAdminFromContext(ctx context.Context) bool {
	value, _ := ctx.Value(siteAdminKey{}).(bool)
	return value
}
