Skip to content

Commit

Permalink
feat(fido2): allow to update device data in SG authentication respons…
Browse files Browse the repository at this point in the history
…e jans #8116

Signed-off-by: Yuriy Movchan <[email protected]>
  • Loading branch information
yurem committed Mar 26, 2024
1 parent 1454859 commit f715e12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand All @@ -18,6 +19,7 @@
* @author Yuriy Movchan Date: 03/21/2024
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class DeviceNotificationConf implements Serializable {

private static final long serialVersionUID = -8173244116167488365L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ def getTargetEndpointArn(self, deviceRegistrationService, pushSnsService, platfo

# Return endpoint ARN if it created already
notificationConf = u2fDevice.getDeviceNotificationConf()
notificationConfJson = {}
if StringHelper.isNotEmpty(notificationConf):
notificationConfJson = json.loads(notificationConf)
targetEndpointArn = notificationConfJson['sns_endpoint_arn']
Expand Down Expand Up @@ -950,9 +951,10 @@ def getTargetEndpointArn(self, deviceRegistrationService, pushSnsService, platfo
print "Super-Gluu. Get target endpoint ARN. Create target endpoint ARN '%s' for user: '%s'" % (targetEndpointArn, user.getUserId())

# Store created endpoint ARN in device entry
notificationConfJson['sns_endpoint_arn'] = targetEndpointArn
userInum = user.getAttribute("inum")
u2fDeviceUpdate = deviceRegistrationService.findUserDeviceRegistration(userInum, u2fDevice.getId())
u2fDeviceUpdate.setDeviceNotificationConf('{"sns_endpoint_arn" : "%s"}' % targetEndpointArn)
u2fDeviceUpdate.setDeviceNotificationConf(json.dumps(notificationConfJson))
deviceRegistrationService.updateDeviceRegistration(userInum, u2fDeviceUpdate)

return targetEndpointArn
Expand Down

0 comments on commit f715e12

Please sign in to comment.