Skip to content

Commit

Permalink
Merge branch 'dev' into feat/improve-schema-loading-on-produce-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jun 26, 2023
2 parents 30988b1 + 3f841d7 commit b79a2ee
Show file tree
Hide file tree
Showing 121 changed files with 1,825 additions and 1,409 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFLUENT_VERSION=7.3.3
CONFLUENT_KAFKACAT_VERSION=7.1.7 # seems there is not a release with each version
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ connects-plugins/
docs/contributors.html

## Docker
.env
docker-compose.override.yml

## Helm
Expand All @@ -58,4 +57,4 @@ docs/node_modules
docs/.vuepress/.temp
docs/.vuepress/.cache
docs/.vuepress/public/contributors.html
docs/.vuepress/dist
docs/.vuepress/dist
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2019 Ludovic Dehon

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@
## Sponsors
<table>
<tr>
<td>
<img width="1000" height="0">
<a href="https://upstash.com/?utm_source=AKHQ" >
<img src="./docs/.vuepress/public/assets/images/logo-infosupport.svg" alt="Upstash" width="260" align="right">
</a>

<h3>InfoSupport</h3>

<p>Info Support is the specialist in developing high quality software<br />
solutions and leading in the field of artificial intelligence (AI), <br />
cloud architecture, managed services and IT training.
</p>

