Documentation
¶
Overview ¶
Package subscription exposes the Anthropic subscription registration policy boundary. It deliberately has no credential, request, or discovery implementation: the current policy is to reject unsanctioned third-party registration attempts before they can become an inference flow.
Index ¶
- Constants
- type RegistrationGate
- func (g RegistrationGate) EvidenceURLs() []string
- func (g RegistrationGate) Format(state fmt.State, verb rune)
- func (g RegistrationGate) LogValue() slog.Value
- func (g RegistrationGate) Provider() llm.Provider
- func (g RegistrationGate) Require() error
- func (g RegistrationGate) ReviewedAt() time.Time
- func (g RegistrationGate) ReviewedDate() string
- func (g RegistrationGate) Status() Status
- type Status
- type UnsupportedRegistrationError
Constants ¶
const ( // third-party subscription-registration contract. StatusUnavailable Status = "unavailable" // StatusBlocked means callers must not proceed through this gate. StatusBlocked Status = "blocked" // RegistrationStatusUnavailable and RegistrationStatusBlocked are explicit // aliases for callers that prefer the longer enum names. RegistrationStatusBlocked = StatusBlocked )
const ( EvidenceAuthenticationURL = "https://code.claude.com/docs/en/authentication" EvidenceLegalURL = "https://code.claude.com/docs/en/legal-and-compliance" EvidenceAgentOverviewURL = "https://code.claude.com/docs/en/agent-sdk/overview" EvidenceAgentQuickstartURL = "https://code.claude.com/docs/en/agent-sdk/quickstart" EvidenceThirdPartyUsageURL = "https://support.claude.com/en/articles/13189465-log-in-to-your-claude-account" )
The evidence set is deliberately fixed and bounded. These are documentation references only; no value from them is used to construct a request.
const ReviewedAtDate = "2026-08-09"
ReviewedAtDate is the date on which the official evidence for this gate was reviewed. It is a date, not a timestamp, so it has no local-time ambiguity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegistrationGate ¶
type RegistrationGate struct {
// contains filtered or unexported fields
}
RegistrationGate is an immutable, provider-specific registration policy. Its state is private so callers can only observe copies of the metadata. Require always fails closed for the current Anthropic subscription policy.
func AnthropicRegistration ¶
func AnthropicRegistration() RegistrationGate
AnthropicRegistration returns the current Anthropic subscription registration gate. Every call returns an independent value; its evidence accessor also returns a fresh copy.
func (RegistrationGate) EvidenceURLs ¶
func (g RegistrationGate) EvidenceURLs() []string
EvidenceURLs returns a bounded copy of the official evidence URL metadata.
func (RegistrationGate) Format ¶
func (g RegistrationGate) Format(state fmt.State, verb rune)
Format keeps diagnostics from reflecting private fields. The gate contains only bounded policy metadata today, but this formatter makes that boundary durable if the representation grows later.
func (RegistrationGate) LogValue ¶
func (g RegistrationGate) LogValue() slog.Value
LogValue exposes only the safe gate state needed for policy diagnostics; evidence URLs and any future registration fields are intentionally omitted.
func (RegistrationGate) Provider ¶
func (g RegistrationGate) Provider() llm.Provider
Provider reports the provider policy label covered by the gate.
func (RegistrationGate) Require ¶
func (g RegistrationGate) Require() error
Require rejects use of this registration path. A zero-value gate also fails closed, so an uninitialized value cannot accidentally authorize a flow.
func (RegistrationGate) ReviewedAt ¶
func (g RegistrationGate) ReviewedAt() time.Time
ReviewedAt reports the UTC midnight at which the evidence was reviewed.
func (RegistrationGate) ReviewedDate ¶
func (g RegistrationGate) ReviewedDate() string
ReviewedDate reports the reviewed-at date in ISO-8601 calendar form.
func (RegistrationGate) Status ¶
func (g RegistrationGate) Status() Status
Status reports the gate's fail-closed status.
type UnsupportedRegistrationError ¶
type UnsupportedRegistrationError struct{}
UnsupportedRegistrationError is the redaction-safe, typed failure returned by a blocked subscription registration gate. It intentionally carries no caller input or provider-controlled value.
func (*UnsupportedRegistrationError) Error ¶
func (e *UnsupportedRegistrationError) Error() string
Error reports the stable policy boundary without exposing registration details that are not part of a sanctioned public contract.
func (*UnsupportedRegistrationError) Format ¶
func (e *UnsupportedRegistrationError) Format(state fmt.State, verb rune)
Format keeps every fmt verb redaction-safe. In particular, %#v must not fall back to reflecting an error's fields, and unsupported verbs must not trigger a formatting diagnostic containing implementation details.
func (*UnsupportedRegistrationError) LogValue ¶
func (e *UnsupportedRegistrationError) LogValue() slog.Value
LogValue prevents structured logging from reflecting the error value or attempting to serialize fields that could later become caller-controlled.