Documentation
¶
Overview ¶
Package identity provides unified user identity utilities for Compa. It introduces a canonical "platform:id" format and the matching logic for allow-list entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCanonicalID ¶
BuildCanonicalID constructs a canonical "platform:id" identifier. Both platform and platformID are lowercased and trimmed.
func MatchAllowed ¶
func MatchAllowed(sender bus.SenderInfo, allowed string) bool
MatchAllowed checks whether the given sender matches a single allow-list entry:
- "123456" → matches sender.PlatformID
- "@alice" → matches sender.Username
- "slack:U123456" → exact match on sender.CanonicalID
- "slack:@alice" → matches sender.Username on that platform
Only a known platform name (or the sender's own platform) before the first colon makes an entry canonical.
func ParseCanonicalID ¶
ParseCanonicalID splits a canonical ID ("platform:id") into its parts. Returns ok=false if the input does not contain a colon separator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.