Documentation
¶
Overview ¶
Package slackid normalises Slack user identifiers across the codebase.
Slack's OIDC sub claim is the composite "Uxxx-Txxx" (user-team) form — see https://api.slack.com/authentication/sign-in-with-slack — while every downstream API (channel invites, Slack interactivity callback.User.ID, the channel-membership cache) keys on the bare "Uxxx" / "Wxxx" user ID. We normalise at every persistence / resolution boundary so the rest of the codebase consistently sees a single user-ID form; otherwise reporter / actor IDs persisted from the Web side fail silently when downstream lookups (Slack API, SlackUser repository) reject the composite value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUserID ¶
IsUserID reports whether s looks like a Slack user ID (a single "U" or "W" prefix followed by alphanumeric characters).
func Normalize ¶
Normalize extracts the Slack user ID portion (Uxxx or Wxxx) from an OIDC sub claim. Slack returns the sub as a hyphen-separated composite of the user ID and the team ID — in practice either form ("Uxxx-Txxx" or "Txxx-Uxxx") may appear depending on the workspace configuration / enterprise-grid setup, so we pick the first hyphen-separated chunk that looks like a user identifier. If no chunk matches we fall back to the raw value so a strange future sub format does not silently strip identity information.
Types ¶
This section is empty.