Documentation
¶
Overview ¶
Package sessionhttp supplies explicitly selected session HTTP integrations. Base identity/http does not import this module or any optional session owner.
Index ¶
- func NewFeature(c SignOutConfig) (identityhttp.Feature, error)
- func NewFeatureWithMiddleware(c SignOutConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
- func NewFeatureWithPreAuth(c SignOutConfig, p PreAuthConfig) (identityhttp.Feature, error)
- func NewFeatureWithPreAuthAndMiddleware(c SignOutConfig, p PreAuthConfig, ...) (identityhttp.Feature, error)
- func NewGetHandler(c GetConfig) (http.Handler, error)
- func NewGetHandlerWithMiddleware(c GetConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
- func NewMetadataRouter(ctx context.Context, document identityhttp.DocumentConfig, c MetadataConfig, ...) (http.Handler, identityhttp.OpenAPIDocument, error)
- func NewPreAuthFeature(c PreAuthConfig) (identityhttp.Feature, error)
- func NewPreAuthFeatureWithBrowserDevice(c PreAuthConfig, devices session.BrowserDeviceConfig) (identityhttp.Feature, error)
- func NewPreAuthFeatureWithBrowserDeviceAndMiddleware(c PreAuthConfig, devices session.BrowserDeviceConfig, ...) (identityhttp.Feature, error)
- func NewPreAuthFeatureWithMiddleware(c PreAuthConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
- func NewPreAuthHandler(c PreAuthConfig) (http.Handler, error)
- func NewPreAuthHandlerWithBrowserDevice(c PreAuthConfig, devices session.BrowserDeviceConfig) (http.Handler, error)
- func NewPreAuthHandlerWithBrowserDeviceAndMiddleware(c PreAuthConfig, devices session.BrowserDeviceConfig, ...) (http.Handler, error)
- func NewPreAuthHandlerWithMiddleware(c PreAuthConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
- func NewSignOutHandler(c SignOutConfig) (http.Handler, error)
- func NewSignOutHandlerWithMiddleware(c SignOutConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
- type AnonymousGetConfig
- type AnonymousResponse
- type GetConfig
- type GetResponse
- type GetState
- type MetadataConfig
- type PreAuthConfig
- type PreAuthIdentifierBinder
- type PreAuthMethod
- type PreAuthResponse
- type PreAuthService
- type PreAuthState
- type Principal
- type Session
- type SignOutConfig
- type SignOutRecovery
- type SignOutResponse
- type SignOutState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFeature ¶
func NewFeature(c SignOutConfig) (identityhttp.Feature, error)
NewFeature constructs the currently implemented session get/self-signout contribution from real typed owner services, without IO or registration. It requires one consistent explicit GetConfig/SignOutConfig; nil/zero/closed owners deny atomically. Only those two operations are contributed, not future session capabilities. Cookie uses exact origin and active primary synchronizer state, with no independent token-age claim; bearer contributes CSRFNone and never borrows cookie authority. Disabled means omit this feature entirely.
Pass the returned immutable contribution to FeatureServices and NewSelectedHandler. Base HTTP never imports this integration. Domain stores, transactions, authentication, CSRF and rate remain owned by the configured handlers/services. Construction copies metadata; borrowed dependencies must outlive concurrent requests. Separate owned Wire contributions describe the actual selected JSON, credential and CSRF profile for NewDocumentedHandler; direct-contract summaries never become wire response schemas.
func NewFeatureWithMiddleware ¶
func NewFeatureWithMiddleware(c SignOutConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
NewFeatureWithMiddleware contributes the same two real operations with the selected trusted middleware applied independently at their owned phases. After-auth hooks obtain either GetState or SignOutState through PipelineValue; no shared global principal or duplicate authentication/rate owner is added. All selected dependencies are validated before wrapper construction. Hooks may be constructed once per operation and must support concurrent requests. The factory returns no partial feature on failure; it performs no owner IO.
func NewFeatureWithPreAuth ¶
func NewFeatureWithPreAuth(c SignOutConfig, p PreAuthConfig) (identityhttp.Feature, error)
NewFeatureWithPreAuth explicitly combines session reads/logout with original flow initiation under their single canonical session owner. NewFeature remains unchanged. No owner dependency is optional when this combined profile is used.
func NewFeatureWithPreAuthAndMiddleware ¶
func NewFeatureWithPreAuthAndMiddleware(c SignOutConfig, p PreAuthConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
NewFeatureWithPreAuthAndMiddleware retains each operation's typed phases. Both profiles are validated before returning a contribution; construction performs no owner IO and never returns a partial selection on failure.
func NewGetHandler ¶
NewGetHandler constructs only GET /v1/session/get, without registration or IO. It validates the request envelope, exact HTTPS tenant host, non-keyed empty request and explicitly selected credential channel before owner access. Cookie mode rejects Authorization; bearer mode ignores ambient cookies and never falls back. All decisions use canonical rate.safe admission. Positive owner custody is checked again after rate work, preserving original expiry. Success is 200 authenticated metadata or enumeration-safe unauthenticated; malformed input is 400, wrong host/realm 421, wrong path 404/method 405, rate denial 429 with Retry-After, operational/cancellation failure 503. Every response is no-store, nosniff JSON and never emits Set-Cookie. No read updates activity, rotates credentials, refreshes authority or starts work in a goroutine. The server retains body/connection cleanup and bounded writes. This handler alone is not full feature/router/OpenAPI or browser qualification.
func NewGetHandlerWithMiddleware ¶
func NewGetHandlerWithMiddleware(c GetConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
NewGetHandlerWithMiddleware preserves NewGetHandler's transport and security contract while exposing real typed execution boundaries. Decode acquires original network/credential input, Authenticate performs the single owner read, Admit applies the single safe-route admission, and Handle rechecks the original owner validity after before-handler hooks before serializing. Middleware follows identityhttp.NewOperationPipeline's trusted synchronous ownership rules. Its typed GetState discloses no credential material; detached request headers still contain original credentials and must never be logged or retained. Hooks have no readable body. After-handler observes attempts, not transaction commits. Read response protections also cover hook short circuits: no-store/nosniff JSON media type and no Set-Cookie. Hooks own their bounded JSON denial body. Constructor validation performs no owner reads or rate admission.
func NewMetadataRouter ¶
func NewMetadataRouter(ctx context.Context, document identityhttp.DocumentConfig, c MetadataConfig, services identityhttp.FeatureServices, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, identityhttp.OpenAPIDocument, error)
NewMetadataRouter explicitly adds protected GET /openapi.json to selected services and constructs their secure router and exact immutable OpenAPI snapshot. Neither session routes nor public metadata are implicitly selected. Selecting a competing metadata route fails atomically. Construction invokes no authentication, authorization, rate, readiness or domain work.
The real owner phases are bounded decode -> one session read -> one shared rate.safe admission -> revision-fenced explicit administrator authorization -> exact snapshot export. Missing/inactive sessions return401; explicit policy deny returns403; stale/error/expired authority returns503; rate denial429. A 401 challenge names Bearer for bearer mode or the private Session scheme for cookie mode; it never advertises credential fallback or redirects. Shared transport rejects plaintext with JSON https_required (403); disabled cross-origin access returns fixed text/plain origin_denied (403, or408 when cancellation is observed during origin admission), before session work. Cookies never replace selected bearer credentials; cookie mode rejects Authorization. Metadata GET mutates nothing and emits no cookie or secret. Original session validity is rechecked after rate/policy work and hooks; no copied evidence gains freshness. Middleware observes the actual GetState.
Transport uses Read.Network and Read.MaximumDuration; CORS grants are disabled. Other selected features must share those policies and retain their own owners. Global hooks require every selected handler to support the existing binder. Start the returned handler with NewHTTPServer for bounded raw IO/streaming. This is an optional session profile, not JWT/API-key administration, public realm mapping, a complete reference server or release qualification.
func NewPreAuthFeature ¶
func NewPreAuthFeature(c PreAuthConfig) (identityhttp.Feature, error)
NewPreAuthFeature selects only original browser-flow initiation. It does not select session reads, logout or OTP operations. Omit this contribution to disable its route and metadata. Construction validates borrowed dependencies without IO; their concurrency and lifetime contracts remain unchanged.
func NewPreAuthFeatureWithBrowserDevice ¶
func NewPreAuthFeatureWithBrowserDevice(c PreAuthConfig, devices session.BrowserDeviceConfig) (identityhttp.Feature, error)
NewPreAuthFeatureWithBrowserDevice selects original flow initiation with non-authenticating browser correlation. Omission disables both its route and metadata; the existing flow-only feature remains unchanged.
func NewPreAuthFeatureWithBrowserDeviceAndMiddleware ¶
func NewPreAuthFeatureWithBrowserDeviceAndMiddleware(c PreAuthConfig, devices session.BrowserDeviceConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
NewPreAuthFeatureWithBrowserDeviceAndMiddleware selects the protected real dual-cookie pipeline with typed hooks and accurate selected wire metadata.
func NewPreAuthFeatureWithMiddleware ¶
func NewPreAuthFeatureWithMiddleware(c PreAuthConfig, middleware []identityhttp.MiddlewareDescriptor) (identityhttp.Feature, error)
NewPreAuthFeatureWithMiddleware contributes the same real handler with its owned typed phases and concrete wire schema. Hooks cannot substitute original admission or manufacture cookie delivery. No global registration is used.
func NewPreAuthHandler ¶
func NewPreAuthHandler(c PreAuthConfig) (http.Handler, error)
NewPreAuthHandler constructs only POST /v1/session/preauth-issue, with no registration or IO. Without Methods or IdentifierBinder, strict JSON accepts only optional boolean remember; absence selects configured default and null is invalid. Query, trailers, Idempotency-Key and Authorization are forbidden. Ambient cookies confer no authority and are ignored: a deliberate fresh start creates an independent flow. Exact HTTPS tenant host and configured Origin precede IP-only rate.auth, command generation, Prepare and Issue. There is no automatic retry. Only a fresh exact error-free native commitment emits its secure flow cookie; replay, outage, cancellation, mismatched state and ambiguity emit none. Responses are no-store/nosniff JSON: 200 issued, 400 malformed, 403 origin, 404 path, 405 method, 421 host, 429 rate, 409 conflict/in-progress, 503 unavailable. Native recovery stays outcome-only. Handler alone does not advertise a feature, satisfy browser/reference journeys or establish full release qualification. Explicit Methods additionally accepts an optional exact string method. It selects a frozen deployment profile; omission retains the base profile. Unknown names or malformed selection deny before rate debit or owner work. Explicit IdentifierBinder profiles additionally require bounded identifier; unbound profiles forbid it. Binding runs after IP admission before Prepare.
func NewPreAuthHandlerWithBrowserDevice ¶
func NewPreAuthHandlerWithBrowserDevice(c PreAuthConfig, devices session.BrowserDeviceConfig) (http.Handler, error)
NewPreAuthHandlerWithBrowserDevice explicitly selects a server-random, non-authenticating browser correlation cookie alongside original flow issuance. Absent custody is issued only after IP admission; valid custody keeps its original expiry and is never redelivered. Malformed, duplicated, expired or tenant/origin-mismatched custody denies before owner preparation. Both new cookies are withheld on failure, replay, ambiguity or cancellation. Device configuration is validated and copied without IO. Clearing or copying the cookie can evade/share correlation; independent IP/identifier controls remain necessary. Existing flow-only constructors are unchanged.
func NewPreAuthHandlerWithBrowserDeviceAndMiddleware ¶
func NewPreAuthHandlerWithBrowserDeviceAndMiddleware(c PreAuthConfig, devices session.BrowserDeviceConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
NewPreAuthHandlerWithBrowserDeviceAndMiddleware retains real typed phases and protected dual-cookie ownership. Hooks cannot inspect or forge device custody.
func NewPreAuthHandlerWithMiddleware ¶
func NewPreAuthHandlerWithMiddleware(c PreAuthConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
NewPreAuthHandlerWithMiddleware retains the same security contract with real typed pipeline phases. Authenticate is explicitly public/no-user; Admit owns the original-flow rate debit, and Handle owns the single issuance attempt. Hooks cannot manufacture cookie output or inspect the preparation. Detached request headers remain potentially sensitive and must not be logged/retained.
func NewSignOutHandler ¶
func NewSignOutHandler(c SignOutConfig) (http.Handler, error)
NewSignOutHandler constructs only POST /v1/session/signout. Bodies are strict JSON {} or URL-encoded empty fields/one csrf_token; JSON CSRF uses exactly one X-CSRF-Token header. Query parameters and Idempotency-Key are forbidden. Token absence reaches the domain owner: absent/inactive logout succeeds, but active cookie logout requires exact primary transaction-bound CSRF. Present empty, duplicate, malformed or mixed channels always deny. Bearer rejects CSRF input and ignores ambient cookies, never falling back or deleting their transport. Exact HTTPS host determines tenant. rate.safe admission precedes mutation; subject discovery is a primary read, not preauthentication database limiting. Only committed error-free or absent/inactive success clears transport. Errors preserve original command/outcome/recovery without automatic retries. Status codes are 200 success, 400 malformed, 403 denial, 404 path, 405 method, 421 host, 429 rate, 409 conflict/in-progress and 503 unavailable/ambiguous/canceled. Responses are no-store/nosniff JSON. Whole-request deadlines never extend the inbound deadline. No goroutines, stores, transactions or journals are added; the server retains bounded body/read/write cleanup. This is not full feature, OpenAPI, native HTTP/browser or release qualification.
func NewSignOutHandlerWithMiddleware ¶
func NewSignOutHandlerWithMiddleware(c SignOutConfig, middleware []identityhttp.MiddlewareDescriptor) (http.Handler, error)
NewSignOutHandlerWithMiddleware preserves NewSignOutHandler's security and recovery contract with real typed hook phases. Decode owns original network, origin, body and credential acquisition; Authenticate performs preliminary subject discovery once; Admit debits safe-route limits once; Handle delegates primary revalidation and transactional CSRF/mutation to the same domain owner. Original preliminary validity is checked after hooks, never renewed by them. After-handler observes the actual attempted outcome, not assumed success. Trusted hooks retain original credential-bearing detached headers: do not log, serialize or retain them. Typed state is opaque/redacted; its getters expose only credential-free detached metadata. Hooks own bounded JSON denial bodies; no hook can clear cookies without confirmed owner success. Shared response policy preserves no-store/nosniff/JSON even on short circuits.
Types ¶
type AnonymousGetConfig ¶
type AnonymousGetConfig struct {
Sessions *session.AnonymousSessionService
Cookie session.CookiePolicy
}
AnonymousGetConfig explicitly selects unprivileged guest recognition beside the permanent cookie profile. Sessions is a constructed, borrowed anonymous owner; Cookie must be valid and named differently from the permanent cookie. Both cookies are decoded strictly. A present permanent cookie selects only permanent validation, even if inactive or unavailable: no guest fallback. This option is cookie-only and never enables a route, signout or metadata administration by itself. Construction copies it without owner IO.
type AnonymousResponse ¶
type AnonymousResponse struct {
Recognized bool `json:"recognized"`
Principal Principal `json:"principal"`
Session Session `json:"session"`
}
AnonymousResponse is explicit, credential-free guest metadata. Recognized means only a live unprivileged guest session; it is never authenticated-user admission, an upgrade proof or refresh authority. The original owner lifetime is retained. Omitted entirely when this profile is unselected or inactive.
type GetConfig ¶
type GetConfig struct {
Network identityhttp.NetworkConfig
Sessions *session.SessionService
Rate *identityhttp.SafeRateLimiter
Transport session.CredentialKind
Cookie session.CookiePolicy
Now func() time.Time
MaximumDuration time.Duration
// Anonymous optionally selects the distinct guest cookie/read profile for
// GET only. It never grants verified-user admission or changes signout.
Anonymous *AnonymousGetConfig
}
GetConfig explicitly selects one transport and immutable network policy. Sessions and Rate must be valid owner-constructed, concurrency-safe services; they remain borrowed and must outlive requests. Share Rate across all routes, never construct it per request. Cookie must be valid even in bearer mode. Now is a trusted prompt concurrency-safe clock. MaximumDuration is 1ms..30s; earlier inbound deadlines win. Construction copies network configuration.
type GetResponse ¶
type GetResponse struct {
Authenticated bool `json:"authenticated"`
Principal *Principal `json:"principal,omitempty"`
Session *Session `json:"session,omitempty"`
NeedsRefresh bool `json:"needsRefresh"`
RefreshEligibleAt *time.Time `json:"refreshEligibleAt,omitempty"`
Anonymous *AnonymousResponse `json:"anonymous,omitempty"`
}
GetResponse is the explicit credential-free read projection. It conveys no reusable authentication authority. Without explicit guest selection, unauthenticated responses omit all subject/session fields. A recognized guest appears only in Anonymous, never the verified Principal/Session fields. Sensitive extension/enrichment data is not implicit.
type GetState ¶
type GetState struct {
// contains filtered or unexported fields
}
GetState is an immutable request-local session-read snapshot. Its private credential and owner result remain inaccessible to middleware. Zero is unauthenticated. Copies never renew the owner's original validity evidence. Obtain it only through identityhttp.PipelineValue[GetState] during a trusted synchronous after-auth or later hook; it is not an authorization proof.
func (GetState) MarshalJSON ¶
MarshalJSON rejects implicit export of the request-local owner snapshot.
func (GetState) MarshalText ¶
MarshalText rejects implicit text/map-key export of the owner snapshot.
type MetadataConfig ¶
type MetadataConfig struct {
Read GetConfig
Authorization authorization.Authorizer
PolicyRevision authorization.Revision
Action authorization.Action
ResourceType authorization.ResourceType
}
MetadataConfig explicitly selects session-authenticated administrator metadata. Read supplies the same valid owner, cookie/bearer, host, clock, duration and shared rate configuration used by session reads; only mapped tenant hosts are supported. Public-host/global administration is not inferred. Authorization is a borrowed concurrency-safe existing policy engine/authorizer; PolicyRevision must be positive. Action and ResourceType are explicit bounded deployment policy identifiers, never request fields or inferred token scopes. The resource ID is always identity.openapi.document. All owners must honor context cancellation and outlive this handler; no owner is closed here.
type PreAuthConfig ¶
type PreAuthConfig struct {
Network identityhttp.NetworkConfig
Service PreAuthService
Rate *identityhttp.AuthRateLimiter
Cookie session.CookiePolicy
Lifetime session.LifetimeConfig
Origin identityhttp.Origin
Action, CallbackURL, PolicyID string
PolicyVersion uint64
Now func() time.Time
MaximumDuration time.Duration
// Purpose zero retains session-issuing login. Phone-password recovery
// requires IdentifierBinder and forbids remember input entirely. Recovery
// alone needs no Lifetime configuration and never resolves session policy.
Purpose session.PreAuthPurpose
// IdentifierBinder optionally requires a target for the base profile.
// Omission preserves the closed remember-only legacy request contract.
IdentifierBinder PreAuthIdentifierBinder
// Methods optionally enables exact named login-method selection. Omission
// keeps the original profile and closed remember-only request contract.
// Profiles share Network, Origin, Rate, Cookie, Lifetime and device custody;
// each borrowed owner must enforce its own fixed original intent. The slice
// is copied at construction. No method, action or policy is auto-registered.
Methods []PreAuthMethod
}
PreAuthConfig freezes one explicit browser initiation profile. Network is copied; Service and Rate are borrowed concurrency-safe owners. Share Rate across requests. Origin, Action, callback and policy are deployment choices, never client input; they must match the selected issuer exactly. Empty callback disables redirects. Cookie must be __Host-identity_flow with Lax/Strict policy. Lifetime resolves remember once for the eventual session, not the fixed five-minute flow. Now is a prompt trusted concurrency-safe clock; MaximumDuration is 1ms..30s and never extends an inbound deadline.
func (PreAuthConfig) Format ¶
func (PreAuthConfig) Format(s fmt.State, _ rune)
Format prevents traversal of borrowed service and deployment configuration.
func (PreAuthConfig) MarshalJSON ¶
func (PreAuthConfig) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit runtime composition export.
func (PreAuthConfig) MarshalText ¶
func (PreAuthConfig) MarshalText() ([]byte, error)
MarshalText rejects implicit deployment configuration export.
type PreAuthIdentifierBinder ¶
type PreAuthIdentifierBinder interface {
BindPreAuthIdentifier(context.Context, identity.TenantID, string) ([32]byte, error)
}
PreAuthIdentifierBinder binds an explicitly selected original target before preparation. The borrowed concurrency-safe owner canonicalizes the bounded raw identifier under its fixed policy and deployment key; it must not look up accounts, authenticate, mutate state, or accept a client-supplied digest. Calls occur after shared IP admission, outside database work, with a bounded context. Return InvalidInputError for invalid input; other errors or a zero binding fail unavailable. Do not log or retain raw identifiers. The reference composition supplies the concrete phone binder; base HTTP imports no workflow.
type PreAuthMethod ¶
type PreAuthMethod struct {
Name string
Service PreAuthService
Action, CallbackURL, PolicyID string
PolicyVersion uint64
// Purpose selects the trusted issuer's exact original profile, not a body
// option. Recovery requires a target binder and carries zero Remember.
Purpose session.PreAuthPurpose
// IdentifierBinder requires identifier only when this exact method is
// selected. Phone/password initiation requires this owner; other methods
// retain their explicitly unbound compatibility profile when it is nil.
IdentifierBinder PreAuthIdentifierBinder
}
PreAuthMethod binds a public selection name to one trusted original-flow owner. Name is 1..32 lowercase ASCII letters, digits or hyphens. Service is borrowed, bounded and concurrency-safe. Action, callback and policy are fixed deployment values, never request overrides. One to sixteen distinct names may be selected; omitted method retains PreAuthConfig's base profile.
func (PreAuthMethod) Format ¶
func (PreAuthMethod) Format(s fmt.State, _ rune)
Format hides borrowed service and trusted deployment bindings.
func (PreAuthMethod) MarshalJSON ¶
func (PreAuthMethod) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit deployment custody export.
func (PreAuthMethod) MarshalText ¶
func (PreAuthMethod) MarshalText() ([]byte, error)
MarshalText rejects implicit deployment custody export.
type PreAuthResponse ¶
type PreAuthResponse struct {
Issued bool `json:"issued"`
CommandID identity.CommandID `json:"commandID,omitempty"`
FlowID identity.PreAuthTransactionID `json:"flowID,omitempty"`
IssuedAt time.Time `json:"issuedAt"`
ExpiresAt time.Time `json:"expiresAt"`
CommitOutcome string `json:"commitOutcome"`
Error string `json:"error,omitempty"`
}
PreAuthResponse exposes only the original credential-free command/flow locator and timeline. It is neither a user session nor active authority. CommitOutcome none means no authoritative observation, not rollback. A known commitment can survive failed delivery. Retain the original locator for native outcome-only recovery; it grants no lookup permission and never renews a flow. Issued is true only when this response delivers the original secure cookie.
type PreAuthService ¶
type PreAuthService interface {
Prepare(context.Context, session.PreAuthPrepareInput) (session.PreparedPreAuthIssuance, error)
Issue(context.Context, session.PreparedPreAuthIssuance) (session.PreAuthIssueResult, error)
}
PreAuthService is the borrowed original-flow owner seam. The selected reference PreAuthService satisfies it without importing reference or stores. Implementations must retain native startup/tenant/shutdown admission, own entropy and authoritative execution, and honor bounded contexts. Issue runs one unchanged preparation; unknown outcomes never authorize another Prepare.
type PreAuthState ¶
type PreAuthState struct {
// contains filtered or unexported fields
}
PreAuthState is opaque request-local public-flow state. It authenticates no user and cannot expose prepared nonce, digest or bearer to middleware. Do not retain it beyond the request. Zero has no attempted issuance.
func (PreAuthState) Attempt ¶
func (s PreAuthState) Attempt() (PreAuthResponse, bool)
Attempt returns detached safe metadata. True means Handle entered, not that native execution committed or a cookie reached the browser.
func (PreAuthState) Format ¶
func (PreAuthState) Format(s fmt.State, _ rune)
Format prevents traversal of private request-local custody.
func (PreAuthState) MarshalJSON ¶
func (PreAuthState) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit request-local export.
func (PreAuthState) MarshalText ¶
func (PreAuthState) MarshalText() ([]byte, error)
MarshalText rejects implicit request-local text export.
type Principal ¶
type Principal struct {
TenantID identity.TenantID `json:"tenantID"`
UserID identity.UserID `json:"userID"`
}
Principal identifies only the admitted owner and exact host-mapped tenant. It is response metadata, not an authorization proof.
type Session ¶
type Session struct {
ID string `json:"id"`
IssuedAt time.Time `json:"issuedAt"`
LastActivityAt time.Time `json:"lastActivityAt"`
ExpiresAt time.Time `json:"expiresAt"`
AbsoluteExpiresAt time.Time `json:"absoluteExpiresAt"`
}
Session exposes stable public read metadata, never lookup/CSRF digests, authority vectors, credential IDs, historical proofs or bearer material.
type SignOutConfig ¶
type SignOutConfig struct {
GetConfig
CookieSignOut *session.CookieSignOutService
BearerSignOut *session.SignOutService
TrustedOrigins []identityhttp.Origin
}
SignOutConfig selects the same immutable transport/network/rate profile as GetConfig. Exactly the selected CookieSignOut or BearerSignOut is required; compose it with the same primary SessionService and cookie policy. Cookie mode requires 1..128 exact trusted HTTPS origins and denies Referer fallback. Bearer mode rejects TrustedOrigins rather than silently using cookie policy. Services are borrowed, concurrency-safe and must outlive requests; no IO or resource ownership is transferred at construction.
type SignOutRecovery ¶
type SignOutRecovery struct {
CommandID identity.CommandID `json:"commandID"`
TenantID identity.TenantID `json:"tenantID"`
UserID identity.UserID `json:"userID,omitempty"`
AnonymousFlowID string `json:"anonymousFlowID,omitempty"`
ActorID identity.ActorID `json:"actorID"`
ActorKind authorization.SubjectKind `json:"actorKind"`
OperationID string `json:"operationID"`
RecordID string `json:"recordID,omitempty"`
LinkMode identity.AccountLinkMode `json:"linkMode,omitempty"`
}
SignOutRecovery is the original durable command's exact scope locator, not authorization or renewed authentication. Query the owned recovery service under current result-access policy before retrying an ambiguous operation. These fields never contain credentials, digests, proof or CSRF material.
type SignOutResponse ¶
type SignOutResponse struct {
SignedOut bool `json:"signedOut"`
ClearBearer bool `json:"clearBearer"`
CommandID identity.CommandID `json:"commandID,omitempty"`
CommitOutcome string `json:"commitOutcome"`
Recovery *SignOutRecovery `json:"recovery,omitempty"`
Error string `json:"error,omitempty"`
}
SignOutResponse is the explicit credential-free success/error projection. CommitOutcome is none, not_committed, committed, unknown, conflict or in_progress. none means no authoritative command observation, not rollback. A committed observation accompanied by an error does not clear transport. ClearBearer instructs the caller to discard only its presented bearer after success; cookie removal is conveyed only by the exact Set-Cookie tuple. CommandID is generated once per admitted call and never replaced or retried.
type SignOutState ¶
type SignOutState struct {
// contains filtered or unexported fields
}
SignOutState is opaque request-local owner state. Principal describes the original preliminary subject read, not reusable authorization. The protected signout service still revalidates primary authority and atomically checks CSRF. The owner alone updates attempted result state; no hook can change it. Zero is unauthenticated and unattempted. State must not be retained beyond a request.
func (SignOutState) Attempt ¶
func (s SignOutState) Attempt() (SignOutResponse, bool)
Attempt returns a detached copy of the original operation's response state. The boolean means Handle entered, not that a transaction committed. Before Handle it is false; a true result may have outcome none/unknown or an error. After-handler observes normally returned attempts; cancellation/panic can suppress that phase. Recovery is a locator, never a retry or access grant.
func (SignOutState) Format ¶
func (SignOutState) Format(s fmt.State, _ rune)
Format redacts private credential, CSRF and historical owner custody.
func (SignOutState) MarshalJSON ¶
func (SignOutState) MarshalJSON() ([]byte, error)
MarshalJSON rejects implicit export of request-local owner custody.
func (SignOutState) MarshalText ¶
func (SignOutState) MarshalText() ([]byte, error)
MarshalText rejects implicit text/map-key export of request-local state.
func (SignOutState) Principal ¶
func (s SignOutState) Principal() (Principal, bool)
Principal returns detached metadata from the preliminary session owner read. It is neither fresh-login evidence nor authority for a future operation.