@@ -164,27 +164,21 @@ def from_dict(cls, data):
164
164
:param data: A dict representation of an InternalData object
165
165
:return: An InternalData object
166
166
"""
167
- auth_info = data .get ("auth_info" , AuthenticationInformation ())
167
+ auth_info = AuthenticationInformation .from_dict (
168
+ data .get ("auth_info" , {})
169
+ )
168
170
instance = cls (
169
- auth_info = AuthenticationInformation . from_dict ( auth_info ) ,
171
+ auth_info = auth_info ,
170
172
requester = data .get ("requester" ),
171
173
requester_name = data .get ("requester_name" ),
172
174
subject_id = data .get ("subject_id" ),
173
175
subject_type = data .get ("subject_type" ),
174
176
attributes = data .get ("attributes" ),
177
+ user_id = data .get ("user_id" ),
178
+ user_id_hash_type = data .get ("hash_type" ),
179
+ name_id = data .get ("name_id" ),
180
+ approved_attributes = data .get ("approved_attributes" ),
175
181
)
176
-
177
- if instance .attributes is None :
178
- approved_attributes = data .get ("approved_attributes" )
179
- instance .attributes = (
180
- approved_attributes
181
- if approved_attributes is not None
182
- else {}
183
- )
184
- if instance .subject_type is None :
185
- instance .subject_type = data .get ("subject_type" )
186
- if instance .subject_id is None :
187
- instance .subject_id = data .get ("user_id" ) or data .get ("name_id" )
188
182
return instance
189
183
190
184
@property
0 commit comments