the-custodian/docs/changes/netkingdom-target-2026-10-17/apps-access-engine-integration-r2/access-engine-source/internal/decision/json_profile.go
codex d6168526c5
Some checks are pending
CI Smoke / host-smoke (push) Waiting to run
CI Smoke / container-smoke (push) Waiting to run
Reject generated-only commits / generated-commit-guard (push) Waiting to run
docs: preserve reviewed NetKingdom session artifacts
2026-11-01 23:18:14 +01:00

25 lines
959 B
Go

package decision
import "context"
// LosslessJSONProfile is an explicit optional wire decoder profile for the
// normal /v1/check handler. Legacy callers retain their original float64
// projection. The canonical request and signature algorithms are unchanged.
const LosslessJSONProfile = "lossless-json-v1"
const losslessStandaloneMode = "standalone/lossless-json-v1"
type jsonProfileContextKey struct{}
// WithLosslessJSONProfile is called only by the producer after selecting its
// UseNumber decoder. No request/body flag can install this context key. The
// signed provenance mode authenticates which decoder produced the decision.
func WithLosslessJSONProfile(ctx context.Context) context.Context {
return context.WithValue(ctx, jsonProfileContextKey{}, LosslessJSONProfile)
}
func envelopeMode(ctx context.Context) string {
if ctx.Value(jsonProfileContextKey{}) == LosslessJSONProfile {
return losslessStandaloneMode
}
return "standalone"
}