Documentation
¶
Overview ¶
Package slack provides a Slack workspace scan source.
SlackSource implements the source.Source interface, listing channels and reading message history from a Slack workspace, emitting messages as chunks for secret scanning.
Package slack provides a Slack workspace scan source.
Package slack provides a Slack workspace scan source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*SlackSource)
Option configures a SlackSource.
func WithBufferSize ¶
WithBufferSize sets the channel buffer size for the chunk channel.
func WithChannels ¶
WithChannels limits the scan to the specified channel names (e.g. "engineering"), matching the names shown in Slack and accepted by the --channels CLI flag.
func WithExcludeChannels ¶
WithExcludeChannels excludes the specified channel names from scanning, matching the names shown in Slack and accepted by the --exclude-channels CLI flag.
func WithIncludeDMs ¶
WithIncludeDMs enables or disables scanning of direct messages.
func WithIncludeFiles ¶
WithIncludeFiles requests scanning of file content.
NOTE: Slack file scanning is not yet implemented. This option is currently a no-op for actual scanning behavior (only message text is scanned); enabling it causes a warning to be logged. See ROADMAP and the planned-feature note in slack.go.
func WithRateLimit ¶
WithRateLimit sets the Slack API rate limit in requests per second.
type SlackSource ¶
type SlackSource struct {
// contains filtered or unexported fields
}
SlackSource scans messages in a Slack workspace for leaked secrets.
func New ¶
func New(token string, opts ...Option) *SlackSource
New creates a new SlackSource for the given workspace token. Use functional options to configure channel filtering, rate limits, etc.
func (*SlackSource) Chunks ¶
func (s *SlackSource) Chunks(ctx context.Context) <-chan source.Chunk
Chunks lists channels in the workspace and sends message contents over a channel. The channel is closed when all messages have been processed or the context is cancelled.
func (*SlackSource) Type ¶
func (s *SlackSource) Type() string
Type returns the source type identifier.
func (*SlackSource) Validate ¶
func (s *SlackSource) Validate() error
Validate checks that the Slack token is valid by calling AuthTest.