datasource

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package datasource holds cross-backend datasource decorators. The Guard is the authorization + audit enforcement seam: it wraps any api.KafkaDataSource and interposes on state-changing operations.

CONTRACT for future features: the Guard EMBEDS api.KafkaDataSource, so read and analytical methods pass through automatically. Every NEW mutating method added to api.KafkaDataSource MUST be overridden here with a gate check + audit record (use the do/doValue helpers and declare its authz resource+action). Denial happens BEFORE any effect. See CLAUDE.md ("Authorization/Audit seam").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard struct {
	api.KafkaDataSource
	// contains filtered or unexported fields
}

Guard wraps a KafkaDataSource, enforcing the authorization Gate and emitting audit records for state-changing operations. It satisfies api.KafkaDataSource by embedding the wrapped implementation.

func NewGuard

func NewGuard(inner api.KafkaDataSource, gate *authz.Gate, aud *audit.Service) *Guard

NewGuard wraps inner with gate + audit enforcement. It seeds the gate with the inner datasource's current cluster so the first checks resolve the right profile. A nil gate/audit degrades to allow-all / no-op respectively.

func (*Guard) AlterBrokerConfig

func (g *Guard) AlterBrokerConfig(brokerID int32, key, value string) error

func (*Guard) AlterClientQuotas

func (g *Guard) AlterClientQuotas(entity api.ClientQuotaEntity, quotas map[string]float64) error

func (*Guard) AlterReplicaLogDir

func (g *Guard) AlterReplicaLogDir(brokerID int32, topic string, partition int32, logDir string) error

func (*Guard) ChangeReplicationFactor

func (g *Guard) ChangeReplicationFactor(name string, newFactor int16) error

func (*Guard) CreateACL

func (g *Guard) CreateACL(entry api.ACLEntry) error

func (*Guard) CreateConnector

func (g *Guard) CreateConnector(connect, name string, config map[string]string) (api.Connector, error)

func (*Guard) CreateTopic

func (g *Guard) CreateTopic(name string, numPartitions int32, replicationFactor int16, configs map[string]*string) error

func (*Guard) DeleteACL

func (g *Guard) DeleteACL(entry api.ACLEntry) error

func (*Guard) DeleteConnector

func (g *Guard) DeleteConnector(connect, name string) error

func (*Guard) DeleteConsumerGroup

func (g *Guard) DeleteConsumerGroup(groupID string) error

func (*Guard) DeleteConsumerGroupOffsets

func (g *Guard) DeleteConsumerGroupOffsets(groupID string, topic string) error

func (*Guard) DeleteSchemaVersion

func (g *Guard) DeleteSchemaVersion(subject string, version int, permanent bool) error

func (*Guard) DeleteSubject

func (g *Guard) DeleteSubject(subject string, permanent bool) ([]int, error)

func (*Guard) DeleteTopic

func (g *Guard) DeleteTopic(name string) error

func (*Guard) ExecuteKsql

func (g *Guard) ExecuteKsql(ctx context.Context, sql string, props map[string]string) (<-chan api.KsqlResultTable, error)

func (*Guard) GetConsumerGroups

func (g *Guard) GetConsumerGroups() ([]api.ConsumerGroup, error)

func (*Guard) GetSchemaDetails

func (g *Guard) GetSchemaDetails(subjects []string) ([]api.Schema, error)

func (*Guard) GetSchemas

func (g *Guard) GetSchemas() ([]api.Schema, error)

func (*Guard) GetTopicNames

func (g *Guard) GetTopicNames() ([]string, error)

func (*Guard) GetTopics

func (g *Guard) GetTopics() (map[string]api.Topic, error)

func (*Guard) IncreasePartitions

func (g *Guard) IncreasePartitions(name string, totalCount int32) error

func (*Guard) PauseConnector

func (g *Guard) PauseConnector(connect, name string) error

func (*Guard) ProduceMessage

func (g *Guard) ProduceMessage(ctx context.Context, topic string, rec api.ProduceRecord) error

func (*Guard) PurgeTopicMessages

func (g *Guard) PurgeTopicMessages(name string, partition int32) error

func (*Guard) RecreateTopic

func (g *Guard) RecreateTopic(name string) error

func (*Guard) RegisterSchema

func (g *Guard) RegisterSchema(subject, schemaText, schemaType string) (api.Schema, error)

func (*Guard) ResetConnectorOffsets

func (g *Guard) ResetConnectorOffsets(connect, name string) error

func (*Guard) ResetConsumerGroupOffsets

func (g *Guard) ResetConsumerGroupOffsets(ctx context.Context, req api.OffsetResetRequest) error

func (*Guard) RestartConnector

func (g *Guard) RestartConnector(connect, name string) error

func (*Guard) RestartConnectorTask

func (g *Guard) RestartConnectorTask(connect, name string, taskID int) error

func (*Guard) ResumeConnector

func (g *Guard) ResumeConnector(connect, name string) error

func (*Guard) SetContext

func (g *Guard) SetContext(name string) error

SetContext delegates then re-resolves the gate's active cluster profile.

func (*Guard) SetGlobalCompatibility

func (g *Guard) SetGlobalCompatibility(level api.CompatibilityLevel) error

func (*Guard) SetSubjectCompatibility

func (g *Guard) SetSubjectCompatibility(subject string, level api.CompatibilityLevel) error

func (*Guard) StopConnector

func (g *Guard) StopConnector(connect, name string) error

func (*Guard) UpdateConnectorConfig

func (g *Guard) UpdateConnectorConfig(connect, name string, config map[string]string) (api.Connector, error)

func (*Guard) UpdateTopicConfig

func (g *Guard) UpdateTopicConfig(name string, entries map[string]*string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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