Skip to content

chore(admin): #IMPULS-5854 uniformise le fichier de proxy de développement avec .env - #1051

Merged
damienromito merged 2 commits into
develop-b2schoolfrom
tools-IMPULS-5854-uniformize-env-proxy-file
Jun 22, 2026
Merged

chore(admin): #IMPULS-5854 uniformise le fichier de proxy de développement avec .env#1051
damienromito merged 2 commits into
develop-b2schoolfrom
tools-IMPULS-5854-uniformize-env-proxy-file

Conversation

@damienromito

@damienromito damienromito commented Jun 19, 2026

Copy link
Copy Markdown
Member

Description

Uniformise la configuration du proxy de développement d'Admin avec le reste des frontends Edifice en remplaçant le fichier .proxyRemoteConfig.js (propre à Angular/Admin) par un fichier .env standard (VITE_RECETTE / VITE_XSRF_TOKEN / VITE_ONE_SESSION_ID).

Cela permet à dev-auth-fetcher de gérer Admin comme n'importe quel autre frontend et de générer son fichier de credentials automatiquement. (voir PR edificeio/dev-auth-fetcher#4)

Fixes

IMPULS-5854

Type of change

  • Chore (PATCH)

Which packages changed?

  • admin

Tests

  1. Créer admin/src/main/ts/.env à partir de .env.template en renseignant VITE_RECETTE, VITE_XSRF_TOKEN et VITE_ONE_SESSION_ID
  2. Lancer ng serve
  3. Vérifier dans les logs que Using remote proxy configuration target: <url> s'affiche
  4. Naviguer dans l'admin et vérifier que les requêtes API partent bien vers le serveur distant

Alternativement : utiliser dev-auth-fetcher connect — Admin apparaît désormais dans la liste des apps et le .env est généré automatiquement.

Reminder

  • Security flaws

  • Performance impacts (think bulk !)

  • Unit tests were replayed

  • Unit tests were added and/or changed

  • I have updated the reminder for the version including my modifications

  • All done ! 😃

@damienromito
damienromito changed the base branch from master to develop-b2school June 19, 2026 09:06
@damienromito
damienromito force-pushed the tools-IMPULS-5854-uniformize-env-proxy-file branch from 50cfc84 to a1da75e Compare June 19, 2026 09:08
@damienromito
damienromito requested a review from jcbe-ode June 19, 2026 09:13
@damienromito damienromito self-assigned this Jun 19, 2026
@pb-jo
pb-jo force-pushed the develop-b2school branch from 01c357f to 047d7a0 Compare June 19, 2026 13:29
@damienromito
damienromito force-pushed the tools-IMPULS-5854-uniformize-env-proxy-file branch from a1da75e to 077b969 Compare June 19, 2026 14:07

@jcbe-ode jcbe-ode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ca parait OK

  • petite amélioration du code suggérée au passage.

PROXY_FAVICO.target = target;
if (oneSessionId && xsrfToken) {
PROXY_CONFIG.headers = {
cookie: `oneSessionId=${oneSessionId}; authenticated=true; XSRF-TOKEN=${xsrfToken}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cookie: `oneSessionId=${oneSessionId}; authenticated=true; XSRF-TOKEN=${xsrfToken}`,
cookie: `oneSessionId=${env.VITE_ONE_SESSION_ID}; authenticated=true; XSRF-TOKEN=${xsrfToken}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les variables intermédiaires oneSessionId, xsrfToken et target complexifient la lecture, je trouve.
On pourrait utiliser directement env ?

Ou bien la désérialiser ?

const {VITE_RECETTE, VITE_XSRF_TOKEN, VITE_ONE_SESSION_ID} = env;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est fait

@damienromito
damienromito force-pushed the tools-IMPULS-5854-uniformize-env-proxy-file branch from bcf2a6e to 850c67f Compare June 22, 2026 09:31
@damienromito
damienromito merged commit ab07b05 into develop-b2school Jun 22, 2026
@damienromito
damienromito deleted the tools-IMPULS-5854-uniformize-env-proxy-file branch June 22, 2026 09:32
@sonarqubecloud

Copy link
Copy Markdown

jcbe-ode pushed a commit that referenced this pull request Jun 22, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
juniorode pushed a commit that referenced this pull request Jun 22, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jenkinsEdificePublic pushed a commit that referenced this pull request Jun 23, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jcbe-ode pushed a commit that referenced this pull request Jun 23, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jenkinsEdificePublic pushed a commit that referenced this pull request Jun 24, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
damienromito added a commit that referenced this pull request Jun 24, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
pb-jo pushed a commit that referenced this pull request Jun 25, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jcbe-ode pushed a commit that referenced this pull request Jun 25, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
damienromito added a commit that referenced this pull request Jun 29, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jenkinsEdificePublic pushed a commit that referenced this pull request Jun 30, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jenkinsEdificePublic pushed a commit that referenced this pull request Jul 3, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jcbe-ode pushed a commit that referenced this pull request Jul 3, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
vbillard91 pushed a commit that referenced this pull request Jul 6, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
jenkinsEdificePublic pushed a commit that referenced this pull request Jul 7, 2026
…ement avec .env (#1051)

* chore(admin):#IMPULS-5854 uniformise env proxy file

* simplify from review comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants