SUPPORT-9170: remove version requests; add health endpoint
This commit is contained in:
parent
cf29b7bfff
commit
fdf59ecbce
5 changed files with 18 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
|
@EnableWebSecurity
|
||||||
public class SecurityConfig {
|
public class SecurityConfig {
|
||||||
private static final String[] PERMIT_ALL = new String[] {
|
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
|
@Autowired
|
||||||
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import {
|
||||||
import {AppHeaderComponent} from "./component/app-header.component";
|
import {AppHeaderComponent} from "./component/app-header.component";
|
||||||
import {AppFooterComponent} from "./component/app-footer.component";
|
import {AppFooterComponent} from "./component/app-footer.component";
|
||||||
import {AccessDeniedComponent} from "./component/access-denied.component";
|
import {AccessDeniedComponent} from "./component/access-denied.component";
|
||||||
import {ApplicationVersionComponent} from "./component/application-version.component";
|
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {InternationalPhoneNumberModule} from "ngx-international-phone-number";
|
import {InternationalPhoneNumberModule} from "ngx-international-phone-number";
|
||||||
import {AppProgressIndicationComponent} from "./component/app-progress-indication.component";
|
import {AppProgressIndicationComponent} from "./component/app-progress-indication.component";
|
||||||
|
|
@ -31,7 +30,6 @@ registerLocaleData(localeRu);
|
||||||
export const DIRECTIVES = [
|
export const DIRECTIVES = [
|
||||||
forwardRef(() => AppHeaderComponent),
|
forwardRef(() => AppHeaderComponent),
|
||||||
forwardRef(() => AppFooterComponent),
|
forwardRef(() => AppFooterComponent),
|
||||||
forwardRef(() => ApplicationVersionComponent),
|
|
||||||
forwardRef(() => LogOutComponent),
|
forwardRef(() => LogOutComponent),
|
||||||
forwardRef(() => AccessDeniedComponent),
|
forwardRef(() => AccessDeniedComponent),
|
||||||
forwardRef(() => AppProgressIndicationComponent),
|
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>{
|
checkAuthentication(): Promise<any>{
|
||||||
return this.appConfigService.load().then(() => this.http.get<any>("version").toPromise())
|
return this.appConfigService.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(): Promise<string> {
|
logout(): Promise<string> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue