-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
35 changed files
with
649 additions
and
152 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,65 @@ | ||
kafkahq: | ||
server: | ||
base-path: "" # if behind a reverse proxy, path to kafkahq with trailing slash (optionnal) | ||
access-log: # Access log configuration (optionnal) | ||
enabled: true # true by default | ||
name: org.kafkahq.log.access # Logger name | ||
format: "[Date: {}] [Duration: {} ms] [Url: {} {} {}] [Status: {}] [Ip: {}] [Length: {}] [Port: {}]" # Logger format | ||
|
||
# default kafka properties for each clients, available for admin / producer / consumer (optionnal) | ||
clients-defaults: | ||
consumer: | ||
properties: | ||
isolation.level: read_committed | ||
|
||
# list of kafka cluster available for kafkahq | ||
connections: | ||
my-cluster-1: # url friendly name for the cluster | ||
properties: # standard kafka properties (optionnal) | ||
bootstrap.servers: "kafka:9092" | ||
schema-registry: "http://schema-registry:8085" # schema registry url (optionnal) | ||
|
||
my-cluster-2: | ||
properties: | ||
bootstrap.servers: "kafka:9093" | ||
security.protocol: SSL | ||
ssl.truststore.location: /app/truststore.jks | ||
ssl.truststore.password: password | ||
ssl.keystore.location: /app/keystore.jks | ||
ssl.keystore.password: password | ||
ssl.key.password: password | ||
|
||
# Topic display data options (optionnal) | ||
topic-data: | ||
sort: OLDEST # default sort order (OLDEST, NEWEST) (default: OLDEST) | ||
size: 50 # max record per page (default: 50) | ||
|
||
# Auth & Roles (optionnal) | ||
security: | ||
default-roles: # Roles available for all the user even unlogged user | ||
- topic/read | ||
- topic/insert | ||
- topic/delete | ||
- topic/config/update | ||
- node/read | ||
- node/config/update | ||
- topic/data/read | ||
- topic/data/insert | ||
- topic/data/delete | ||
- group/read | ||
- group/delete | ||
- group/offsets/update | ||
- registry/read | ||
- registry/insert | ||
- registry/update | ||
- registry/delete | ||
- registry/version/delete | ||
|
||
# Basic auth configuration | ||
basic-auth: | ||
user: # Username | ||
password: pass # Password in sha256 | ||
roles: # Role for current users | ||
- topic/read | ||
- group/read | ||
- group/delete |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.khq-login { | ||
width: 100%; | ||
max-width: 330px; | ||
margin: 0 auto; | ||
text-align: center; | ||
|
||
padding: 40px; | ||
background: $gray-900; | ||
box-shadow: 0 0 40px 5px rgba($tertiary, 0.4); | ||
|
||
> div:first-child { | ||
margin-bottom: 40px; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.kafkahq.configs; | ||
|
||
import com.google.common.hash.Hashing; | ||
import io.micronaut.context.annotation.EachProperty; | ||
import io.micronaut.context.annotation.Parameter; | ||
import lombok.Getter; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
import java.util.List; | ||
|
||
@EachProperty("kafkahq.security.basic-auth") | ||
@Getter | ||
public class BasicAuth { | ||
String username; | ||
String password; | ||
List<String> roles; | ||
|
||
public BasicAuth(@Parameter String username) { | ||
this.username = username; | ||
} | ||
|
||
@SuppressWarnings("UnstableApiUsage") | ||
public boolean isValidPassword(String password) { | ||
return this.password.equals( | ||
Hashing.sha256() | ||
.hashString(password, StandardCharsets.UTF_8) | ||
.toString() | ||
); | ||
} | ||
} | ||
|
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,25 @@ | ||
package org.kafkahq.configs; | ||
|
||
public class Role { | ||
public static final String ROLE_TOPIC_READ = "topic/read"; | ||
public static final String ROLE_TOPIC_INSERT = "topic/insert"; | ||
public static final String ROLE_TOPIC_DELETE = "topic/delete"; | ||
public static final String ROLE_TOPIC_CONFIG_UPDATE = "topic/config/update"; | ||
|
||
public static final String ROLE_NODE_READ = "node/read"; | ||
public static final String ROLE_NODE_CONFIG_UPDATE = "node/config/update"; | ||
|
||
public static final String ROLE_TOPIC_DATA_READ = "topic/data/read"; | ||
public static final String ROLE_TOPIC_DATA_INSERT = "topic/data/insert"; | ||
public static final String ROLE_TOPIC_DATA_DELETE = "topic/data/delete"; | ||
|
||
public static final String ROLE_GROUP_READ = "group/read"; | ||
public static final String ROLE_GROUP_DELETE = "group/delete"; | ||
public static final String ROLE_GROUP_OFFSETS_UPDATE = "group/offsets/update"; | ||
|
||
public static final String ROLE_REGISTRY_READ = "registry/read"; | ||
public static final String ROLE_REGISTRY_INSERT = "registry/insert"; | ||
public static final String ROLE_REGISTRY_UPDATE = "registry/update"; | ||
public static final String ROLE_REGISTRY_DELETE = "registry/delete"; | ||
public static final String ROLE_REGISTRY_VERSION_DELETE = "registry/version/delete"; | ||
} |
Oops, something went wrong.