Documentation
¶
Overview ¶
Package sponsored holds what the broker and the factory must agree on for a sponsored principal: the names neither may give one, and the shape of the git ref it may send.
Index ¶
- Variables
- func FormatChatIdentity(provider, workspace, user string) string
- func IsChatProvider(p string) bool
- func IsReserved(name string) bool
- func SlackParts(s string) (team, user string, ok bool)
- func ValidChatParts(provider, workspace, user string) bool
- func ValidRef(ref string) bool
- type ChatIdentity
Constants ¶
This section is empty.
Variables ¶
var ChatProviders = []string{"slack", "teams", "matrix"}
ChatProviders are the chat providers an identity may name; anything else is refused.
var ErrBadChatIdentity = errors.New("not a chat identity: chat:<provider>:<workspace>/<user> or slack:<team>/<user>")
ErrBadChatIdentity is an onBehalfOf that is not chat:<provider>:<workspace>/<user> or its slack:<team>/<user> alias.
var Reserved = []string{"factory", "runlore", "scheduler", "room-broker", "policy", "upkeep"}
Reserved are names another component answers to: the fleet, the two system intakes, the broker, the policy engine and cron upkeep. A sponsored principal never takes one (C22).
Functions ¶
func FormatChatIdentity ¶ added in v0.59.0
FormatChatIdentity is the canonical chat:<provider>:<workspace>/<user>. It does not validate.
func IsChatProvider ¶ added in v0.59.0
IsChatProvider reports whether p is one of ChatProviders.
func IsReserved ¶
IsReserved reports whether name is one of Reserved.
func SlackParts ¶ added in v0.59.0
SlackParts is the Slack team and user of an identity in either form; ok is false when s is not a valid identity or names another provider.
func ValidChatParts ¶ added in v0.59.0
ValidChatParts reports whether the three parts make a chat identity: a known provider, and a workspace and user of the safe charset (Slack's are held to its T… and U…/W… shapes).
Types ¶
type ChatIdentity ¶ added in v0.59.0
type ChatIdentity struct {
Provider, Workspace, User string
}
ChatIdentity is a chat user as a sponsored principal names them: the provider, the workspace (Slack team, Teams tenant, Matrix homeserver) and the user in it.
func ParseChatIdentity ¶ added in v0.59.0
func ParseChatIdentity(s string) (ChatIdentity, error)
ParseChatIdentity reads the canonical chat:<provider>:<workspace>/<user>, or the legacy slack:<team>/<user>, which it normalizes to provider "slack". It is the one parser the broker and the factory share.
func (ChatIdentity) String ¶ added in v0.59.0
func (c ChatIdentity) String() string
String is the canonical form, chat:<provider>:<workspace>/<user>.