Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/redpanda.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ E.g. `WithSuperusers("superuser-1", "superuser-2")`.

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.20.0"><span class="tc-version">:material-tag: v0.20.0</span></a>

The `WithEnableSASL()` option enables SASL scram sha authentication. By default, no authentication (plaintext) is used.
The `WithEnableSASL()` option enables SASL scram sha 256 authentication. By default, no authentication (plaintext) is used.
When setting an authentication method, make sure to add users as well and authorize them using the `WithSuperusers()` option.

#### WithEnableKafkaAuthorization
Expand Down
7 changes: 5 additions & 2 deletions modules/redpanda/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type options struct {
KafkaEnableAuthorization bool

// KafkaAuthenticationMethod is either "none" for plaintext or "sasl"
// for SASL (scram) authentication.
// for SASL (scram sha 256) authentication.
KafkaAuthenticationMethod string

// SchemaRegistryAuthenticationMethod is either "none" for no authentication
Expand Down Expand Up @@ -78,6 +78,9 @@ func (o Option) Customize(*testcontainers.GenericContainerRequest) error {
return nil
}

// WithNewServiceAccount includes a new user with username (key) and password (value)
// that shall be created, so that you can use these to authenticate against
// Redpanda (either for the Kafka API or Schema Registry HTTP access).
func WithNewServiceAccount(username, password string) Option {
return func(o *options) {
o.ServiceAccounts[username] = password
Expand All @@ -92,7 +95,7 @@ func WithSuperusers(superusers ...string) Option {
}
}

// WithEnableSASL enables SASL scram sha authentication.
// WithEnableSASL enables SASL scram sha 256 authentication.
// By default, no authentication (plaintext) is used.
// When setting an authentication method, make sure to add users
// as well as authorize them using the WithSuperusers() option.
Expand Down
Loading