Skip to content

Commit 7ac2469

Browse files
committed
Merge branch 'main' into douglasduteil/feat-database-create-database-schema-package
2 parents 8500486 + 6d68d13 commit 7ac2469

File tree

22 files changed

+2160
-3475
lines changed

22 files changed

+2160
-3475
lines changed

.github/workflows/end-to-end.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- signin_with_right_acr
5353
- signin_with_totp
5454
- signin_with_totp_enrollment
55+
- signin_with_webauthn
5556
- signup_entreprise_unipersonnelle
5657
- signup_with_certification_dirigeant
5758
- update_personal_information
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: 🏢 Update Annuaire Entreprises
2+
3+
on:
4+
schedule:
5+
- cron: "0 2 * * *" # Daily at 2 AM UTC
6+
pull_request:
7+
paths:
8+
- "packages/annuaire_entreprises/scripts/build-data.ts"
9+
- ".github/workflows/update-annuaire.yml"
10+
workflow_dispatch:
11+
12+
jobs:
13+
update:
14+
name: 🔄 Update data files
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
env:
20+
DRY_RUN: ${{ github.event_name == 'pull_request' }}
21+
steps:
22+
- name: 📥 Checkout repository
23+
uses: actions/checkout@v5
24+
25+
- name: ⚙️ Enable corepack
26+
run: corepack enable
27+
28+
- name: 📦 Setup Node.js
29+
uses: actions/setup-node@v5
30+
with:
31+
cache: "npm"
32+
node-version-file: package.json
33+
34+
- name: 📥 Install dependencies
35+
run: npm ci
36+
37+
- name: 🔍 Get latest commit from search-infra
38+
id: latest
39+
run: |
40+
LATEST_COMMIT=$(git ls-remote https://github.com/annuaire-entreprises-data-gouv-fr/search-infra.git HEAD | cut -f1)
41+
echo "commit=$LATEST_COMMIT" >> $GITHUB_OUTPUT
42+
echo "short_commit=${LATEST_COMMIT:0:7}" >> $GITHUB_OUTPUT
43+
44+
- name: 📋 Get current commit
45+
id: current
46+
run: |
47+
CURRENT=$(cat packages/annuaire_entreprises/data/.commit)
48+
echo "commit=$CURRENT" >> $GITHUB_OUTPUT
49+
echo "short_commit=${CURRENT:0:7}" >> $GITHUB_OUTPUT
50+
51+
- name: ✅ Check if update needed
52+
id: check
53+
run: |
54+
if [ "${{ steps.latest.outputs.commit }}" != "${{ steps.current.outputs.commit }}" ]; then
55+
echo "needs_update=true" >> $GITHUB_OUTPUT
56+
else
57+
echo "needs_update=false" >> $GITHUB_OUTPUT
58+
fi
59+
60+
- name: 📦 Update commit reference
61+
if: steps.check.outputs.needs_update == 'true'
62+
run: |
63+
echo "${{ steps.latest.outputs.commit }}" > packages/annuaire_entreprises/data/.commit
64+
65+
- name: 🔄 Rebuild data files
66+
if: steps.check.outputs.needs_update == 'true'
67+
run: npm run build:data
68+
working-directory: packages/annuaire_entreprises
69+
70+
- name: 🔍 Check for data changes
71+
if: steps.check.outputs.needs_update == 'true'
72+
id: data_check
73+
run: |
74+
if git diff --quiet packages/annuaire_entreprises/data/*.json; then
75+
echo "needs_update=false" >> $GITHUB_OUTPUT
76+
else
77+
echo "needs_update=true" >> $GITHUB_OUTPUT
78+
fi
79+
80+
- name: 🏷️ Show update summary
81+
if: steps.data_check.outputs.needs_update == 'true'
82+
run: |
83+
echo "📊 Update Summary:"
84+
echo " Current: ${{ steps.current.outputs.short_commit }}"
85+
echo " Latest: ${{ steps.latest.outputs.short_commit }}"
86+
echo " Dry run: ${{ env.DRY_RUN }}"
87+
88+
- name: 📋 Show data diff
89+
if: steps.data_check.outputs.needs_update == 'true'
90+
run: |
91+
echo "::group::📊 Data changes"
92+
git diff --stat packages/annuaire_entreprises/data/
93+
echo ""
94+
git diff packages/annuaire_entreprises/data/
95+
echo "::endgroup::"
96+
97+
- name: 📝 Create changeset
98+
if: steps.data_check.outputs.needs_update == 'true'
99+
run: |
100+
mkdir -p .changeset
101+
cat << EOF > .changeset/update-annuaire-${{ steps.latest.outputs.short_commit }}.md
102+
---
103+
"@proconnect-gouv/proconnect.annuaire_entreprises": patch
104+
---
105+
106+
⬆️ Mise à jour des données annuaire entreprises depuis search-infra@${{ steps.latest.outputs.short_commit }}
107+
EOF
108+
109+
- name: 🔀 Create Pull Request
110+
if: steps.data_check.outputs.needs_update == 'true' && env.DRY_RUN != 'true'
111+
uses: peter-evans/create-pull-request@v7
112+
with:
113+
add-paths: |
114+
.changeset/*.md
115+
packages/annuaire_entreprises/data/.commit
116+
packages/annuaire_entreprises/data/*.json
117+
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
118+
branch: github-actions/update-annuaire-${{ steps.latest.outputs.short_commit }}
119+
commit-message: "⬆️ bump annuaire-entreprises-data-gouv-fr/search-infra@${{ steps.latest.outputs.short_commit }}"
120+
delete-branch: true
121+
title: "⬆️ bump annuaire-entreprises-data-gouv-fr/search-infra@${{ steps.latest.outputs.short_commit }}"
122+
body: |
123+
<div align=center><img src="https://annuaire-entreprises.data.gouv.fr/images/linkedin.jpg" /></div>
124+
125+
---
126+
127+
Automated update of `@annuaire-entreprises-data-gouv-fr/search-infra` from ${{ steps.current.outputs.short_commit }} to ${{ steps.latest.outputs.short_commit }}.

cypress/README.md

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -69,65 +69,3 @@ CYPRESS_RECORD=true CYPRESS_RECORD_FOR_HUMANS=true npx dotenvx run -- npx cypres
6969

7070
The videos are listed on the following documentation page: https://documentation.beta.numerique.gouv.fr/doc/videos-des-differents-parcours-A3UJiqFLZn
7171
If tests or visuals are added or modified, please update the videos in the documentation.
72-
73-
## Testing manually webauthn authent"
74-
75-
### Registration from dashboard pages
76-
77-
#### npm run fixtures:load
78-
79-
Given these data are loaded
80-
When I visit the page localhost:3000/users/start-sign-in
81-
And I authenticate with user@yopmail.com
82-
And I enter the password user@yopmail.com
83-
When I go to the page localhost:3000/connection-and-account
84-
When I click on « Configurer la double authentification »
85-
And I select « Clé d'accès (passkey) »
86-
And I click on « Continuer »
87-
When I create a new passkey
88-
Then I am redirected to localhost:3000/connection-and-account?notification=passkey_successfully_created
89-
And I see the notification « Tout est en ordre ! Vous pouvez désormais utiliser votre empreinte, votre visage ou le verrouillage de l'écran pour vous connecter sur cet appareil. »
90-
91-
### Authentication with previously set passkey (2fa should be forced)
92-
93-
Given the existing user data from the last scenario
94-
When I visit the page localhost:3000/users/start-sign-in
95-
And I authenticate with user@yopmail.com
96-
And I enter the password user@yopmail.com
97-
Then I am redirected to localhost:3000/users/2fa-sign-in
98-
And I see the title « Valider avec la double authentification »
99-
When I click on « Se connecter avec une clé d'accès »
100-
And I authenticate with a passkey
101-
Then I am redirected to the page localhost:3000
102-
103-
### Registration from 2FA force enrollment
104-
105-
#### ENABLE_DATABASE_DELETION=True npm run e2e:setup signin_with_totp_enrollment
106-
107-
Given these data are loaded
108-
When I visit the page localhost:4000
109-
And I click on « Forcer une connexion à deux facteurs »
110-
Then I am redirected to localhost:3000/users/start-sign-in
111-
When I authenticate with ial2-aal1@yopmail.com
112-
And I enter the password password123
113-
Then I am redirected to localhost:3000/users/double-authentication-choice
114-
When I select « Clé d'accès (passkey) »
115-
And I click on « Continuer »
116-
When I create a new passkey
117-
Then I am redirected to localhost:3000/users/2fa-successfully-configured
118-
When I click on « Continuer »
119-
Then I am redirected to localhost:4000 (the service provider)
120-
121-
### Authentication with previously set passkey (2fa should not be forced unless on /connection-and-account)
122-
123-
Given the existing user data from the last scenario
124-
When I visit the page localhost:4000
125-
And I click on the ProConnect login button
126-
Then I am redirected to localhost:3000/users/start-sign-in
127-
When I authenticate with ial2-aal1@yopmail.com
128-
And I enter the password password123
129-
Then I am redirected to localhost:4000 (the service provider)
130-
When I visit the dashboard on localhost:3000
131-
And I click on « Compte et connexion »
132-
Then I am redirected to localhost:3000/users/2fa-sign-in?notification=2fa_required
133-
And I must authenticate with a passkey

cypress/e2e/signin_with_webauthn/env.conf

Whitespace-only changes.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
INSERT INTO
2+
users (
3+
id,
4+
email,
5+
email_verified,
6+
email_verified_at,
7+
encrypted_password,
8+
created_at,
9+
updated_at,
10+
given_name,
11+
family_name,
12+
phone_number,
13+
job
14+
)
15+
VALUES
16+
(
17+
1,
18+
'lion.eljonson@darkangels.world',
19+
true,
20+
CURRENT_TIMESTAMP,
21+
'$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO',
22+
CURRENT_TIMESTAMP,
23+
CURRENT_TIMESTAMP,
24+
'Lion',
25+
'El''Jonson',
26+
'I',
27+
'Primarque'
28+
);
29+
30+
INSERT INTO
31+
organizations (id, siret, created_at, updated_at)
32+
VALUES
33+
(
34+
1,
35+
'21340126800130',
36+
CURRENT_TIMESTAMP,
37+
CURRENT_TIMESTAMP
38+
);
39+
40+
INSERT INTO
41+
users_organizations (
42+
user_id,
43+
organization_id,
44+
is_external,
45+
verification_type,
46+
has_been_greeted
47+
)
48+
VALUES
49+
(1, 1, false, 'domain', true);
50+
51+
INSERT INTO
52+
oidc_clients (
53+
client_name,
54+
client_id,
55+
client_secret,
56+
redirect_uris,
57+
post_logout_redirect_uris,
58+
scope,
59+
client_uri,
60+
client_description,
61+
userinfo_signed_response_alg,
62+
id_token_signed_response_alg,
63+
authorization_signed_response_alg,
64+
introspection_signed_response_alg
65+
)
66+
VALUES
67+
(
68+
'Oidc Test Client',
69+
'standard_client_id',
70+
'standard_client_secret',
71+
ARRAY['http://localhost:4000/login-callback'],
72+
ARRAY['http://localhost:4000/'],
73+
'openid email profile organization',
74+
'http://localhost:4000/',
75+
'ProConnect test client. More info: https://github.com/proconnect-gouv/proconnect-test-client.',
76+
null,
77+
null,
78+
null,
79+
null
80+
);

0 commit comments

Comments
 (0)