@@ -176,12 +176,14 @@ def __init__(
176
176
self .email_verified = email_verified
177
177
178
178
def to_json (self ) -> Dict [str , Any ]:
179
- return {
179
+ res = {
180
180
"userId" : self .user_id ,
181
181
"email" : self .email ,
182
182
"emailVerified" : self .email_verified ,
183
183
}
184
184
185
+ return {k : v for k , v in res .items () if v is not None }
186
+
185
187
186
188
class UserInfoMap :
187
189
def __init__ (
@@ -252,21 +254,19 @@ def to_json(self) -> Dict[str, Any]:
252
254
"clients" : [c .to_json () for c in self .clients ]
253
255
if isinstance (self .clients , list )
254
256
else None ,
255
- # "authorizationEndpoint": self.authorization_endpoint,
256
- # "authorizationEndpointQueryParams": self.authorization_endpoint_query_params,
257
- # "tokenEndpoint": self.token_endpoint,
258
- # "tokenEndpointBodyParams": self.token_endpoint_body_params,
259
- # "userInfoEndpoint": self.user_info_endpoint,
260
- # "userInfoEndpointQueryParams": self.user_info_endpoint_query_params,
261
- # "userInfoEndpointHeaders": self.user_info_endpoint_headers,
262
- # "jwksUri": self.jwks_uri,
263
- # "oidcDiscoveryEndpoint": self.oidc_discovery_endpoint,
264
- # "userInfoMap": self.user_info_map.to_json()
265
- # if self.user_info_map is not None
266
- # else None,
267
- # "requireEmail": self.require_email,
268
- # "validateIdTokenPayload": self.validate_id_token_payload, # FIXME: This is a function, not a json
269
- # "generateFakeEmail": self.generate_fake_email, # FIXME: This is a function, not a json
257
+ "authorizationEndpoint" : self .authorization_endpoint ,
258
+ "authorizationEndpointQueryParams" : self .authorization_endpoint_query_params ,
259
+ "tokenEndpoint" : self .token_endpoint ,
260
+ "tokenEndpointBodyParams" : self .token_endpoint_body_params ,
261
+ "userInfoEndpoint" : self .user_info_endpoint ,
262
+ "userInfoEndpointQueryParams" : self .user_info_endpoint_query_params ,
263
+ "userInfoEndpointHeaders" : self .user_info_endpoint_headers ,
264
+ "jwksUri" : self .jwks_uri ,
265
+ "oidcDiscoveryEndpoint" : self .oidc_discovery_endpoint ,
266
+ "userInfoMap" : self .user_info_map .to_json ()
267
+ if self .user_info_map is not None
268
+ else None ,
269
+ "requireEmail" : self .require_email ,
270
270
}
271
271
272
272
return {k : v for k , v in res .items () if v is not None }
0 commit comments