-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a new authorizer class KeycloakAuthorizer
+ Add authorization tests for Kraft mode Signed-off-by: Marko Strukelj <[email protected]>
- Loading branch information
Showing
42 changed files
with
2,686 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
version: '3.5' | ||
|
||
services: | ||
|
||
#################################### KAFKA BROKER #################################### | ||
kafka: | ||
image: strimzi/example-kafka | ||
build: kafka-oauth-strimzi/kafka/target | ||
container_name: kafka | ||
ports: | ||
- 9091:9091 | ||
- 9092:9092 | ||
|
||
# javaagent debug port | ||
#- 5005:5005 | ||
command: | ||
- /bin/bash | ||
- -c | ||
- cd /opt/kafka && ./start.sh --kraft | ||
|
||
environment: | ||
|
||
# Java Debug | ||
#KAFKA_DEBUG: y | ||
#DEBUG_SUSPEND_FLAG: y | ||
#JAVA_DEBUG_PORT: 5005 | ||
|
||
# | ||
# KAFKA Configuration | ||
# | ||
LOG_DIR: /home/kafka/logs | ||
KAFKA_PROCESS_ROLES: "broker,controller" | ||
KAFKA_NODE_ID: "1" | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka:9091" | ||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER | ||
KAFKA_SASL_MECHANISM_CONTROLLER_PROTOCOL: PLAIN | ||
|
||
KAFKA_LISTENERS: "CONTROLLER://kafka:9091,CLIENT://kafka:9092" | ||
KAFKA_ADVERTISED_LISTENERS: "CLIENT://kafka:9092" | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:SASL_PLAINTEXT,CLIENT:SASL_PLAINTEXT" | ||
|
||
KAFKA_INTER_BROKER_LISTENER_NAME: CLIENT | ||
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: OAUTHBEARER | ||
|
||
KAFKA_PRINCIPAL_BUILDER_CLASS: "io.strimzi.kafka.oauth.server.OAuthKafkaPrincipalBuilder" | ||
|
||
KAFKA_LISTENER_NAME_CONTROLLER_SASL_ENABLED_MECHANISMS: PLAIN | ||
KAFKA_LISTENER_NAME_CONTROLLER_PLAIN_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"admin\" password=\"admin-password\" user_admin=\"admin-password\" user_bobby=\"bobby-secret\" ;" | ||
|
||
KAFKA_LISTENER_NAME_CLIENT_SASL_ENABLED_MECHANISMS: OAUTHBEARER | ||
KAFKA_LISTENER_NAME_CLIENT_OAUTHBEARER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;" | ||
KAFKA_LISTENER_NAME_CLIENT_OAUTHBEARER_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler | ||
KAFKA_LISTENER_NAME_CLIENT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS: io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler | ||
|
||
KAFKA_SUPER_USERS: "User:admin,User:service-account-kafka-broker" | ||
|
||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
|
||
|
||
# | ||
# Strimzi OAuth Configuration | ||
# | ||
|
||
# Authentication config | ||
OAUTH_CLIENT_ID: "kafka-broker" | ||
OAUTH_CLIENT_SECRET: "kafka-broker-secret" | ||
OAUTH_TOKEN_ENDPOINT_URI: "http://${KEYCLOAK_HOST:-keycloak}:8080/auth/realms/${REALM:-demo}/protocol/openid-connect/token" | ||
|
||
# Validation config | ||
OAUTH_VALID_ISSUER_URI: "http://${KEYCLOAK_HOST:-keycloak}:8080/auth/realms/${REALM:-demo}" | ||
OAUTH_JWKS_ENDPOINT_URI: "http://${KEYCLOAK_HOST:-keycloak}:8080/auth/realms/${REALM:-demo}/protocol/openid-connect/certs" | ||
#OAUTH_INTROSPECTION_ENDPOINT_URI: "http://${KEYCLOAK_HOST:-keycloak}:8080/auth/realms/${REALM:-demo}/protocol/openid-connect/token/introspect" | ||
|
||
|
||
# username extraction from JWT token claim | ||
OAUTH_USERNAME_CLAIM: preferred_username | ||
OAUTH_CONNECT_TIMEOUT_SECONDS: "20" | ||
|
||
# For start.sh script to know where the keycloak is listening | ||
KEYCLOAK_HOST: ${KEYCLOAK_HOST:-keycloak} | ||
REALM: ${REALM:-demo} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.