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W1lIjoibGYxMl90ZXN0X3VzZXIifQ.th_MJfbMYC-99eMOy0tfYskFLqwiPAx2UH8_XpwgnUzYF6XvydTmpWXifYYQzQpET_QcdOVFeyYnuED29Zsl8td6zd5was-6OqPgASBV-ZODRJ0AshRCD_NiD4C63XpwxZ7vy75sbUfaAr1VV_E072tAVxihQQxfjYcGwgfOjL1g85GDzVX8qu0uO31-YMdTNhyeBxLnWV1s-SwuoWFxWGb-ObVsCj2t2WVOf9Nxh-MofXw4heJEkDsnZ45O-_8ewtOLycfbJuK6CW2mZUhRmtm4MCSWC6QhFMi3nVekTuzg0jnRHb64ANaRAlT5Qy6VwlVZxyhKDpZdvPGOxZ-Cww
|
|
||||||
###
|
|
||||||
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
|
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
|
@Bean
|
||||||
public SecurityFilterChain resourceServerFilterChain(HttpSecurity http) throws Exception {
|
public SecurityFilterChain resourceServerFilterChain(HttpSecurity http) throws Exception {
|
||||||
|
|
||||||
http.authorizeHttpRequests(auth -> auth
|
http.authorizeHttpRequests(auth -> auth
|
||||||
.requestMatchers(new AntPathRequestMatcher("/welcome"))
|
.requestMatchers("/swagger", "/swagger-ui/**", "/v3/api-docs/**", "/health").permitAll()
|
||||||
.permitAll()
|
.anyRequest().authenticated()
|
||||||
.requestMatchers(
|
)
|
||||||
new AntPathRequestMatcher("/swagger"),
|
.oauth2ResourceServer(spec -> spec.jwt(Customizer.withDefaults()));
|
||||||
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()));
|
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,4 +79,4 @@ class KeycloakSecurityConfig {
|
|||||||
});
|
});
|
||||||
return jwtAuthenticationConverter;
|
return jwtAuthenticationConverter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {Routes} from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
|
import {LandingPageComponent} from "./landing-page/landing-page.component";
|
||||||
import {HomepageComponent} from "./homepage/homepage/homepage.component";
|
import {HomepageComponent} from "./homepage/homepage/homepage.component";
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
@ -6,4 +7,7 @@ export const routes: Routes = [
|
|||||||
path: 'home',
|
path: 'home',
|
||||||
component: HomepageComponent
|
component: HomepageComponent
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ path: '', component: LandingPageComponent }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
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