File tree Expand file tree Collapse file tree 8 files changed +3
-44
lines changed
deployments/docker-compose-example
usecases/userAuthentication Expand file tree Collapse file tree 8 files changed +3
-44
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change @@ -34,11 +34,7 @@ import type { User } from "./user";
3434export 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
Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff line change 11SILL_KEYCLOAK_URL = http://localhost:8081/auth
22SILL_KEYCLOAK_REALM = codegouv
33SILL_KEYCLOAK_CLIENT_ID = sill
4- SILL_KEYCLOAK_ADMIN_PASSWORD = xxx
5- SILL_KEYCLOAK_ORGANIZATION_USER_PROFILE_ATTRIBUTE_NAME = agencyName
64SILL_README_URL = https://raw.githubusercontent.com/codegouvfr/sill/refs/heads/main/README.md
75SILL_TERMS_OF_SERVICE_URL = https://code.gouv.fr/sill/tos_fr.md
86SILL_JWT_ID = sub
Original file line number Diff line number Diff 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 } ) ,
Original file line number Diff line number Diff 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 ( ) => {
Original file line number Diff line number Diff 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" ]
Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments