testsupport4datatug

package
v0.62.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 31 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func ContactItemRef(contactID string) coretypes.ItemRef

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL