@@ -72,7 +72,7 @@ translate_list_of_signing_keys(ListOfKidPath) ->
7272translate_endpoint_params (Variable , Conf ) ->
7373 Params0 = cuttlefish_variable :filter_by_prefix (" auth_oauth2." ++ Variable , Conf ),
7474 Params = [{list_to_binary (Param ), list_to_binary (V )} ||
75- {[" auth_oauth2" , Name , Param ], V } <- Params0 ],
75+ {[" auth_oauth2" , _ , Param ], V } <- Params0 ],
7676 maps :from_list (Params ).
7777
7878validator_file_exists (Attr , Filename ) ->
@@ -104,9 +104,10 @@ extract_oauth_providers_properties(Settings) ->
104104 ValueFun = fun extract_value /1 ,
105105
106106 OAuthProviders = [{Name , mapOauthProviderProperty ({list_to_atom (Key ), list_to_binary (V )})}
107- || {[" auth_oauth2" ," oauth_providers" , Name , Key ], V } <- Settings ],
107+ || {[" auth_oauth2" , " oauth_providers" , Name , Key ], V } <- Settings ],
108108 maps :groups_from_list (KeyFun , ValueFun , OAuthProviders ).
109109
110+
110111extract_resource_server_properties (Settings ) ->
111112 KeyFun = fun extract_key_as_binary /1 ,
112113 ValueFun = fun extract_value /1 ,
@@ -122,6 +123,15 @@ mapOauthProviderProperty({Key, Value}) ->
122123 jwks_uri -> validator_https_uri (Key , Value );
123124 end_session_endpoint -> validator_https_uri (Key , Value );
124125 authorization_endpoint -> validator_https_uri (Key , Value );
126+ token_endpoint_params ->
127+ cuttlefish :invalid (io_lib :format (
128+ " Invalid attribute (~p ) value: should be a map of Key,Value pairs" , [Key ]));
129+ authorization_endpoint_params ->
130+ cuttlefish :invalid (io_lib :format (
131+ " Invalid attribute (~p ) value: should be a map of Key,Value pairs" , [Key ]));
132+ discovery_endpoint_params ->
133+ cuttlefish :invalid (io_lib :format (
134+ " Invalid attribute (~p ) value: should be a map of Key,Value pairs" , [Key ]));
125135 _ -> Value
126136 end }.
127137
@@ -163,9 +173,10 @@ extract_resource_server_preferred_username_claims(Settings) ->
163173extract_oauth_providers_endpoint_params (Variable , Settings ) ->
164174 KeyFun = fun extract_key_as_binary /1 ,
165175
166- IndexedParams = [{Name , {ParamName , list_to_binary (V )}} ||
167- {[" auth_oauth2" ," oauth_providers" , Name , EndpointVar , ParamName ], V } <- Settings , EndpointVar == Variable ],
168- maps :map (fun (_K ,V )-> [{Variable , V }] end ,
176+ IndexedParams = [{Name , {list_to_binary (ParamName ), list_to_binary (V )}} ||
177+ {[" auth_oauth2" ," oauth_providers" , Name , EndpointVar , ParamName ], V }
178+ <- Settings , EndpointVar == atom_to_list (Variable ) ],
179+ maps :map (fun (_K ,V )-> [{Variable , maps :from_list (V )}] end ,
169180 maps :groups_from_list (KeyFun , fun ({_ , V }) -> V end , IndexedParams )).
170181
171182extract_oauth_providers_signing_keys (Settings ) ->
0 commit comments