Skip to content

Commit e414259

Browse files
committed
remove useless keycloak params
1 parent d0bbca1 commit e414259

File tree

8 files changed

+3
-44
lines changed

8 files changed

+3
-44
lines changed

api/src/env.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ const zConfiguration = z.object({
77
.object({
88
"url": z.string().nonempty(), //Example: https://auth.code.gouv.fr/auth (with the /auth at the end)
99
"realm": z.string().nonempty(),
10-
"clientId": z.string().nonempty(),
11-
"adminPassword": z.string().nonempty(),
12-
"organizationUserProfileAttributeName": z.string().nonempty()
10+
"clientId": z.string().nonempty()
1311
})
1412
.optional(),
1513
"termsOfServiceUrl": zLocalizedString,

api/src/rpc/router.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ import type { User } from "./user";
3434
export function createRouter(params: {
3535
dbApi: DbApiV2;
3636
useCases: UseCases;
37-
keycloakParams:
38-
| (KeycloakParams & {
39-
organizationUserProfileAttributeName: string;
40-
})
41-
| undefined;
37+
keycloakParams: KeycloakParams | undefined;
4238
jwtClaimByUserKey: Record<keyof User, string>;
4339
termsOfServiceUrl: LocalizedString;
4440
readmeUrl: LocalizedString;
@@ -108,17 +104,6 @@ export function createRouter(params: {
108104
return () => out;
109105
})()
110106
),
111-
"getOrganizationUserProfileAttributeName": loggedProcedure.query(
112-
(() => {
113-
const { organizationUserProfileAttributeName } = keycloakParams ?? {};
114-
if (organizationUserProfileAttributeName === undefined) {
115-
return () => {
116-
throw new TRPCError({ "code": "METHOD_NOT_SUPPORTED" });
117-
};
118-
}
119-
return () => organizationUserProfileAttributeName;
120-
})()
121-
),
122107
"getSoftwares": loggedProcedure.query(() => dbApi.software.getAll()),
123108
"getInstances": loggedProcedure.query(() => dbApi.instance.getAll()),
124109
"getExternalSoftwareOptions": loggedProcedure

api/src/rpc/start.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export async function startRpcService(params: {
2929
url: string;
3030
realm: string;
3131
clientId: string;
32-
adminPassword: string;
33-
organizationUserProfileAttributeName: string;
3432
};
3533
termsOfServiceUrl: LocalizedString;
3634
readmeUrl: LocalizedString;
@@ -112,8 +110,7 @@ export async function startRpcService(params: {
112110
: {
113111
"url": keycloakParams.url,
114112
"realm": keycloakParams.realm,
115-
"clientId": keycloakParams.clientId,
116-
"organizationUserProfileAttributeName": keycloakParams.organizationUserProfileAttributeName
113+
"clientId": keycloakParams.clientId
117114
},
118115
termsOfServiceUrl,
119116
readmeUrl,

deployments/docker-compose-example/.env.sample

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
SILL_KEYCLOAK_URL=http://localhost:8081/auth
22
SILL_KEYCLOAK_REALM=codegouv
33
SILL_KEYCLOAK_CLIENT_ID=sill
4-
SILL_KEYCLOAK_ADMIN_PASSWORD=xxx
5-
SILL_KEYCLOAK_ORGANIZATION_USER_PROFILE_ATTRIBUTE_NAME=agencyName
64
SILL_README_URL=https://raw.githubusercontent.com/codegouvfr/sill/refs/heads/main/README.md
75
SILL_TERMS_OF_SERVICE_URL=https://code.gouv.fr/sill/tos_fr.md
86
SILL_JWT_ID=sub

web/src/core/adapter/sillApi.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ export function createSillApi(params: {
5151
"getOidcParams": memoize(() => trpcClient.getOidcParams.query(), {
5252
"promise": true
5353
}),
54-
"getOrganizationUserProfileAttributeName": memoize(
55-
() => trpcClient.getOrganizationUserProfileAttributeName.query(),
56-
{
57-
"promise": true
58-
}
59-
),
6054
"getSoftwares": memoize(() => trpcClient.getSoftwares.query(), {
6155
"promise": true
6256
}),

web/src/core/adapter/sillApiMock.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ export const sillApi: SillApi = {
2525
}),
2626
{ "promise": true }
2727
),
28-
"getOrganizationUserProfileAttributeName": memoize(
29-
async () => {
30-
throw new Error("not implemented");
31-
},
32-
{ "promise": true }
33-
),
3428
"getSoftwares": memoize(() => Promise.resolve([...softwares]), { "promise": true }),
3529
"getInstances": memoize(
3630
async () => {

web/src/core/ports/SillApi.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ export type SillApi = {
2323
>;
2424
clear: () => void;
2525
};
26-
getOrganizationUserProfileAttributeName: {
27-
(params: TrpcRouterInput["getOrganizationUserProfileAttributeName"]): Promise<
28-
TrpcRouterOutput["getOrganizationUserProfileAttributeName"]
29-
>;
30-
clear: () => void;
31-
};
3226
getSoftwares: {
3327
(params: TrpcRouterInput["getSoftwares"]): Promise<
3428
TrpcRouterOutput["getSoftwares"]

web/src/core/usecases/userAuthentication/thunks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const thunks = {
3131

3232
const [, , { oidc }] = args;
3333

34-
console.log("asesrting user not logged : ", oidc.isUserLoggedIn);
3534
assert(!oidc.isUserLoggedIn);
3635

3736
return oidc.login({ doesCurrentHrefRequiresAuth });

0 commit comments

Comments
 (0)