Skip to content

Conversation

KarstenSchnitter
Copy link
Contributor

This PR provides a new sample application using Spring Boot.
It is secured with basic authentication.
The app can be used as a JWT generator for dynamic log levels.

This is work in progress. The JKS should be created automatically. API description
needs to be improved. Security (Basic-Auth) needs to be added.
Let Maven automatically create a keystore if missing. Credentials and dname
can be configured in the pom.xml. Use the Maven properties for application.yml.
The dynamic log level feature uses JWTs. These can be verified by a public key.
Since the sample app can generate those JWTs this new endpoint exposes the
public key required to verify the generated tokens.
@juergen-walter
Copy link
Member

Do not merge, I get an error when running mvn install.

cf-java-logging-support/sample-spring-boot$ mvn install -X
...

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project sample-app-spring-boot: Fatal error compiling: invalid flag: --release -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project sample-app-spring-boot: Fatal error compiling

...
Caused by: java.lang.IllegalArgumentException: invalid flag: --release

@KarstenSchnitter
Copy link
Contributor Author

@juergen-walter: I used Maven version 3.6.3. What is your maven version?

@juergen-walter
Copy link
Member

@juergen-walter: I used Maven version 3.6.3. What is your maven version?

$ mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_282, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-65-generic", arch: "amd64", family: "unix"

@juergen-walter
Copy link
Member

will try it with updated maven

@juergen-walter
Copy link
Member

Could verify that it works with Maven 3.6.0

@juergen-walter juergen-walter self-requested a review February 15, 2021 18:16
@juergen-walter
Copy link
Member

Tested everything locally, worked as expected/documented.

I created a PR with minors to the sample-spring-boot branch
#95

@juergen-walter
Copy link
Member

I think the "Add debug to travis maven execution" commit has to be reverted to make the CI tests pass

@KarstenSchnitter KarstenSchnitter force-pushed the sample-spring-boot branch 4 times, most recently from 1cd814e to ea2bdd7 Compare February 16, 2021 06:13
The profile activation by missing files does no support Maven properties.
The directories must be given in plain text. The pom.xml was changed accordingly.

By default activation will only activate a profile if none other profile is active.
Backend selection was therefore migrated to activation by system property.

The documentation was adjusted accordingly.
@juergen-walter
Copy link
Member

juergen-walter commented Mar 1, 2021

My PR has still a small improvement not yet integrated. Marked the relevant changes with strike-through and bold below:

sample-spring-boot/README.md

Getting Started

This sample application is contained in the Maven module sample-spring-boot.
It can be built with a simple mvn install.
A minimal CF application manifest is provided in manifest.yml.
To avoid naming conflicts, the name of the app should be changed in the manifest before building it.
The app can be built with a simple mvn install
(requires Apache Maven 3.6.3).
This allows to deploy the newly built app with cf push, provided a login to a CF instance.

Copy link
Member

@juergen-walter juergen-walter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small improvement idea, feel free to include or not. Approved.

@KarstenSchnitter KarstenSchnitter merged commit 2f003f7 into master Mar 1, 2021
@KarstenSchnitter KarstenSchnitter deleted the sample-spring-boot branch March 1, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants