Documentation
¶
Overview ¶
Package contract wires the organization plugin's intent surface into the forge-dashboard contract registry. The `/organizations` page itself remains declared on the auth contributor — only the intent handlers + their declarations move here. Cross-contributor invocations work because the dashboard's contract dispatcher routes by intent name globally.
handlers.go: organization intent handlers owned by the organization plugin. Phase D.3 moved these from the auth contributor's handlers_organizations.go. The plugin handle arrives via Deps so we skip the engine.Plugin("organization") indirection the auth-contributor version used.
Index ¶
- func Register(d *dispatcher.Dispatcher, reg contract.Registry, wreg contract.WardenRegistry, ...) error
- type AddMemberInput
- type CreateInvitationInput
- type CreateInvitationResponse
- type CreateOrgInput
- type DeleteOrgInput
- type Deps
- type GetOrgInput
- type InvitationSummary
- type InvitationsListResponse
- type ListInvitationsInput
- type ListMembersInput
- type MemberSummary
- type MembersListResponse
- type OrgDetail
- type OrgListResponse
- type OrgService
- type OrgSummary
- type RemoveMemberInput
- type UpdateOrgInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register( d *dispatcher.Dispatcher, reg contract.Registry, wreg contract.WardenRegistry, deps Deps, ) error
Types ¶
type AddMemberInput ¶
type CreateInvitationInput ¶
type CreateInvitationResponse ¶
type CreateInvitationResponse struct {
InvitationSummary
Token string `json:"token"`
}
type CreateOrgInput ¶
type DeleteOrgInput ¶
type DeleteOrgInput struct {
ID string `json:"id"`
}
type Deps ¶
type Deps struct {
Engine *authsome.Engine
Plugin OrgService
}
Deps carries the typed plugin handle alongside the engine so the handlers can call CreateOrganization / GetOrganization / etc. directly without engine.Plugin("organization") indirection. Plugin is typed as the local OrgService interface (cycle avoidance).
type GetOrgInput ¶
type GetOrgInput struct {
ID string `json:"id"`
}
type InvitationSummary ¶
type InvitationsListResponse ¶
type InvitationsListResponse struct {
Invitations []InvitationSummary `json:"invitations"`
}
type ListInvitationsInput ¶
type ListInvitationsInput struct {
OrgID string `json:"orgId"`
}
type ListMembersInput ¶
type ListMembersInput struct {
OrgID string `json:"orgId"`
}
type MemberSummary ¶
type MembersListResponse ¶
type MembersListResponse struct {
Members []MemberSummary `json:"members"`
}
type OrgListResponse ¶
type OrgListResponse struct {
Organizations []OrgSummary `json:"organizations"`
}
type OrgService ¶
type OrgService interface {
AdminListOrganizations(ctx context.Context, appID id.AppID) ([]*organization.Organization, error)
GetOrganization(ctx context.Context, orgID id.OrgID) (*organization.Organization, error)
CreateOrganization(ctx context.Context, o *organization.Organization) error
UpdateOrganization(ctx context.Context, o *organization.Organization) error
DeleteOrganization(ctx context.Context, orgID id.OrgID) error
ListMembers(ctx context.Context, orgID id.OrgID) ([]*organization.Member, error)
AddMember(ctx context.Context, m *organization.Member) error
RemoveMember(ctx context.Context, memberID id.MemberID) error
ListInvitations(ctx context.Context, orgID id.OrgID) ([]*organization.Invitation, error)
CreateInvitation(ctx context.Context, inv *organization.Invitation) error
}
OrgService is the surface of the organization plugin the contract handlers need. Declared here as an interface so this package doesn't import plugins/organization directly (which would create a cycle: plugins/organization → plugins/organization/contract → plugins/organization). The parent plugin's contract.go satisfies this interface by passing its own *Plugin into Deps.
type OrgSummary ¶
type RemoveMemberInput ¶
type RemoveMemberInput struct {
ID string `json:"id"`
}