Documentation
¶
Overview ¶
Package tenancy defines tier-neutral organization scoping primitives.
Index ¶
Constants ¶
const DefaultOrgID = "default"
DefaultOrgID is the organization used when no explicit organization is supplied. It preserves the single-tenant OSS data layout.
Variables ¶
This section is empty.
Functions ¶
func NormalizeOrgID ¶
NormalizeOrgID returns a non-empty organization ID.
Types ¶
type OrgScope ¶
OrgScope is the ordered set of organizations a data read may see. Write is where new records go. Read is ordered by precedence, with Write first.
func DefaultOrgScope ¶
func DefaultOrgScope() OrgScope
DefaultOrgScope returns the single-tenant OSS scope.
func NewOrgScope ¶
NewOrgScope constructs a normalized scope. The write organization is always first, blank read organizations normalize to default, and duplicates are removed without changing precedence.
func ScopeForWrite ¶ added in v1.4.26
ScopeForWrite returns source's trusted read scope when it is pinned to the requested write org. A missing or mismatched source fails closed to a single-org scope for writeOrg.
func (OrgScope) Contains ¶ added in v1.4.26
Contains reports whether orgID is in the normalized read scope.
func (OrgScope) Normalized ¶
Normalized returns a valid, independently owned copy of the scope.
type ScopeSource ¶ added in v1.4.26
type ScopeSource interface {
OrgScope() OrgScope
}
ScopeSource exposes a trusted organization scope computed by a storage or tenancy boundary. Implementations must not derive it from request input.