OAuthMCPBridge.Whitelist (oauth_mcp_bridge v0.1.0-dev.0)

Copy Markdown View Source

Parses the GitHub-login allowlist config format into the map OAuthMCPBridge.OAuth.check_whitelist/2 expects, ready to :persistent_term.put({:oauth_mcp_bridge, :auth}, ...).

Summary

Functions

Parse a comma-separated allowlist: a bare entry is a login, @name or org:name is a public org membership.

Functions

parse(str)

@spec parse(String.t()) :: %{logins: MapSet.t(), orgs: MapSet.t()}

Parse a comma-separated allowlist: a bare entry is a login, @name or org:name is a public org membership.

iex> OAuthMCPBridge.Whitelist.parse("fire,@taskweft,org:V-Sekai-fire")
%{logins: MapSet.new(["fire"]), orgs: MapSet.new(["taskweft", "V-Sekai-fire"])}