Skip to content

Commit

Permalink
Merge branch 'main' into issue1864-cachetopics
Browse files Browse the repository at this point in the history
  • Loading branch information
aindriu-aiven authored Oct 26, 2023
2 parents 4edc347 + 2f7da4f commit 9ed7237
Show file tree
Hide file tree
Showing 151 changed files with 4,780 additions and 2,196 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jobs-maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
build:
strategy:
matrix:
java-version: [17, 20]
java-version: [17, 21]
runs-on: [ubuntu-latest]
name: Jdk ${{ matrix.java-version }}, os ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
Expand Down
2 changes: 1 addition & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
-XX:+IgnoreUnrecognizedVMOptions --add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 2.5.0
version = 2.6.0

# Sets a custom hook path in the local git config.
# Currently there's only a pre-commit hook related
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ With several downloads every week, many more companies which did not adopt a sol
- Bootstrap UI, Angular, Javascript, HTML, CSS
- [Maven](https://maven.apache.org/) - Dependency Management
- A maven wrapper, mvnw is included in the Klaw Git Repo
- Java (Jdk 17), Spring boot 3, Spring security, SQL, Apache Kafka Admin client
- Java (Jdk 17, 21), Spring boot 3, Spring security, SQL, Apache Kafka Admin client

## Versioning

Expand Down Expand Up @@ -116,6 +116,8 @@ For the versions available, see the [tags on this repository](https://github.com

- Help Wizard to setup Klaw

[See Features of Klaw in docs](https://www.klaw-project.io/docs/features)

## Documentation

- User documentation : https://klaw-project.io/docs
Expand Down Expand Up @@ -155,6 +157,8 @@ java -jar core/target/klaw-<version>.jar

java -jar cluster-api/target/cluster-api-<version>.jar --spring.config.location=cluster-api/target/classes/application.properties

Or run bin/run-klaw.sh for Mac/Linux

### With `make`

1. Clone this repo containing two maven modules (core and cluster-api) : `git clone [email protected]:aiven/klaw.git`
Expand Down
53 changes: 53 additions & 0 deletions bin/run-klaw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Declarations
version=2.6.0
core_lib=./core/target/klaw-${version}.jar
cluster_lib=./cluster-api/target/cluster-api-${version}.jar
core_config=./core/target/classes/application.properties
cluster_config=./cluster-api/target/classes/application.properties
core_log_file=core.log
clusterapi_log_file=cluster-api.log

# Start klaw
echo "Starting Klaw servers .."

echo "---------- Klaw Core ----------"

# Verify if config file exists
if ! [ -f "$core_lib" ]
then
echo "$core_lib doesn't exist. Exiting .."
exit 1
fi

# Verify if process already exists
if ps aux | grep 'core' | grep klaw
then
echo "Core is already running" 2>&1
else
echo "Starting core"
nohup java -jar ${core_lib} --spring.config.location=${core_config} > ${core_log_file} &
ps aux | grep 'core' | grep klaw
fi

echo "---------- Klaw Cluster api ----------"

# Verify if config file exists
if ! [ -f "$cluster_lib" ];
then
echo "$cluster_lib doesn't exist. Exiting .."
exit 1
fi

# Verify if process already exists
if ps aux | grep 'cluster-api' | grep 'java'
then
echo "Cluster-api is already running" 2>&1
else
echo "Starting cluster-api"
nohup java -jar ${cluster_lib} --spring.config.location=${cluster_config} > ${clusterapi_log_file} &
ps aux | grep 'cluster-api' | grep 'java'
fi

echo "Logging to $core_log_file $clusterapi_log_file"
1 change: 0 additions & 1 deletion cluster-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<java.version>17</java.version>
<!-- the list is sorted-->
<apache.commons.lang.version>3.13.0</apache.commons.lang.version>
<guava.version>31.1-jre</guava.version>
<kafka.version>3.5.1</kafka.version>
<kafka.client.version>3.5.1</kafka.client.version>
<mockserver.version>5.15.0</mockserver.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver
// for retrieving any information from token we will need the secret key
private Claims getAllClaimsFromToken(String token) {
Key hmacKey = new SecretKeySpec(decodedSecret, SignatureAlgorithm.HS256.getJcaName());
Jws<Claims> jwt = Jwts.parserBuilder().setSigningKey(hmacKey).build().parseClaimsJws(token);
Jws<Claims> jwt = Jwts.parser().setSigningKey(hmacKey).build().parseClaimsJws(token);
return jwt.getBody();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ private String generateToken(

return Jwts.builder()
.claim("name", clusterApiUser)
.setSubject(clusterApiUser)
.setId(UUID.randomUUID().toString())
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.subject(clusterApiUser)
.id(UUID.randomUUID().toString())
.issuedAt(Date.from(now))
.expiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.signWith(hmacKey)
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ private String generateToken(

return Jwts.builder()
.claim("name", clusterApiUser)
.setSubject(clusterApiUser)
.setId(UUID.randomUUID().toString())
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.subject(clusterApiUser)
.id(UUID.randomUUID().toString())
.issuedAt(Date.from(now))
.expiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.signWith(hmacKey)
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,10 @@ private String generateToken(

return Jwts.builder()
.claim("name", clusterApiUser)
.setSubject(clusterApiUser)
.setId(UUID.randomUUID().toString())
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.subject(clusterApiUser)
.id(UUID.randomUUID().toString())
.issuedAt(Date.from(now))
.expiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.signWith(hmacKey)
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ private String generateToken(

return Jwts.builder()
.claim("name", clusterApiUser)
.setSubject(clusterApiUser)
.setId(UUID.randomUUID().toString())
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.subject(clusterApiUser)
.id(UUID.randomUUID().toString())
.issuedAt(Date.from(now))
.expiration(Date.from(now.plus(expirationTime, ChronoUnit.MINUTES)))
.signWith(hmacKey)
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void getUsernameFromToken() {
String username = "user123";
String token =
Jwts.builder()
.setSubject(username)
.subject(username)
.claim("name", "John Doe")
.claim("role", "admin")
.signWith(hmacKey)
Expand All @@ -49,8 +49,8 @@ void validateToken() {
String username = "user123";
String token =
Jwts.builder()
.setSubject(username)
.setExpiration(new DateTime().plusDays(1).toDate())
.subject(username)
.expiration(new DateTime().plusDays(1).toDate())
.claim("name", "John Doe")
.claim("role", "admin")
.signWith(hmacKey)
Expand Down
2 changes: 1 addition & 1 deletion coral/docs/development-with-local-klaw.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Please check out the [proxy README](../proxy/README.md) for more detailed inform
- the proxy runs on [`http://localhost:1337`](http://localhost:1337)
- Login (❗️The correct redirect for login and authentication is **not** working in the proxy yet):
- Go to your [local Klaw](http://localhost:9097/login)
- Login as superadmin with: `superadmin`, password `kwsuperadmin123$$` (see [application.properties](../../core/src/main/resources/application.properties))
- Login as superadmin with: `superadmin`, password `welcometoklaw` (see [application.properties](../../core/src/main/resources/application.properties))
- Go back to the [proxy](http://localhost:1337)
11. As superadmin, create one or more users [proxy](http://localhost:1337/users)
"User" and "superadmin" are roles that have authorization to different views and functionality. We're migrating
Expand Down
16 changes: 8 additions & 8 deletions coral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
]
},
"dependencies": {
"@aivenio/aquarium": "^1.35.0",
"@aivenio/aquarium": "^1.43.0",
"@hookform/resolvers": "^2.9.10",
"@monaco-editor/react": "^4.5.2",
"@tanstack/react-query": "^4.29.5",
"@types/react-syntax-highlighter": "^15.5.7",
"@types/react-syntax-highlighter": "^15.5.9",
"crypto": "^1.0.1",
"monaco-editor": "^0.43.0",
"react": "^18.2.0",
Expand All @@ -63,7 +63,7 @@
"remark-rehype": "^10.1.0",
"remark-stringify": "^10.0.3",
"unified": "^10.1.2",
"zod": "^3.22.3"
"zod": "^3.22.4"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.3",
Expand All @@ -74,17 +74,17 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.5",
"@types/lodash": "^4.14.199",
"@types/lodash": "^4.14.200",
"@types/node": "^18.17.14",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^4.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-no-relative-import-paths": "^1.5.2",
"eslint-plugin-react": "^7.32.2",
Expand All @@ -95,12 +95,12 @@
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"msw": "^1.3.1",
"openapi-typescript": "^6.2.0",
"openapi-typescript": "^6.7.0",
"prettier": "^3.0.3",
"prop-types": "^15.8.1",
"react-test-renderer": "^18.2.0",
"rollup-plugin-visualizer": "^5.9.2",
"ts-jest": "^29.1.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"vite": "^4.4.8",
Expand Down
Loading

0 comments on commit 9ed7237

Please sign in to comment.