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1lIjoibGYxMl90ZXN0X3VzZXIifQ.gGPUe-0GGFb7yiko-o5yNlPoyTy3kJCEduwd-VHOLzJubAa9CeO_kjgtxYFDQP1xsBR32Wl6eCoSrz6JfAguU3bfuJ4vukKZ-MUWBc5K_It8NgqcdtR9cTs0nTF2qt2sTG99zn_2Cw9Xs0zc-YEkNHX_YnOZ-p0uMFk_YaEtwcjnw8rs00cbNMPLeAZe5C1QD8TNxZZerRgd0GVfs8P4z7exrJjxdVQeTK1jMz8B3uPCUqBRk1rQI3HLlWNfX195Vcituppj7so9mupq7sit8o9g_gxrVKYObZBVMlBDx-YujGA5QDBngiZZNHNyxseZjcbMyMZXsVTenuZbLU6aEA
|
||||
###
|
||||
GET localhost:8080/welcome
|
||||
|
||||
###
|
||||
GET localhost:8080/roles
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
###
|
||||
GET localhost:8080/hellos
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
###
|
||||
POST localhost:8080/hellos
|
||||
Authorization: Bearer {{token}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"message": "test"
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
grant_type=password&client_id=lf12&username=lf12_test_user&password=secret
|
||||
|
||||
|
||||
> {% client.global.set("token", response.body.access_token); %}
|
1
backend/requests/healthCheck.http
Normal file
1
backend/requests/healthCheck.http
Normal file
@ -0,0 +1 @@
|
||||
GET localhost:8080/health
|
@ -0,0 +1,15 @@
|
||||
package de.szut.casino.health;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping("/health")
|
||||
public Map<String, String> healthCheck() {
|
||||
return Map.of("status", "UP");
|
||||
}
|
||||
}
|
@ -52,23 +52,12 @@ class KeycloakSecurityConfig {
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain resourceServerFilterChain(HttpSecurity http) throws Exception {
|
||||
|
||||
http.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers(new AntPathRequestMatcher("/welcome"))
|
||||
.permitAll()
|
||||
.requestMatchers(
|
||||
new AntPathRequestMatcher("/swagger"),
|
||||
new AntPathRequestMatcher("/swagger-ui/**"),
|
||||
new AntPathRequestMatcher("/v3/api-docs/**"))
|
||||
.permitAll()
|
||||
.requestMatchers(new AntPathRequestMatcher("/hello/**"))
|
||||
.hasRole("lf12_test_role")
|
||||
.requestMatchers(new AntPathRequestMatcher("/roles"))
|
||||
.authenticated()
|
||||
.requestMatchers(new AntPathRequestMatcher("/"))
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()).oauth2ResourceServer(spec -> spec.jwt(Customizer.withDefaults()));
|
||||
.requestMatchers("/swagger", "/swagger-ui/**", "/v3/api-docs/**", "/health").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oauth2ResourceServer(spec -> spec.jwt(Customizer.withDefaults()));
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,13 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import {LandingPageComponent} from "./landing-page/landing-page.component";
|
||||
import {HomepageComponent} from "./homepage/homepage/homepage.component";
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: 'home',
|
||||
component: HomepageComponent
|
||||
},
|
||||
|
||||
{ path: '', component: LandingPageComponent }
|
||||
];
|
||||
|
||||
export const routes: Routes = [];
|
||||
|
35
frontend/src/app/homepage/homepage/homepage.component.html
Normal file
35
frontend/src/app/homepage/homepage/homepage.component.html
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
<nav class="bg-black border-b border-amber-600/30 sticky top-0 z-50">
|
||||
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
|
||||
<!-- logo goes here -->
|
||||
<div class="flex gap-4">
|
||||
<button (click)="onLogout()" class="px-6 py-2 text-black bg-amber-500 hover:bg-amber-400 rounded-full font-bold transition-all duration-300 hover:shadow-lg hover:shadow-amber-500/20">
|
||||
Ausloggen
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="openUserInfo()" class="px-6 py-2 text-black bg-amber-500 hover:bg-amber-400 rounded-full font-bold transition-all duration-300 hover:shadow-lg hover:shadow-amber-500/20">
|
||||
Benutzer
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Todo Dropdown für Benutzermenu (Dailytracker) -->
|
||||
</nav>
|
||||
<!-- Spiele mit Vorschau, Name und "Jetzt spielen" Button -->
|
||||
<div class="gird grid-col-3">
|
||||
<div class="w-full h-full">
|
||||
<p>Spiel Vorschau</p>
|
||||
<p>Spiel Name</p>
|
||||
<button type="button" >Jetzt spielen</button>
|
||||
</div>
|
||||
<div class="w-full h-full">
|
||||
<p>Spiel Vorschau</p>
|
||||
<p>Spiel Name</p>
|
||||
<button type="button" >Jetzt spielen</button>
|
||||
</div>
|
||||
<div class="w-full h-full">
|
||||
<p>Spiel Vorschau</p>
|
||||
<p>Spiel Name</p>
|
||||
<button type="button" >Jetzt spielen</button>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomepageComponent } from './homepage.component';
|
||||
|
||||
describe('HomepageComponent', () => {
|
||||
let component: HomepageComponent;
|
||||
let fixture: ComponentFixture<HomepageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HomepageComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HomepageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
20
frontend/src/app/homepage/homepage/homepage.component.ts
Normal file
20
frontend/src/app/homepage/homepage/homepage.component.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import {ChangeDetectionStrategy, Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-homepage',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './homepage.component.html',
|
||||
styleUrl: './homepage.component.css',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class HomepageComponent {
|
||||
|
||||
onLogout() {
|
||||
//TODO implement
|
||||
}
|
||||
|
||||
openUserInfo() {
|
||||
//TODO implement
|
||||
}
|
||||
}
|
11
frontend/src/app/landing-page/landing-page.component.ts
Normal file
11
frontend/src/app/landing-page/landing-page.component.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-landing-page',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './landing-page.component.html',
|
||||
})
|
||||
export class LandingPageComponent {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user