mirror of
https://github.com/AJMicke/KickerELO.git
synced 2026-03-11 05:21:07 +01:00
Add OIDC support again (#62)
* Update readme
* First try in oidc implementation
* Add secrets
* Add connection to fs auth provider, redirect not tested
* Working prototype
This commit implements the oidc compatibility with the caveat of having
every subsite under the app path. For that, there is also a redirection
handler to redirect the home page to the app home page.
* Small cleanup
* Fix access even when logged in
* Update application-prod.properties
* Ignore login when in test env
* Fix reviews
* Feature/sign in (#1)
* Add OIDC support (#39)
* Update readme
* First try in oidc implementation
* Add secrets
* Add connection to fs auth provider, redirect not tested
* Working prototype
This commit implements the oidc compatibility with the caveat of having
every subsite under the app path. For that, there is also a redirection
handler to redirect the home page to the app home page.
* Small cleanup
* Fix access even when logged in
* Update application-prod.properties
* Ignore login when in test env
* Fix reviews
* Revert "Add OIDC support (#39)" (#60)
This reverts commit 244f6cbf95.
* Refine the sign in solution by Moritz921
* Fix botched rebase
---------
Co-authored-by: AJMicke <7047945+AJMicke@users.noreply.github.com>
Co-authored-by: Anton Micke <anton.micke@gmail.com>
* Fix bugs
---------
Co-authored-by: AJMicke <7047945+AJMicke@users.noreply.github.com>
Co-authored-by: Anton Micke <anton.micke@gmail.com>
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -2,6 +2,13 @@ target/
|
|||||||
!.mvn/wrapper/maven-wrapper.jar
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
!**/src/main/**/target/
|
!**/src/main/**/target/
|
||||||
!**/src/test/**/target/
|
!**/src/test/**/target/
|
||||||
|
data.mv.db
|
||||||
|
src/main/bundles
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# for secrets
|
||||||
|
.env
|
||||||
|
.vscode
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
### IntelliJ IDEA ###
|
||||||
.idea/modules.xml
|
.idea/modules.xml
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# KickerELO
|
# KickerELO
|
||||||
|
|
||||||
KickerELO is a web application for displaying Elo ratings for foosball (table soccer) games.
|
KickerELO is a web application for displaying Elo ratings for foosball (table soccer) games.
|
||||||
It uses **Spring Boot** for the backend, **Vaadin** for the frontend, and **MariaDB** as the database.
|
It uses **Spring Boot** for the backend, **Vaadin** for the frontend, and **MariaDB** as the database. It is compatible with any OpenID Connect (OIDC) provider.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
|||||||
8
pom.xml
8
pom.xml
@@ -38,10 +38,18 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.vaadin</groupId>
|
<groupId>com.vaadin</groupId>
|
||||||
<artifactId>vaadin-spring-boot-starter</artifactId>
|
<artifactId>vaadin-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-oauth2-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mariadb.jdbc</groupId>
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package org.kickerelo.kickerelo;
|
package org.kickerelo.kickerelo;
|
||||||
|
|
||||||
import com.vaadin.flow.component.page.AppShellConfigurator;
|
|
||||||
import com.vaadin.flow.server.PWA;
|
|
||||||
import com.vaadin.flow.theme.Theme;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.page.AppShellConfigurator;
|
||||||
|
import com.vaadin.flow.server.PWA;
|
||||||
|
import com.vaadin.flow.theme.Theme;
|
||||||
|
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EntityScan(basePackages = "org.kickerelo.kickerelo.data")
|
@EntityScan(basePackages = "org.kickerelo.kickerelo.data")
|
||||||
@@ -19,5 +20,4 @@ public class KickerEloApplication implements AppShellConfigurator {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(KickerEloApplication.class, args);
|
SpringApplication.run(KickerEloApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.kickerelo.kickerelo.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
|
||||||
|
import com.vaadin.flow.spring.security.VaadinWebSecurity;
|
||||||
|
|
||||||
|
@Profile("prod")
|
||||||
|
@Configuration
|
||||||
|
class SecurityConfiguration extends VaadinWebSecurity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
http.authorizeHttpRequests(auth -> auth
|
||||||
|
.requestMatchers("/app/admin/**", "/app/admin", "/app/app/admin/**", "/app/app/admin").hasAuthority("Kicker Admin")
|
||||||
|
.anyRequest().permitAll()
|
||||||
|
)
|
||||||
|
.oauth2Login(org.springframework.security.config.Customizer.withDefaults())
|
||||||
|
.logout(logout -> logout.logoutSuccessUrl("/"))
|
||||||
|
.csrf(csrf -> csrf.disable());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,13 +12,21 @@ import com.vaadin.flow.component.sidenav.SideNav;
|
|||||||
import com.vaadin.flow.component.sidenav.SideNavItem;
|
import com.vaadin.flow.component.sidenav.SideNavItem;
|
||||||
import com.vaadin.flow.dom.Style;
|
import com.vaadin.flow.dom.Style;
|
||||||
import com.vaadin.flow.router.Layout;
|
import com.vaadin.flow.router.Layout;
|
||||||
|
import org.kickerelo.kickerelo.util.AccessControlService;
|
||||||
import org.kickerelo.kickerelo.views.*;
|
import org.kickerelo.kickerelo.views.*;
|
||||||
|
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
||||||
|
|
||||||
|
|
||||||
@Layout
|
@Layout
|
||||||
@JsModule("./prefers-color-scheme.js")
|
@JsModule("./prefers-color-scheme.js")
|
||||||
public class KickerAppLayout extends AppLayout {
|
public class KickerAppLayout extends AppLayout {
|
||||||
|
AccessControlService accessControlService;
|
||||||
|
|
||||||
public KickerAppLayout() {
|
public KickerAppLayout(AccessControlService accessControlService) {
|
||||||
|
this.accessControlService = accessControlService;
|
||||||
DrawerToggle drawerToggle = new DrawerToggle();
|
DrawerToggle drawerToggle = new DrawerToggle();
|
||||||
|
|
||||||
H1 title = new H1("Kicker-ELO");
|
H1 title = new H1("Kicker-ELO");
|
||||||
@@ -26,6 +34,24 @@ public class KickerAppLayout extends AppLayout {
|
|||||||
|
|
||||||
addToNavbar(drawerToggle, title);
|
addToNavbar(drawerToggle, title);
|
||||||
|
|
||||||
|
// Add login/logout button
|
||||||
|
if (accessControlService.userAllowedForRole("")) {
|
||||||
|
Anchor logoutLink = new Anchor("/logout", "Logout");
|
||||||
|
|
||||||
|
logoutLink.getElement().getStyle()
|
||||||
|
.set("margin-left", "auto")
|
||||||
|
.set("margin-right", "10px")
|
||||||
|
.set("align-self", "center");
|
||||||
|
addToNavbar(logoutLink);
|
||||||
|
} else {
|
||||||
|
Anchor loginLink = new Anchor("/oauth2/authorization/oidc", "Login");
|
||||||
|
loginLink.getElement().getStyle()
|
||||||
|
.set("margin-left", "auto")
|
||||||
|
.set("margin-right", "10px")
|
||||||
|
.set("align-self", "center");
|
||||||
|
addToNavbar(loginLink);
|
||||||
|
}
|
||||||
|
|
||||||
SideNav general = new SideNav("Allgemein");
|
SideNav general = new SideNav("Allgemein");
|
||||||
general.setCollapsible(true);
|
general.setCollapsible(true);
|
||||||
general.addItem(new SideNavItem("Spielerliste", PlayerListView.class, VaadinIcon.GROUP.create()),
|
general.addItem(new SideNavItem("Spielerliste", PlayerListView.class, VaadinIcon.GROUP.create()),
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package org.kickerelo.kickerelo.util;
|
||||||
|
|
||||||
|
public interface AccessControlService {
|
||||||
|
boolean userAllowedForRole(String role);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.kickerelo.kickerelo.util;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Profile("prod")
|
||||||
|
public class AccessControlServiceProdImpl implements AccessControlService {
|
||||||
|
@Override
|
||||||
|
public boolean userAllowedForRole(String role) {
|
||||||
|
// Check if authentication is present
|
||||||
|
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
if (auth == null || !(auth.getPrincipal() instanceof OidcUser oidcUser)) return false;
|
||||||
|
|
||||||
|
// Empty String means there just needs to be authentication, not a specific group
|
||||||
|
if (role.isEmpty()) return true;
|
||||||
|
|
||||||
|
// Get the list of groups the user is part of
|
||||||
|
Object groupsObj = oidcUser.getClaims().getOrDefault("groups", List.of());
|
||||||
|
if (!(groupsObj instanceof List<?>)) return false;
|
||||||
|
|
||||||
|
// Keep only Strings in the list
|
||||||
|
List<String> listOfGroups = ((List<?>) groupsObj).stream()
|
||||||
|
.filter(String.class::isInstance)
|
||||||
|
.map(String.class::cast)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
// Check if the user is part of the required group
|
||||||
|
return listOfGroups.contains(role);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.kickerelo.kickerelo.util;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Profile("test")
|
||||||
|
public class AccessControlServiceTestImpl implements AccessControlService {
|
||||||
|
@Override
|
||||||
|
public boolean userAllowedForRole(String role) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.kickerelo.kickerelo.util;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class RedirectController {
|
||||||
|
@GetMapping("/")
|
||||||
|
public String redirectToApp() {
|
||||||
|
return "redirect:/app";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,30 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
import com.vaadin.flow.component.button.Button;
|
|
||||||
import com.vaadin.flow.component.html.H2;
|
|
||||||
import com.vaadin.flow.component.notification.Notification;
|
|
||||||
import com.vaadin.flow.component.notification.NotificationVariant;
|
|
||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|
||||||
import com.vaadin.flow.component.textfield.TextField;
|
|
||||||
import com.vaadin.flow.router.Route;
|
|
||||||
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
||||||
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
||||||
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
||||||
import org.kickerelo.kickerelo.service.KickerEloService;
|
import org.kickerelo.kickerelo.service.KickerEloService;
|
||||||
|
import org.kickerelo.kickerelo.util.AccessControlService;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.button.Button;
|
||||||
|
import com.vaadin.flow.component.html.Paragraph;
|
||||||
|
import com.vaadin.flow.component.notification.Notification;
|
||||||
|
import com.vaadin.flow.component.notification.NotificationVariant;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
|
import com.vaadin.flow.component.textfield.TextField;
|
||||||
|
import com.vaadin.flow.router.BeforeEnterEvent;
|
||||||
|
import com.vaadin.flow.router.Route;
|
||||||
|
|
||||||
@Route("admin")
|
@Route("admin")
|
||||||
public class AdminView extends VerticalLayout {
|
public class AdminView extends VerticalLayout {
|
||||||
public AdminView(KickerEloService service) {
|
|
||||||
H2 subheader = new H2("Verwaltung");
|
public AdminView(KickerEloService service, AccessControlService accessControlService) {
|
||||||
|
// Deny access if user isn't part of the Kicker Admin group
|
||||||
|
if (!accessControlService.userAllowedForRole("Kicker Admin")) {
|
||||||
|
add(new Paragraph("Du bist nicht berechtigt, diese Seite zu sehen."));
|
||||||
|
getUI().ifPresent(ui -> ui.navigate(""));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TextField spielername = new TextField("Spielername");
|
TextField spielername = new TextField("Spielername");
|
||||||
spielername.addClassName("bordered");
|
spielername.addClassName("bordered");
|
||||||
@@ -41,6 +50,7 @@ public class AdminView extends VerticalLayout {
|
|||||||
service.recalculateAll1vs1();
|
service.recalculateAll1vs1();
|
||||||
Notification.show("Recalculating finished").addThemeVariants(NotificationVariant.LUMO_SUCCESS);
|
Notification.show("Recalculating finished").addThemeVariants(NotificationVariant.LUMO_SUCCESS);
|
||||||
});
|
});
|
||||||
|
|
||||||
Button recalc2vs2Button = new Button("2 vs 2 Elo neu berechnen", e -> {
|
Button recalc2vs2Button = new Button("2 vs 2 Elo neu berechnen", e -> {
|
||||||
Notification.show("Recalculating Elo").addThemeVariants(NotificationVariant.LUMO_WARNING);
|
Notification.show("Recalculating Elo").addThemeVariants(NotificationVariant.LUMO_WARNING);
|
||||||
service.recalculateAll2vs2();
|
service.recalculateAll2vs2();
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Spieler;
|
||||||
|
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
||||||
|
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
||||||
|
import org.kickerelo.kickerelo.exception.NoSuchPlayerException;
|
||||||
|
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
||||||
|
import org.kickerelo.kickerelo.service.KickerEloService;
|
||||||
|
|
||||||
import com.vaadin.flow.component.button.Button;
|
import com.vaadin.flow.component.button.Button;
|
||||||
import com.vaadin.flow.component.combobox.ComboBox;
|
import com.vaadin.flow.component.combobox.ComboBox;
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
@@ -8,14 +15,8 @@ import com.vaadin.flow.component.notification.NotificationVariant;
|
|||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
import com.vaadin.flow.component.textfield.IntegerField;
|
import com.vaadin.flow.component.textfield.IntegerField;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Spieler;
|
|
||||||
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
|
||||||
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
|
||||||
import org.kickerelo.kickerelo.exception.NoSuchPlayerException;
|
|
||||||
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
|
||||||
import org.kickerelo.kickerelo.service.KickerEloService;
|
|
||||||
|
|
||||||
@Route(value = "enter1vs1")
|
@Route("enter1vs1")
|
||||||
public class Enter1vs1View extends VerticalLayout {
|
public class Enter1vs1View extends VerticalLayout {
|
||||||
|
|
||||||
public Enter1vs1View(KickerEloService eloService) {
|
public Enter1vs1View(KickerEloService eloService) {
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Spieler;
|
||||||
|
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
||||||
|
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
||||||
|
import org.kickerelo.kickerelo.exception.NoSuchPlayerException;
|
||||||
|
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
||||||
|
import org.kickerelo.kickerelo.service.KickerEloService;
|
||||||
|
|
||||||
import com.vaadin.flow.component.button.Button;
|
import com.vaadin.flow.component.button.Button;
|
||||||
import com.vaadin.flow.component.combobox.ComboBox;
|
import com.vaadin.flow.component.combobox.ComboBox;
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
@@ -8,14 +15,8 @@ import com.vaadin.flow.component.notification.NotificationVariant;
|
|||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
import com.vaadin.flow.component.textfield.IntegerField;
|
import com.vaadin.flow.component.textfield.IntegerField;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Spieler;
|
|
||||||
import org.kickerelo.kickerelo.exception.DuplicatePlayerException;
|
|
||||||
import org.kickerelo.kickerelo.exception.InvalidDataException;
|
|
||||||
import org.kickerelo.kickerelo.exception.NoSuchPlayerException;
|
|
||||||
import org.kickerelo.kickerelo.exception.PlayerNameNotSetException;
|
|
||||||
import org.kickerelo.kickerelo.service.KickerEloService;
|
|
||||||
|
|
||||||
@Route(value = "enter2vs2")
|
@Route("enter2vs2")
|
||||||
public class Enter2vs2View extends VerticalLayout {
|
public class Enter2vs2View extends VerticalLayout {
|
||||||
public Enter2vs2View(KickerEloService eloService) {
|
public Enter2vs2View(KickerEloService eloService) {
|
||||||
H2 subheading = new H2("2 vs 2 Ergebnis");
|
H2 subheading = new H2("2 vs 2 Ergebnis");
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package org.kickerelo.kickerelo.views;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.repository.SpielerRepository;
|
||||||
|
import org.kickerelo.kickerelo.util.comparator.Spieler1vs1EloComparator;
|
||||||
|
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
|
|
||||||
import org.kickerelo.kickerelo.repository.SpielerRepository;
|
|
||||||
import org.kickerelo.kickerelo.util.comparator.Spieler1vs1EloComparator;
|
|
||||||
|
|
||||||
@Route("graph1vs1")
|
@Route("graph1vs1")
|
||||||
public class Graph1vs1View extends VerticalLayout {
|
public class Graph1vs1View extends VerticalLayout {
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package org.kickerelo.kickerelo.views;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.repository.SpielerRepository;
|
||||||
|
import org.kickerelo.kickerelo.util.comparator.Spieler2vs2EloComparator;
|
||||||
|
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
|
|
||||||
import org.kickerelo.kickerelo.repository.SpielerRepository;
|
|
||||||
import org.kickerelo.kickerelo.util.comparator.Spieler2vs2EloComparator;
|
|
||||||
|
|
||||||
@Route("graph2vs2")
|
@Route("graph2vs2")
|
||||||
public class Graph2vs2View extends VerticalLayout {
|
public class Graph2vs2View extends VerticalLayout {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Ergebnis1vs1;
|
||||||
|
import org.kickerelo.kickerelo.repository.Ergebnis1vs1Repository;
|
||||||
|
|
||||||
import com.vaadin.flow.component.grid.Grid;
|
import com.vaadin.flow.component.grid.Grid;
|
||||||
import com.vaadin.flow.component.grid.GridSortOrder;
|
import com.vaadin.flow.component.grid.GridSortOrder;
|
||||||
import com.vaadin.flow.component.grid.dataview.GridListDataView;
|
import com.vaadin.flow.component.grid.dataview.GridListDataView;
|
||||||
@@ -13,10 +18,6 @@ import com.vaadin.flow.data.renderer.ComponentRenderer;
|
|||||||
import com.vaadin.flow.data.renderer.LocalDateTimeRenderer;
|
import com.vaadin.flow.data.renderer.LocalDateTimeRenderer;
|
||||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Ergebnis1vs1;
|
|
||||||
import org.kickerelo.kickerelo.repository.Ergebnis1vs1Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Route("history1vs1")
|
@Route("history1vs1")
|
||||||
public class History1vs1View extends HistoryView {
|
public class History1vs1View extends HistoryView {
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Ergebnis2vs2;
|
||||||
|
import org.kickerelo.kickerelo.repository.Ergebnis2vs2Repository;
|
||||||
|
|
||||||
import com.vaadin.flow.component.grid.Grid;
|
import com.vaadin.flow.component.grid.Grid;
|
||||||
import com.vaadin.flow.component.grid.GridSortOrder;
|
import com.vaadin.flow.component.grid.GridSortOrder;
|
||||||
import com.vaadin.flow.component.grid.dataview.GridListDataView;
|
import com.vaadin.flow.component.grid.dataview.GridListDataView;
|
||||||
@@ -14,10 +19,6 @@ import com.vaadin.flow.data.renderer.ComponentRenderer;
|
|||||||
import com.vaadin.flow.data.renderer.LocalDateTimeRenderer;
|
import com.vaadin.flow.data.renderer.LocalDateTimeRenderer;
|
||||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Ergebnis2vs2;
|
|
||||||
import org.kickerelo.kickerelo.repository.Ergebnis2vs2Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Route("history2vs2")
|
@Route("history2vs2")
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Spieler;
|
||||||
|
import org.kickerelo.kickerelo.service.KickerEloService;
|
||||||
|
|
||||||
import com.vaadin.flow.component.grid.Grid;
|
import com.vaadin.flow.component.grid.Grid;
|
||||||
import com.vaadin.flow.component.grid.GridSortOrder;
|
import com.vaadin.flow.component.grid.GridSortOrder;
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
import com.vaadin.flow.data.provider.SortDirection;
|
import com.vaadin.flow.data.provider.SortDirection;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Spieler;
|
|
||||||
import org.kickerelo.kickerelo.service.KickerEloService;
|
|
||||||
|
|
||||||
import java.util.List;
|
@Route("/")
|
||||||
|
|
||||||
@Route("")
|
|
||||||
public class PlayerListView extends VerticalLayout {
|
public class PlayerListView extends VerticalLayout {
|
||||||
public PlayerListView(KickerEloService eloService) {
|
public PlayerListView(KickerEloService eloService) {
|
||||||
setSizeFull();
|
setSizeFull();
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package org.kickerelo.kickerelo.views;
|
package org.kickerelo.kickerelo.views;
|
||||||
|
|
||||||
|
import org.kickerelo.kickerelo.data.Spieler;
|
||||||
|
import org.kickerelo.kickerelo.repository.Ergebnis2vs2Repository;
|
||||||
|
import org.kickerelo.kickerelo.service.KickerEloService;
|
||||||
|
import org.kickerelo.kickerelo.service.Stat2vs2Service;
|
||||||
|
import org.kickerelo.kickerelo.util.Position;
|
||||||
|
|
||||||
import com.vaadin.flow.component.combobox.ComboBox;
|
import com.vaadin.flow.component.combobox.ComboBox;
|
||||||
import com.vaadin.flow.component.html.H2;
|
import com.vaadin.flow.component.html.H2;
|
||||||
import com.vaadin.flow.component.html.NativeLabel;
|
import com.vaadin.flow.component.html.NativeLabel;
|
||||||
@@ -8,11 +14,6 @@ import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|||||||
import com.vaadin.flow.component.progressbar.ProgressBar;
|
import com.vaadin.flow.component.progressbar.ProgressBar;
|
||||||
import com.vaadin.flow.component.progressbar.ProgressBarVariant;
|
import com.vaadin.flow.component.progressbar.ProgressBarVariant;
|
||||||
import com.vaadin.flow.router.Route;
|
import com.vaadin.flow.router.Route;
|
||||||
import org.kickerelo.kickerelo.data.Spieler;
|
|
||||||
import org.kickerelo.kickerelo.repository.Ergebnis2vs2Repository;
|
|
||||||
import org.kickerelo.kickerelo.service.KickerEloService;
|
|
||||||
import org.kickerelo.kickerelo.service.Stat2vs2Service;
|
|
||||||
import org.kickerelo.kickerelo.util.Position;
|
|
||||||
|
|
||||||
@Route("stat2vs2")
|
@Route("stat2vs2")
|
||||||
public class Stat2vs2View extends VerticalLayout {
|
public class Stat2vs2View extends VerticalLayout {
|
||||||
|
|||||||
@@ -10,5 +10,15 @@ spring.jpa.hibernate.ddl-auto=validate
|
|||||||
spring.jpa.show-sql=false
|
spring.jpa.show-sql=false
|
||||||
spring.jpa.open-in-view=false
|
spring.jpa.open-in-view=false
|
||||||
|
|
||||||
|
# == OIDC Configuration ==
|
||||||
|
spring.security.oauth2.client.registration.oidc.client-id=${OIDC_CLIENT_ID}
|
||||||
|
spring.security.oauth2.client.registration.oidc.client-secret=${OIDC_CLIENT_SECRET}
|
||||||
|
spring.security.oauth2.client.registration.oidc.scope=openid,email,profile
|
||||||
|
spring.security.oauth2.client.registration.oidc.redirect-uri=${OIDC_REDIRECT_URI}
|
||||||
|
spring.security.oauth2.client.provider.oidc.jwk-set-uri=${OIDC_JWK_SET_URI}
|
||||||
|
spring.security.oauth2.client.provider.oidc.issuer-uri=${OIDC_ISSUER_URI}
|
||||||
|
|
||||||
|
vaadin.urlMapping=/app/*
|
||||||
|
|
||||||
# In prod mode, never add the test data to the database
|
# In prod mode, never add the test data to the database
|
||||||
spring.sql.init.mode=never
|
spring.sql.init.mode=never
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
server.port=${PORT:8080}
|
server.port=${PORT:8080}
|
||||||
logging.level.org.atmosphere = warn
|
logging.level.org.atmosphere = warn
|
||||||
|
logging.level.org.springframework.security=DEBUG
|
||||||
spring.mustache.check-template-location = false
|
spring.mustache.check-template-location = false
|
||||||
|
|
||||||
spring.datasource.driver-class-name=org.h2.Driver
|
spring.datasource.driver-class-name=org.h2.Driver
|
||||||
spring.datasource.username=sa
|
spring.datasource.username=sa
|
||||||
spring.datasource.password=
|
spring.datasource.password=
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
|
|
||||||
|
# == OIDC Configuration ==
|
||||||
|
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
|
||||||
|
|
||||||
|
vaadin.urlMapping=/app/*
|
||||||
|
|||||||
BIN
src/main/resources/static/icon.png
Normal file
BIN
src/main/resources/static/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Reference in New Issue
Block a user