Merge branch 'feature/SUPPORT-9170_remove_version' into develop
This commit is contained in:
commit
f2331b7b25
5 changed files with 20 additions and 28 deletions
|
|
@ -0,0 +1,16 @@
|
|||
package ru.micord.ervu.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author gulnaz
|
||||
*/
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping(value = "/health")
|
||||
public String health() {
|
||||
return "healthy";
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ import static ru.micord.ervu.security.SecurityConstants.ESIA_LOGOUT;
|
|||
@EnableWebSecurity
|
||||
public class SecurityConfig {
|
||||
private static final String[] PERMIT_ALL = new String[] {
|
||||
"/version", "/esia/url", "/esia/auth", "esia/refresh", "/esia/logout"
|
||||
"/health", "/esia/url", "/esia/auth", "esia/refresh", "/esia/logout"
|
||||
};
|
||||
@Autowired
|
||||
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||
|
|
@ -60,6 +60,8 @@ public class SecurityConfig {
|
|||
http.authorizeHttpRequests(
|
||||
(authorizeHttpRequests) -> authorizeHttpRequests.requestMatchers(PERMIT_ALL)
|
||||
.permitAll()
|
||||
.requestMatchers("/version")
|
||||
.denyAll()
|
||||
.anyRequest()
|
||||
.authenticated())
|
||||
.csrf((csrf) -> csrf.csrfTokenRepository(tokenRepository)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {AppHeaderComponent} from "./component/app-header.component";
|
|||
import {AppFooterComponent} from "./component/app-footer.component";
|
||||
import {LogOutComponent} from "./component/logout.component";
|
||||
import {AccessDeniedComponent} from "./component/access-denied.component";
|
||||
import {ApplicationVersionComponent} from "./component/application-version.component";
|
||||
import {RouterModule} from "@angular/router";
|
||||
import {InternationalPhoneNumberModule} from "ngx-international-phone-number";
|
||||
import {AppProgressIndicationComponent} from "./component/app-progress-indication.component";
|
||||
|
|
@ -33,7 +32,6 @@ registerLocaleData(localeRu);
|
|||
export const DIRECTIVES = [
|
||||
forwardRef(() => AppHeaderComponent),
|
||||
forwardRef(() => AppFooterComponent),
|
||||
forwardRef(() => ApplicationVersionComponent),
|
||||
forwardRef(() => LogOutComponent),
|
||||
forwardRef(() => AccessDeniedComponent),
|
||||
forwardRef(() => AppProgressIndicationComponent),
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from "@angular/core";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "application-version",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/application_version.html",
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ApplicationVersionComponent {
|
||||
@Input()
|
||||
public applicationVersion: string;
|
||||
|
||||
constructor(private httpClient: HttpClient, private cd: ChangeDetectorRef) {
|
||||
this.loadAppVersion(); //TODO: check version url
|
||||
}
|
||||
|
||||
private loadAppVersion() {
|
||||
this.httpClient.get("version").toPromise().then((version: any) => {
|
||||
this.applicationVersion = version.number;
|
||||
this.cd.markForCheck();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ export class AuthenticationService {
|
|||
}
|
||||
|
||||
checkAuthentication(): Promise<any>{
|
||||
return this.appConfigService.load().then(() => this.http.get<any>("version").toPromise())
|
||||
return this.appConfigService.load().then(() => this.http.get<any>("health").toPromise());
|
||||
}
|
||||
|
||||
logout(): Promise<any> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue