Documentation
¶
Overview ¶
Package testsupport4datatug builds the stored state a host test needs to exercise DataTug's protected-project role guard end to end. Hosts import it from tests only: it takes a testing.TB, it opens no network client, and it creates the project through the same shared-project service a host serves, so a host does not have to import the DataTug domain packages to seed it.
Index ¶
Constants ¶
const ( SpaceID = "protected_project_space" OwnerUID = "protected_project_owner" MemberUID = "protected_project_member" TargetUID = "protected_project_target" OwnerContactID = "owner_contact" MemberContactID = "member_contact" TargetContactID = "target_contact" )
Identifiers of the stored fixture.
Variables ¶
This section is empty.
Functions ¶
func ContactItemRef ¶
ContactItemRef is the linkage item of a fixture contact.
Types ¶
type ProtectedProject ¶
type ProtectedProject struct {
DB dal.DB
ProjectID string
Service *facade4datatug.SharedProjectService
// Business is the trusted native Business reader to hand to
// host4datatug.ProjectRelationshipMutationPolicies.
Business facade4datatug.BusinessSharedProjectOptions
}
ProtectedProject is a Business-admitted protected DataTug project stored in a caller-owned DAL database (in memory by default). The Space has three members, each with an active contact: the project owner (who holds the project's owner role, the only one that may manage assignments), a second member and a third member. Only the owner is linked to the project.
func NewProtectedProject ¶
func NewProtectedProject(t testing.TB) *ProtectedProject
NewProtectedProject stores the Space, its three contacts and a Business project created by the owner. It sets the reviewed plan settings through t.Setenv, so the test must not be parallel.
func NewProtectedProjectWithDatabase ¶ added in v0.60.11
func NewProtectedProjectWithDatabase(t testing.TB, db dal.DB) *ProtectedProject
NewProtectedProjectWithDatabase reuses the same fixture in a caller-owned emulator. It opens no client and never chooses a production database itself.
func (*ProtectedProject) LinkMemberAsViewer ¶ added in v0.60.11
func (p *ProtectedProject) LinkMemberAsViewer(t testing.TB)
LinkMemberAsViewer uses the existing reciprocal linkage command and native current-owner policy. This is fixture setup, not a decision-auth adapter or production entitlement proof; Business remains synthetic test evidence.
func (*ProtectedProject) ProjectItemRef ¶
func (p *ProtectedProject) ProjectItemRef() coretypes.ItemRef
ProjectItemRef is the stored project's linkage item.
func (*ProtectedProject) SetControlledConnection ¶ added in v0.60.11
func (p *ProtectedProject) SetControlledConnection(t testing.TB, catalogID string, fingerprint dataaccess.Fingerprint)
SetControlledConnection stores a test catalog descriptor. Its fingerprint is fixture metadata, never actual-source identity proof. A host opener must independently bind the real source; catalog editors have no such authority.