Compare commits

..

No commits in common. '32780292d98985e8e7c9ecb524ff7edfbef21527' and 'e6541acd078681cde0f7f90b16f1979a4eb42cd3' have entirely different histories.

  1. 10
      Dockerfile
  2. 48
      nginx.conf
  3. 24139
      package-lock.json
  4. 31
      src/app/app.module.ts
  5. 3
      src/app/commun/auth/auth-module-config.ts
  6. 41
      src/app/commun/commun-api.module.ts
  7. 3
      src/app/commun/commun-ui.module.ts
  8. 3
      src/app/commun/config/variables.ts
  9. 4
      src/app/commun/services/collaborateurs.service.ts
  10. 2
      src/app/commun/services/demandesDelegation.service.ts
  11. 2
      src/app/commun/services/demandesEPI.service.ts
  12. 2
      src/app/commun/services/engagements.service.ts
  13. 2
      src/app/commun/services/ep.service.ts
  14. 8
      src/app/commun/services/formations.service.ts
  15. 2
      src/app/commun/services/notes.service.ts
  16. 2
      src/app/commun/services/participationsFormations.service.ts
  17. 2
      src/app/commun/services/referentsEP.service.ts
  18. 11
      src/environments/environment.prod.ts
  19. 11
      src/environments/environment.ts

@ -9,19 +9,17 @@ RUN npm cache clean --force
COPY package*.json /app
RUN npm install
RUN npm install --only=prod
RUN npm install @angular/cli@12.2.12
COPY . /app
RUN npm run build --prod
RUN npm run build-prod
## STEP 2 DEPLOY ##
FROM nginx:1.21.3 AS ngi
COPY --from=build /app/dist/EPAClient /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/conf.d/default.conf
COPY /nginx.conf /etc/nginx/nginx.conf
EXPOSE 4200
CMD ["nginx", "-g", "daemon off;"]
EXPOSE 4200 49153

@ -1,36 +1,20 @@
worker_processes auto;
server {
listen 80;
sendfile on;
default_type application/octet-stream;
events { worker_connections 1024; }
http {
server {
listen 4200;
server_name digitepa_front;
#ssl_certificate /etc/nginx/ssl/www.epa.apside.com.crt;
#ssl_certificate_key /etc/nginx/ssl/www.epa.apside.com.key;
include /etc/nginx/mime.types;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://digitepa_keycloak:8080/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffering off;
proxy_set_header Accept-Encoding "";
}
location /auth {
proxy_pass http://digitepa_back:44393/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffering off;
proxy_set_header Accept-Encoding "";
}
}
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 256;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html =404;
}
}

24139
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -14,19 +14,8 @@ import { AppRoutingModule } from './app-routing.module';
import { CollaborateursModule } from './collaborateurs';
import { CommunModule } from './commun/commun-api.module';
import { CommunUiModule } from './commun/commun-ui.module';
import { AuthModule } from './commun/auth/auth.module';
import { CommunApiModule } from './commun/commun-api.module';
import { CollaborateursService } from './commun/services/collaborateurs.service';
import { DemandesDelegationService } from './commun/services/demandesDelegation.service';
import { DemandesEPIService } from './commun/services/demandesEPI.service';
import { DemandesFormationService } from './commun/services/demandesformation.service';
import { EngagementsService } from './commun/services/engagements.service';
import { EpService } from './commun/services/ep.service';
import { FormationsService } from './commun/services/formations.service';
import { NotesService } from './commun/services/notes.service';
import { ParticipationsFormationsService } from './commun/services/participationsFormations.service';
import { ReferentsEPService } from './commun/services/referentsEP.service';
@NgModule({
@ -39,22 +28,10 @@ import { ReferentsEPService } from './commun/services/referentsEP.service';
AppRoutingModule,
HttpClientModule,
CollaborateursModule,
CommunApiModule,
CommunUiModule,
AuthModule.forRoot()
],
providers: [
CollaborateursService,
DemandesDelegationService,
DemandesEPIService,
DemandesFormationService,
EngagementsService,
EpService,
FormationsService,
NotesService,
ParticipationsFormationsService,
ReferentsEPService
CommunModule,
CommunUiModule
],
providers: [],
bootstrap: [AppComponent]
})

@ -1,5 +1,4 @@
import { OAuthModuleConfig } from 'angular-oauth2-oidc';
import { URL_API } from '../config/variables';
/**
* Liste des urls pour lesquelles les appels doivent être interceptés.
@ -7,7 +6,7 @@ import { URL_API } from '../config/variables';
*/
export const authModuleConfig: OAuthModuleConfig = {
resourceServer: {
allowedUrls: [URL_API],
allowedUrls: ['https://localhost:44393/api'],
sendAccessToken: true,
}
};

@ -1,5 +1,4 @@
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DemandesFormationService } from './services/demandesformation.service';
import { CollaborateursService } from './services/collaborateurs.service';
@ -11,35 +10,25 @@ import { FormationsService } from './services/formations.service';
import { NotesService } from './services/notes.service';
import { ParticipationsFormationsService } from './services/participationsFormations.service';
import { ReferentsEPService } from './services/referentsEP.service';
import { Configuration } from './config/configuration';
import { HttpClient } from '@angular/common/http';
@NgModule({
declarations: [],
imports: [
CommonModule
],
declarations: []
providers: [
CollaborateursService,
DemandesDelegationService,
DemandesEPIService,
DemandesFormationService,
EngagementsService,
EpService,
FormationsService,
NotesService,
ParticipationsFormationsService,
ReferentsEPService
]
})
export class CommunApiModule {
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<CommunApiModule> {
return {
ngModule: CommunApiModule,
providers: [
{ provide: Configuration, useFactory: configurationFactory },
CollaborateursService,
DemandesDelegationService,
DemandesEPIService,
DemandesFormationService,
EngagementsService,
EpService,
FormationsService,
NotesService,
ParticipationsFormationsService,
ReferentsEPService
]
};
}
}
export class CommunModule {}

