Skip to content

Commit

Permalink
Merge pull request #742 from numerique-gouv/remove-agentconnect-occur…
Browse files Browse the repository at this point in the history
…ences

refactor: remove occurences of AgentConnect
  • Loading branch information
rdubigny authored Oct 11, 2024
2 parents 9b55851 + 747f8f3 commit 5c318bf
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
- redirect_after_session_expiration
- reset_password
- set_info_after_account_provisioning
- signin_from_agentconnect_client
- signin_from_legacy_client
- signin_from_proconnect_federation_client
- signin_from_standard_client
- signin_with_email_verification_renewal
- signin_with_magic_link
Expand All @@ -68,15 +68,15 @@ jobs:
MCP_PROVIDER: ${{ env.MONCOMPTEPRO_HOST }}
MCP_SCOPES: openid email profile organization
STYLESHEET_URL: ""
moncomptepro-agentconnect-client:
moncomptepro-proconnect-federation-client:
image: ghcr.io/numerique-gouv/moncomptepro-test-client
ports:
- 4001:3000
env:
SITE_TITLE: moncomptepro-agentconnect-client
SITE_TITLE: moncomptepro-proconnect-federation-client
HOST: http://localhost:4001
MCP_CLIENT_ID: agentconnect_client_id
MCP_CLIENT_SECRET: agentconnect_client_secret
MCP_CLIENT_ID: proconnect_federation_client_id
MCP_CLIENT_SECRET: proconnect_federation_client_secret
MCP_PROVIDER: ${{ env.MONCOMPTEPRO_HOST }}
MCP_SCOPES: openid uid given_name usual_name email siren siret organizational_unit belonging_population phone chorusdt is_service_public is_public_service
MCP_ID_TOKEN_SIGNED_RESPONSE_ALG: ES256
Expand Down
3 changes: 2 additions & 1 deletion assets/js/password-feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ document.addEventListener(
"mon compte pro",
"agentconnect",
"agent connect",
"cheval exact agrafe pile",
"proconnect",
"pro connect",
].forEach((blacklistedWord) => {
if (inputValue.toLowerCase().includes(blacklistedWord)) {
setError(passwordInputMessageBlacklistedWordElement);
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/check_email_deliverability/fixtures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ INSERT INTO oidc_clients
authorization_signed_response_alg, introspection_signed_response_alg)
VALUES
(
'AgentConnect',
'agentconnect_client_id',
'agentconnect_client_secret',
'ProConnect Federation',
'proconnect_federation_client_id',
'proconnect_federation_client_secret',
ARRAY [
'http://localhost:4001/login-callback'
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ INSERT INTO oidc_clients
authorization_signed_response_alg, introspection_signed_response_alg)
VALUES
(
'AgentConnect',
'agentconnect_client_id',
'agentconnect_client_secret',
'ProConnect Federation',
'proconnect_federation_client_id',
'proconnect_federation_client_secret',
ARRAY [
'http://localhost:4001/login-callback'
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//

describe("sign-in from agentconnect client", () => {
describe("sign-in from proconnect federation client", () => {
it("should sign-in", () => {
cy.visit("http://localhost:4001");
cy.get("button.proconnect-button").click();
Expand All @@ -10,7 +10,7 @@ describe("sign-in from agentconnect client", () => {
.contains("S’identifier")
.click();

cy.contains("moncomptepro-agentconnect-client");
cy.contains("moncomptepro-proconnect-federation-client");
cy.contains("[email protected]");
cy.contains("21340126800130");
});
Expand All @@ -22,7 +22,7 @@ describe("sign-in from agentconnect client", () => {
cy.visit("http://localhost:4001");
cy.get("button.proconnect-button").click();

cy.contains("moncomptepro-agentconnect-client");
cy.contains("moncomptepro-proconnect-federation-client");
cy.contains("[email protected]");
});

Expand All @@ -38,7 +38,7 @@ describe("sign-in from agentconnect client", () => {
.contains("S’identifier")
.click();

cy.contains("moncomptepro-agentconnect-client");
cy.contains("moncomptepro-proconnect-federation-client");
cy.contains("[email protected]");
});
});
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ services:
STYLESHEET_URL:
network_mode: "host"

moncomptepro-agentconnect-client:
moncomptepro-proconnect-federation-client:
image: ghcr.io/numerique-gouv/moncomptepro-test-client
environment:
PORT: 4001
SITE_TITLE: moncomptepro-agentconnect-client
SITE_TITLE: moncomptepro-proconnect-federation-client
HOST: http://localhost:4001
MCP_CLIENT_ID: agentconnect_client_id
MCP_CLIENT_SECRET: agentconnect_client_secret
MCP_CLIENT_ID: proconnect_federation_client_id
MCP_CLIENT_SECRET: proconnect_federation_client_secret
MCP_PROVIDER: http://localhost:3000
MCP_SCOPES: openid uid given_name usual_name email siren siret organizational_unit belonging_population phone chorusdt is_service_public is_public_service
MCP_ID_TOKEN_SIGNED_RESPONSE_ALG: ES256
Expand Down
2 changes: 1 addition & 1 deletion scripts/fixtures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ VALUES
'Créer des cartes en ligne facilement.',
null, null, null, null),
(15,
'AgentConnect',
'ProConnect Federation',
'36112b36ddcbe735b406c69e59f87fc5a96eed87923e42777f76f705c3a55e1e7a98a38a6e500640d4ce366124dc0a537cfaa967b6ef51fa99b2ca8edb8bff66',
'85be6a293bfe2fa6ced0b246b83893a062635e577848bbbbb268da8ca0cc5844c2f5f2cbc8888891b4ac2b21a7599e47344c651a66d04f8cc34a454a5d0f1693',
ARRAY [
Expand Down
4 changes: 2 additions & 2 deletions src/config/oidc-provider-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const oidcProviderConfiguration = ({
],
// This scope will be deprecated
organizations: ["organizations"],
// Additional scopes for AgentConnect use only
// Additional scopes for ProConnect Federation use only
uid: ["uid"],
given_name: ["given_name"],
usual_name: ["usual_name"],
Expand Down Expand Up @@ -134,7 +134,7 @@ export const oidcProviderConfiguration = ({
"organization",
// This scope will be deprecated
"organizations",
// Additional scopes for AgentConnect use only
// Additional scopes for ProConnect Federation use only
"uid",
"given_name",
"usual_name",
Expand Down
4 changes: 2 additions & 2 deletions src/services/oidc-account-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export const findAccount: FindAccount = async (_ctx, sub) => {

const personalClaims = {
sub: id.toString(), // it is essential to always return a sub claim
uid: id.toString(), // for AgentConnect use only
uid: id.toString(), // for ProConnect Federation use only
email,
email_verified,
updated_at,
given_name,
family_name,
usual_name: family_name, // for AgentConnect use only
usual_name: family_name, // for ProConnect Federation use only
phone_number,
phone_number_verified: false,
job,
Expand Down
3 changes: 2 additions & 1 deletion src/services/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const isPasswordSecure = (plainPassword: string, email: string) => {
"mon compte pro",
"agentconnect",
"agent connect",
"cheval exact agrafe pile",
"proconnect",
"pro connect",
];

const containsBlacklistedWord = lowerCasedBlacklistedWords.some((word) =>
Expand Down
2 changes: 1 addition & 1 deletion test/must-return-one-organization-in-payload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("mustReturnOneOrganizationInPayload", () => {
);
});

it("should return true for AgentConnect required scopes", () => {
it("should return true for ProConnect Federation required scopes", () => {
assert.equal(
mustReturnOneOrganizationInPayload(
"openid uid given_name usual_name email siren siret organizational_unit belonging_population phone chorusdt idp_id idp_acr",
Expand Down
18 changes: 8 additions & 10 deletions test/security.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,14 @@ describe("isPasswordSecure", () => {
true,
);
});
["cheval exact agrafe pile", "MonComptePro-2023!"].forEach(
(blacklistedWord) => {
it("should not contains blacklisted word", () => {
assert.equal(
isPasswordSecure(blacklistedWord, "[email protected]"),
false,
);
});
},
);
["Pro Connect forever", "MonComptePro-2023!"].forEach((blacklistedWord) => {
it("should not contains blacklisted word", () => {
assert.equal(
isPasswordSecure(blacklistedWord, "[email protected]"),
false,
);
});
});
it("should not contains users email address", () => {
assert.equal(
isPasswordSecure("[email protected]!", "[email protected]"),
Expand Down

0 comments on commit 5c318bf

Please sign in to comment.