diff --git a/docs/Migration-Instructions.md b/docs/Migration-Instructions.md index abd670ab..db6aa857 100644 --- a/docs/Migration-Instructions.md +++ b/docs/Migration-Instructions.md @@ -2,6 +2,7 @@ This page contains PowerAuth Enrollment Server migration instructions. +- [PowerAuth Enrollment Server 1.10.0](./PowerAuth-Enrollment-Server-1.10.0.md) - [PowerAuth Enrollment Server 1.9.0](./PowerAuth-Enrollment-Server-1.9.0.md) - [PowerAuth Enrollment Server 1.8.0](./PowerAuth-Enrollment-Server-1.8.0.md) - [PowerAuth Enrollment Server 1.7.0](./PowerAuth-Enrollment-Server-1.7.0.md) diff --git a/docs/Mobile-Token-API.md b/docs/Mobile-Token-API.md index d155655e..7729001e 100644 --- a/docs/Mobile-Token-API.md +++ b/docs/Mobile-Token-API.md @@ -790,15 +790,16 @@ Registers a device to push notifications. Authorization is done using PowerAuth ```json { "requestObject": { - "platform": "ios", + "platform": "apns", "token": "10de0b9c-791f-4e9f-93c4-e2203951c307" } } ``` Supported platforms: -- `ios` -- `android` +- `apns` +- `fcm` +- `hms` #### Response 200 @@ -869,15 +870,16 @@ Registers a device to push notifications. Authorization is done using PowerAuth ```json { "requestObject": { - "platform": "ios", + "platform": "apns", "token": "10de0b9c-791f-4e9f-93c4-e2203951c307" } } ``` Supported platforms: -- `ios` -- `android` +- `aps` +- `fcm` +- `hms` #### Response 200 diff --git a/docs/PowerAuth-Enrollment-Server-1.10.0.md b/docs/PowerAuth-Enrollment-Server-1.10.0.md new file mode 100644 index 00000000..66dc0ea4 --- /dev/null +++ b/docs/PowerAuth-Enrollment-Server-1.10.0.md @@ -0,0 +1,10 @@ +# Migration from 1.9.x to 1.10.x + +This guide contains instructions for migration from PowerAuth Enrollment Server version `1.9.x` to version `1.10.0`. + +## REST API + +### Platform Validation during Registration for Push Messages + +The endpoints `POST /api/push/device/register` and `POST /api/push/device/register/token` now use updated platform `platform` values `apns`, `fcm`, and `hms`. +The original values `ios`, `android`, and `huawei` are still supported, but will be removed in a future release. \ No newline at end of file diff --git a/docs/PowerAuth-Enrollment-Server-1.7.0.md b/docs/PowerAuth-Enrollment-Server-1.7.0.md index f6b607ef..6fbf8ac3 100644 --- a/docs/PowerAuth-Enrollment-Server-1.7.0.md +++ b/docs/PowerAuth-Enrollment-Server-1.7.0.md @@ -8,5 +8,5 @@ This guide contains instructions for migration from PowerAuth Enrollment Server ### Register for Push Messages (Token) -The endpoint `POST /api/push/device/register/token` now strictly validates `platform` against values `ios`, `android` or `huawei`. +The endpoints `POST /api/push/device/register` and `POST /api/push/device/register/token` now strictly validate `platform` against values `ios`, `android`, or `huawei`. If you use the PowerAuth SDK, you should not be affected. diff --git a/enrollment-server-api-model/src/main/java/com/wultra/app/enrollmentserver/api/model/enrollment/request/PushRegisterRequest.java b/enrollment-server-api-model/src/main/java/com/wultra/app/enrollmentserver/api/model/enrollment/request/PushRegisterRequest.java index 11121cbe..46a963cb 100644 --- a/enrollment-server-api-model/src/main/java/com/wultra/app/enrollmentserver/api/model/enrollment/request/PushRegisterRequest.java +++ b/enrollment-server-api-model/src/main/java/com/wultra/app/enrollmentserver/api/model/enrollment/request/PushRegisterRequest.java @@ -40,21 +40,33 @@ public class PushRegisterRequest { private Platform platform; /** - * The push token is the value received from APNS, FCM, or HMS services without any modification. + * The push token is the value received from APNs, FCM, or HMS services without any modification. */ @NotBlank @ToString.Exclude - @Schema(description = "The push token is the value received from APNS, FCM, or HMS services without any modification.") + @Schema(description = "The push token is the value received from APNs, FCM, or HMS services without any modification.") private String token; public enum Platform { + @JsonProperty("apns") + APNS, + + @JsonProperty("fcm") + FCM, + + @JsonProperty("hms") + HMS, + @JsonProperty("ios") + @Deprecated IOS, @JsonProperty("android") + @Deprecated ANDROID, @JsonProperty("huawei") + @Deprecated HUAWEI } diff --git a/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java b/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java index a3ee4a6f..556cb3fe 100644 --- a/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java +++ b/enrollment-server/src/main/java/com/wultra/app/enrollmentserver/impl/service/PushRegistrationService.java @@ -94,6 +94,9 @@ public Response registerDevice( private static MobilePlatform convert(final PushRegisterRequest.Platform source) { return switch (source) { + case APNS -> MobilePlatform.APNS; + case FCM -> MobilePlatform.FCM; + case HMS -> MobilePlatform.HMS; case IOS -> MobilePlatform.IOS; case ANDROID -> MobilePlatform.ANDROID; case HUAWEI -> MobilePlatform.HUAWEI; diff --git a/pom.xml b/pom.xml index 6cd91bd6..92a45f94 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.4 + 3.3.5