@ -82,7 +82,8 @@ import { ProchainEpComponent } from './affichage-details-collaboarteur/prochain-
// Module commun
FilterModule,
RouterModule
RouterModule,
AuthModule.forRoot()
],
exports: [
// Materials

@ -7,6 +7,3 @@ export const COLLECTION_FORMATS = {
'ssv': ' ',
'pipes': '|'
}
export const URL_API = "https://localhost:44393/api";
export const URL_AUTH = "http://localhost:8080";

@ -20,14 +20,14 @@ import { Observable } from 'rxjs';
import { CollaborateurDTO } from '../model/collaborateurDTO';
import { ErreurDTO } from '../model/erreurDTO';
import { BASE_PATH, COLLECTION_FORMATS, URL_API } from '../config/variables';
import { BASE_PATH, COLLECTION_FORMATS } from '../config/variables';
import { Configuration } from '../config/configuration';
@Injectable()
export class CollaborateursService {
protected basePath = URL_API;
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -27,7 +27,7 @@ import { Configuration } from '../config/con
@Injectable()
export class DemandesDelegationService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -28,7 +28,7 @@ import { Configuration } from '../config/con
@Injectable()
export class DemandesEPIService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -28,7 +28,7 @@ import { Configuration } from '../config/con
@Injectable()
export class EngagementsService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -30,7 +30,7 @@
@Injectable()
export class EpService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -25,20 +25,18 @@ import { OrigineFormationDTO } from '../model/origineFormationDTO';
import { StatutFormationDTO } from '../model/statutFormationDTO';
import { TypeFormationDTO } from '../model/typeFormationDTO';
import { BASE_PATH, COLLECTION_FORMATS, URL_API } from '../config/variables';
import { BASE_PATH, COLLECTION_FORMATS } from '../config/variables';
import { Configuration } from '../config/configuration';
@Injectable()
export class FormationsService {
protected basePath = URL_API;
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();
constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
console.log("HERE");
console.log("c " + configuration);
if (basePath) {
this.basePath = basePath;
}
@ -479,12 +477,10 @@ export class FormationsService {
let headers = this.defaultHeaders;
// authentication (bearerAuth) required
console.log("config" + this.configuration.accessToken);
if (this.configuration.accessToken) {
const accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
console.log("token" + accessToken);
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header

@ -28,7 +28,7 @@ import { Configuration } from '../config/con
@Injectable()
export class NotesService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -28,7 +28,7 @@ import { Configuration } from '../config/con
@Injectable()
export class ParticipationsFormationsService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -27,7 +27,7 @@ import { Configuration } from '../config/con
@Injectable()
export class ReferentsEPService {
protected basePath = 'http://digitepa_proxy/api';
protected basePath = 'https://localhost:44393/api';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

@ -1,14 +1,11 @@
import { AuthConfig } from 'angular-oauth2-oidc';
import { URL_AUTH } from 'app/commun/config/variables';
const keycloakConfig: AuthConfig = {
// Url of the Identity Provider
//issuer: 'http://localhost:8080/auth/realms/Apside',
issuer: URL_AUTH + '/auth/realms/Apside',
issuer: 'http://localhost:8080/auth/realms/Apside',
// URL of the SPA to redirect the user to after login
redirectUri: 'http://localhost:4200/',
redirectUri: 'http://localhost:4200',
// The SPA's id. The SPA is registerd with this id at the auth-server
clientId: 'GestionEPA',
@ -18,9 +15,7 @@ const keycloakConfig: AuthConfig = {
// and it might not enforce further best practices vital for security
// such applications.
//dummyClientSecret: 'b261c083-d8ba-4a7c-918e-9d13393f33bd',
//dummyClientSecret: '201a3d53-7cd5-4613-bcb6-f2e98c1ba2ec',
dummyClientSecret: '0073bd5c-5737-45b6-a811-df3d31bfd5fa',
dummyClientSecret: '201a3d53-7cd5-4613-bcb6-f2e98c1ba2ec',
// To configure your solution for code flow + PKCE you have to set the responseType to code
responseType: 'code',

@ -3,16 +3,13 @@
// The list of file replacements can be found in `angular.json`.
import { AuthConfig } from 'angular-oauth2-oidc';
import { URL_AUTH } from 'app/commun/config/variables';
const keycloakConfig: AuthConfig = {
// Url of the Identity Provider
//issuer: 'http://localhost:8080/auth/realms/Apside',
issuer: URL_AUTH + '/auth/realms/Apside',
issuer: 'http://localhost:8080/auth/realms/Apside',
// URL of the SPA to redirect the user to after login
redirectUri: 'http://localhost:4200/',
redirectUri: 'http://localhost:4200',
// The SPA's id. The SPA is registerd with this id at the auth-server
clientId: 'GestionEPA',
@ -22,9 +19,7 @@ const keycloakConfig: AuthConfig = {
// and it might not enforce further best practices vital for security
// such applications.
//dummyClientSecret: 'b261c083-d8ba-4a7c-918e-9d13393f33bd',
//dummyClientSecret: '201a3d53-7cd5-4613-bcb6-f2e98c1ba2ec',
dummyClientSecret: 'fb3102cc-be74-4beb-b646-65a625998ec3',
dummyClientSecret: '201a3d53-7cd5-4613-bcb6-f2e98c1ba2ec',
// To configure your solution for code flow + PKCE you have to set the responseType to code
responseType: 'code',

Loading…
Cancel
Save