Skip to content

Commit

Permalink
馃И #17 Added basic auth testing files
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfosterdev authored and gunnarmorling committed Oct 5, 2021
1 parent 9795334 commit 47b92d5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions basic-auth/connect.password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testuser: testpassword
4 changes: 4 additions & 0 deletions basic-auth/jaas.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
KafkaConnect {
org.apache.kafka.connect.rest.basic.auth.extension.PropertyFileLoginModule required
file="/kafka/config/basic-auth/connect.password";
};
54 changes: 54 additions & 0 deletions docker-compose.basic-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright 2021 The original authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

version: '2'
services:
zookeeper:
image: debezium/zookeeper:1.6
ports:
- 2181:2181
- 2888:2888
- 3888:3888
kafka:
image: debezium/kafka:1.6
ports:
- 9092:9092
links:
- zookeeper
environment:
- ZOOKEEPER_CONNECT=zookeeper:2181
connect:
image: debezium/connect-base:1.6
ports:
- 8083:8083
links:
- kafka
volumes:
- ./basic-auth:/kafka/config/basic-auth
environment:
- BOOTSTRAP_SERVERS=kafka:9092
- GROUP_ID=1
- CONFIG_STORAGE_TOPIC=my_connect_configs
- OFFSET_STORAGE_TOPIC=my_connect_offsets
- STATUS_STORAGE_TOPIC=my_connect_statuses

# Add the basic auth extension
- CONNECT_REST_EXTENSION_CLASSES=org.apache.kafka.connect.rest.basic.auth.extension.BasicAuthSecurityRestExtension

# Set the login config:
# - see ./basic-auth/jaas.config for basic auth configuration
# - see ./basic-auth/connect.password for credentials
- KAFKA_OPTS=-Djava.security.auth.login.config=/kafka/config/basic-auth/jaas.config

0 comments on commit 47b92d5

Please sign in to comment.