Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into merge-upstream-p…
Browse files Browse the repository at this point in the history
…ush-platforms
  • Loading branch information
romanstrobl committed Nov 8, 2024
2 parents 216fa60 + 4cf2f37 commit b9238df
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/Migration-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 8 additions & 6 deletions docs/Mobile-Token-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions docs/PowerAuth-Enrollment-Server-1.10.0.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion docs/PowerAuth-Enrollment-Server-1.7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.4</version>
<version>3.3.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down

0 comments on commit b9238df

Please sign in to comment.