[Discover](https://infosupport.com/?utm_source=AKHQ)
</td>
</tr>
<tr>
<td>
<img width="1000" height="0">
<a href="https://upstash.com/?utm_source=AKHQ" >
Expand Down Expand Up @@ -64,6 +81,7 @@ Kestra is an infinitely scalable orchestration and scheduling platform, creating


## Who's using AKHQ
* [Archer Aviation](https://archer.com/)
* [Adeo](https://www.adeo.com/)
* [Avlino](https://avlino.com/)
* [Auchan Retail](https://www.auchan-retail.com/)
Expand Down
103 changes: 57 additions & 46 deletions application.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,75 +186,86 @@ akhq:

# Auth & Roles (optional)
security:
roles:
topic-read:
- resources: [ "TOPIC", "TOPIC_DATA" ]
actions: [ "READ" ]
- resources: [ "TOPIC" ]
actions: [ "READ_CONFIG" ]
topic-admin:
- resources: [ "TOPIC", "TOPIC_DATA" ]
actions: [ "READ", "CREATE", "DELETE" ]
- resources: [ "TOPIC" ]
actions: [ "UPDATE", "READ_CONFIG", "ALTER_CONFIG" ]
connect-rw:
- resources: [ "CONNECTOR" ]
actions: [ "READ", "CREATE", "UPDATE_STATE" ]
connect-admin:
- resources: [ "CONNECTOR" ]
actions: [ "READ", "CREATE", "UPDATE_STATE", "DELETE" ]
registry-read:
- resources: [ "SCHEMA" ]
actions: [ "READ" ]
registry-admin:
- resources: [ "SCHEMA" ]
actions: [ "READ", "CREATE", "UPDATE", "DELETE", "DELETE_VERSION" ]
group-read:
- resources: [ "CONSUMER_GROUP" ]
actions: [ "READ" ]
connect-cluster-read:
- resources: [ "CONNECT_CLUSTER" ]
actions: [ "READ" ]
ksqldb-admin:
- resources: [ "KSQLDB" ]
actions: [ "READ", "EXECUTE" ]

default-group: admin # Default groups for all the user even unlogged user
# Groups definition
groups:
admin: # unique key
name: admin # Group name
roles: # roles for the group
- 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
- acls/read
- connect/read
- connect/insert
- connect/update
- connect/delete
- connect/state/update
attributes:
# Regexp list to filter topic available for group
topics-filter-regexp:
- "test.*"
# Regexp list to filter connect configs visible for group
connects-filter-regexp:
- "^test.*$"
# Regexp list to filter consumer groups visible for group
consumer-groups-filter-regexp:
- "consumer.*"
topic-reader: # unique key
name: topic-reader # Other group
roles:
- topic/read
attributes:
topics-filter-regexp:
- "test\\.reader.*"
admin:
- role: topic-admin
- role: connect-admin
- role: registry-admin
- role: group-read
- role: connect-cluster-read
- role: ksqldb-admin
topic-reader:
- role: topic-read
- role: registry-admin
topic-reader-dev:
- role: topic-read
clusters: ["dev"]
- role: registry-admin
clusters: ["dev"]
topic-reader-project-prod:
- role: topic-read
patterns: ["project.*"]
clusters: ["prod.*"]
- role: registry-admin
patterns: ["project.*"]
clusters: ["prod.*"]

# Basic auth configuration
basic-auth:
- username: user # Username
password: pass # Password in sha256
groups: # Groups for the user
- admin
- topic-reader

# Ldap Groups configuration (when using ldap)
ldap:
default-group: topic-reader
groups:
- name: group-ldap-1
groups: # Akhq groups list
- topic-reader
- topic-reader-dev
- name: group-ldap-2
groups:
- admin
users:
- username: riemann # ldap user id
groups: # Akhq groups list
- topic-reader
- topic-reader-project-prod
- username: einstein
groups:
- admin
Expand Down
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ plugins {
id 'com.github.psxpaul.execfork' version '0.2.2'
id "com.github.ben-manes.versions" version "0.46.0"
id "com.github.davidmc24.gradle.plugin.avro" version "1.6.0"

// idea
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}

group "org.akhq"
Expand Down Expand Up @@ -42,6 +45,17 @@ configurations.all {
force("org.slf4j:jul-to-slf4j:1.7.32")
force("org.slf4j:log4j-over-slf4j:1.7.32")
force("com.google.protobuf:protobuf-java:3.22.2")
force("net.minidev:json-smart:2.4.10")
}
}

/**********************************************************************************************************************\
* IntelliJ IDEA
**********************************************************************************************************************/
idea.project.settings {
taskTriggers {
beforeBuild generateAvroJava
beforeRebuild generateAvroJava
}
}

Expand Down Expand Up @@ -97,6 +111,7 @@ dependencies {
implementation group: "io.confluent", name: "kafka-protobuf-serializer", version: confluentVersion
implementation group: "io.confluent", name: "kafka-client-plugins", version: confluentVersion + "-ce"
implementation 'org.sourcelab:kafka-connect-client:4.0.3'
implementation 'org.json:json:20230227'

// strimzi
implementation group: 'io.strimzi', name: 'kafka-oauth-common', version: '0.12.0'
Expand Down Expand Up @@ -241,4 +256,3 @@ shadowJar {
processResources.dependsOn ":client:installFrontend"
processResources.dependsOn ":client:assembleFrontend"
processResources.dependsOn ":client:copyClientResources"

5 changes: 5 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"bootstrap": "^4.6.1",
"convert-units": "^2.3.4",
"css-loader": "^3.4.1",
"event-source-polyfill": "^1.0.31",
"font-awesome": "^4.7.0",
"joi-validation": "^2.0.0",
"lodash": "^4.17.21",
Expand Down
20 changes: 16 additions & 4 deletions client/src/components/Root/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,28 @@ class Root extends Component {
}

getApi(url) {
return get(url, { cancelToken: this.cancel.token });
return get(url, this.buildConfig());
}
postApi(url, body) {
return post(url, body, { cancelToken: this.cancel.token });
return post(url, body, this.buildConfig());
}
putApi(url, body) {
return put(url, body, { cancelToken: this.cancel.token });
return put(url, body, this.buildConfig());
}
removeApi(url, body) {
return remove(url, body, { cancelToken: this.cancel.token });
return remove(url, body, this.buildConfig());
}

buildConfig() {
let config = new Map();
config.cancelToken = this.cancel.token;

if (sessionStorage.getItem('jwtToken')) {
config.headers = {};
config.headers['Authorization'] = 'Bearer ' + sessionStorage.getItem('jwtToken');
}

return config;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ConnectConfigs extends Form {
disabled={
plugin.name === 'name' ||
plugin.name === 'connector.class' ||
!(roles.connect && roles.connect['connect/update'])
!(roles.CONNECT && roles.CONNECT.includes('UPDATE'))
}
placeholder={plugin.defaultValue > 0 ? plugin.defaultValue : ''}
onChange={({ currentTarget: input }) => {
Expand Down Expand Up @@ -332,7 +332,7 @@ class ConnectConfigs extends Form {
<tbody>{display}</tbody>
</table>
</div>
{roles.connect && roles.connect['connect/update'] && (
{roles.CONNECT && roles.CONNECT.include('UPDATE') && (
<div style={{ left: 0, width: '100%' }} className="khq-submit">
<button
type={'submit'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ class ConnectTasks extends Root {
this.setState({ tableData: data });
}}
actions={
roles.connect && roles.connect['connect/state/update'] && [constants.TABLE_RESTART]
roles.CONNECT && roles.CONNECT.includes('UPDATE_STATE') && [constants.TABLE_RESTART]
}
onRestart={row => {
this.handleAction(this.definitionState.RESTART_TASK, row.id);
}}
/>
</div>
{roles.connect && roles.connect['connect/state/update'] && (
{roles.CONNECT && roles.CONNECT.includes('UPDATE_STATE') && (
<aside>
{definition.paused ? (
<li className="aside-button">
Expand Down
6 changes: 3 additions & 3 deletions client/src/containers/Connect/ConnectList/ConnectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ class ConnectList extends Root {
const roles = this.state.roles || {};
let actions = [];

if (roles.connect && roles.connect['connect/read']) {
if (roles.CONNECT && roles.CONNECT.includes('READ')) {
actions.push(constants.TABLE_DETAILS);
}
if (roles.connect && roles.connect['connect/delete']) {
if (roles.CONNECT && roles.CONNECT.includes('DELETE')) {
actions.push(constants.TABLE_DELETE);
}

Expand Down Expand Up @@ -356,7 +356,7 @@ class ConnectList extends Root {
}}
noContent={'No connectors available'}
/>
{roles.connect && roles.connect['connect/insert'] && (
{roles.CONNECT && roles.CONNECT.includes('CREATE') && (
<aside>
<Link to={`/ui/${clusterId}/connect/${connectId}/create`} className="btn btn-primary">
Create a definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ConsumerGroup extends Component {
Members
</Link>
</li>
{roles.acls && roles.acls['acls/read'] && (
{roles.ACL && roles.ACL.includes('READ') && (
<li className="nav-item">
<Link
to={`/ui/${clusterId}/group/${consumerGroupId}/acls`}
Expand All @@ -132,19 +132,20 @@ class ConsumerGroup extends Component {
</div>
</div>

{roles.group &&
(roles.group['group/offsets/delete'] || roles.group['group/offsets/update']) && (
{roles.CONSUMER_GROUP &&
(roles.CONSUMER_GROUP.includes('DELETE_OFFSET') ||
roles.CONSUMER_GROUP.includes('UPDATE_OFFSET')) && (
<aside>
<li className="aside-button">
{roles.group['group/offsets/delete'] && (
{roles.CONSUMER_GROUP.includes('DELETE_OFFSET') && (
<Link
to={`/ui/${clusterId}/group/${consumerGroupId}/offsetsdelete`}
className="btn btn-secondary mr-2"
>
Delete Offsets
</Link>
)}
{roles.group['group/offsets/update'] && (
{roles.CONSUMER_GROUP.includes('UPDATE_OFFSET') && (
<Link
to={`/ui/${clusterId}/group/${consumerGroupId}/offsets`}
className="btn btn-primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class ConsumerGroupList extends Root {
}}
onDetails={id => `/ui/${selectedCluster}/group/${encodeURIComponent(id)}`}
actions={
roles.group && roles.group['group/delete']
roles.CONSUMER_GROUP && roles.CONSUMER_GROUP.includes('DELETE')
? [constants.TABLE_DELETE, constants.TABLE_DETAILS]
: [constants.TABLE_DETAILS]
}
Expand Down
1 change: 1 addition & 0 deletions client/src/containers/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Header extends Root {
sessionStorage.setItem('login', currentUserData.logged);
sessionStorage.setItem('user', 'default');
sessionStorage.setItem('roles', organizeRoles(currentUserData.roles));
sessionStorage.removeItem('jwtToken');
this.setState({ login: currentUserData.logged }, () => {
this.props.history.replace({
pathname: '/ui/login',
Expand Down
Loading

0 comments on commit b79a2ee

Please sign in to comment.