sponsored

package
v0.59.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 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 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

Constants

This section is empty.

Variables

View Source
var ChatProviders = []string{"slack", "teams", "matrix"}

ChatProviders are the chat providers an identity may name; anything else is refused.

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

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

func FormatChatIdentity(provider, workspace, user string) string

FormatChatIdentity is the canonical chat:<provider>:<workspace>/<user>. It does not validate.

func IsChatProvider added in v0.59.0

func IsChatProvider(p string) bool

IsChatProvider reports whether p is one of ChatProviders.

func IsReserved

func IsReserved(name string) bool

IsReserved reports whether name is one of Reserved.

func SlackParts added in v0.59.0

func SlackParts(s string) (team, user string, ok bool)

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

func ValidChatParts(provider, workspace, user string) bool

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).

func ValidRef

func ValidRef(ref string) bool

ValidRef reports whether ref is safe to write into a trusted brief: the pattern, no "..".

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>.

Jump to

Keyboard shortcuts

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