MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / PolicyFor

Function PolicyFor

internal/usage/policy.go:34–41  ·  view source on GitHub ↗

PolicyFor returns the metering policy for an account class. Only standard accounts are metered/billed/analyzed; every non-standard class (internal, system, demo) is excluded on all three axes. An unknown/empty value fail-closed defaults to standard so a misclassified account is never silently exempt

(c AccountClass)

Source from the content-addressed store, hash-verified

32// fail-closed defaults to standard so a misclassified account is never silently
33// exempted from billing.
34func PolicyFor(c AccountClass) MeteringPolicy {
35 switch c {
36 case ClassInternal, ClassSystem, ClassDemo:
37 return MeteringPolicy{Meter: false, Bill: false, Analytics: false}
38 default: // ClassStandard and any unrecognized value
39 return MeteringPolicy{Meter: true, Bill: true, Analytics: true}
40 }
41}

Callers 2

TestPolicyForFunction · 0.92
RecordAndCheckMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestPolicyForFunction · 0.74