Documentation
¶
Overview ¶
Package conformance provides the contract tests every identity broker implementation, an identitybroker.Core and identitybroker.CredentialVerifier, passes.
Importing testing from this non-test package is intentional: each implementation's tests call Run with a factory for fresh, empty instances. Most cases call the implementation the way Mecatl does, through identitybroker.NewInProcess, so the authentication step is always taken; cases about the calling workload call the Core directly. Cases are grouped by area, one file per area, so later work adds its cases in its own file.
Index ¶
Constants ¶
const ReviewerExcludedTool = "pull_request_merge"
ReviewerExcludedTool is the one tool the code reviewer's ceiling excludes, by its name on the github server.
Variables ¶
var ( MainDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceSystem, Name: identitybroker.BuiltinMain, Revision: "v1"} ReviewerDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceGlobal, Name: "code-reviewer", Revision: "r1"} // DeployerDefinition's ceiling allows every github tool, merge included. DeployerDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceGlobal, Name: "deployer", Revision: "d1"} // ToolLessDefinition's ceiling grants nothing. ToolLessDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceGlobal, Name: "tool-less", Revision: "t1"} // ListedDefinition references github and calendar and lists ListedTools // of github's in its tools, so its ceiling allows only those and github's // sign-in tool, and nothing on calendar, as the loader resolves it. ListedDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceGlobal, Name: "pr-tools", Revision: "p1"} // The built-ins of helper agents that run no named definition. ExplorerDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceSystem, Name: identitybroker.BuiltinExplorer, Revision: "v1"} BranchDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceSystem, Name: identitybroker.BuiltinBranch, Revision: "v1"} MemberDefinition = identitybroker.DefinitionRef{Source: identitybroker.SourceSystem, Name: identitybroker.BuiltinMember, Revision: "v1"} )
The definitions the contract registers agents with, all in Definitions. An implementation's own tests may register with them too; nothing modifies them.
Functions ¶
func DefinitionRefs ¶ added in v0.0.53
func DefinitionRefs() []identitybroker.DefinitionRef
DefinitionRefs returns the references of the records Definitions returns, in the same order: what an implementation under test has loaded. Each call returns a new slice.
func Definitions ¶ added in v0.0.53
func Definitions() []identitybroker.DefinitionRecord
Definitions returns the definition records an implementation under test loads: one for each of DefinitionRefs, the built-ins a release ships, a global code reviewer, deployer, tool-less agent, and an agent with a list of github tools. The tool-less agent's ceiling grants nothing, and the listed agent's only ListedTools and the gateway's sign-in tool on github. Every other ceiling grants the github and calendar servers; the reviewer's excludes ReviewerExcludedTool on github. Each call returns new records.
func ListedTools ¶ added in v0.0.53
func ListedTools() []string
ListedTools returns the github tools the ListedDefinition's ceiling names, by their name on the server, sorted: ReviewerExcludedTool and a read. Each call returns a new slice.
func SameSession ¶ added in v0.0.53
func SameSession(a, b identitybroker.Session) bool
SameSession reports whether a and b are the same view of a session: equal fields, with Tools compared by content, as each view holds its own.
Types ¶
type Factory ¶
type Factory func(t *testing.T, now func() time.Time) Implementation
Factory returns a fresh, empty implementation for one test, which reads the time from now and has loaded exactly the records Definitions returns. Each implementation it returns has its own signing key.
type Implementation ¶
type Implementation interface {
identitybroker.Core
identitybroker.CredentialVerifier
}
Implementation is an identity broker under test: the Core Mecatl's calls reach and the CredentialVerifier the broker's own checks and AS-1 call.