-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from wultra/develop
Prepare release 0.24.0
- Loading branch information
Showing
86 changed files
with
25,152 additions
and
12,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Migration from 0.23.0 to 0.24.0 | ||
|
||
## Unirest Initialization | ||
|
||
In previous versions, we included configuration of [Unirest](https://kong.github.io/unirest-java/) client right in the Push Server client code. This was incorrect, since Unirest initializes in a static manner. Our configuration could be clashing with other components using Unirest. As a result, you need to add Unirest configuration yourself soon after the application launch in case you would like to use our client library. In the case you call our API's yourself, no changes are needed. | ||
|
||
Below is a minimal Unirest configuration plugged into the Spring framework in a way to reuse `ObjectMapper` configuration. Of course, you can use any other [Unirest configuration parameters](https://kong.github.io/unirest-java/#configuration). | ||
|
||
```java | ||
@Configuration | ||
public class UnirestConfiguration { | ||
|
||
@Autowired | ||
private com.fasterxml.jackson.databind.ObjectMapper mapper; | ||
|
||
@PostConstruct | ||
public void postConstruct() { | ||
Unirest.config().setObjectMapper(new ObjectMapper() { | ||
|
||
public String writeValue(Object value) { | ||
try { | ||
return mapper.writeValueAsString(value); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public <T> T readValue(String value, Class<T> valueType) { | ||
try { | ||
return mapper.readValue(value, valueType); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
``` | ||
|
||
## Push Server Administration | ||
|
||
In the latest version of Push Server, we decided to remove the web administration console, due to its simplicity. You can configure apps either via database by inserting values to the `push_app_credentials` table, or by calling [Administration API](./Push-Server-API.md#administration). A new section regarding Push Server administration is [available in the documentation](./Push-Server-Administration.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# Push Server Administration | ||
|
||
PowerAuth Push Server can be administered using a RESTful API. | ||
|
||
The RESTful API is documented in [a dedicated chapter](./Push-Server-API.md). | ||
|
||
## Administration using Insomnia | ||
|
||
Insomnia is an easy to use RESTful API client. You can get Insomnia from [https://insomnia.rest](https://insomnia.rest) | ||
|
||
To import the Push Server workspace into Insomnia, create a workspace using menu in the top left corner. Use the `Create Workspace` option and | ||
then click `Import/Export`. You can import the workspace with all requests from [provided workspace export file](./data/Push_Server_Insomnia.zip). | ||
|
||
All requests which are described below are already prepared in the provided Insomnia worskpace, so you can easily | ||
update the JSON requests and execute them. | ||
|
||
## Administration using cURL | ||
|
||
Curl is a command line HTTP client. You can get cURL from [https://curl.haxx.se](https://curl.haxx.se) | ||
|
||
### Retrieve Application List: | ||
``` | ||
curl --request GET \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/list | ||
``` | ||
|
||
### Retrieve Unconfigured Application List: | ||
``` | ||
curl --request GET \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/unconfigured/list | ||
``` | ||
|
||
### Create an Application: | ||
``` | ||
curl --request POST \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/create \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"requestObject": { | ||
"appId": 1 | ||
} | ||
}' | ||
``` | ||
|
||
Update the `appId` value with requested PowerAuth application ID. | ||
The value `id` from response object will be used for identification of the Push Server application. | ||
|
||
### Get Application Detail: | ||
``` | ||
curl --request POST \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/detail \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"requestObject": { | ||
"id": 1, | ||
"includeIos": true, | ||
"includeAndroid": true | ||
} | ||
}' | ||
``` | ||
|
||
Update the `id` value with requested Push Server application ID. | ||
|
||
### Update APNs Configuration | ||
``` | ||
curl --request POST \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/ios/update \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"requestObject": { | ||
"id": 1, | ||
"bundle": "com.wultra.myApp", | ||
"keyId": "keyId", | ||
"teamId": "teamId", | ||
"privateKeyBase64": "a2V5" | ||
} | ||
}' | ||
``` | ||
|
||
Set the `id` value for Push Server application ID to want to update. | ||
|
||
Enter the base64-encoded value of APNs private key into `privateKeyBase64`. | ||
|
||
You can encode the file using `base64` command on Mac. You can also use `Certutil.exe` on Windows or OpenSSL on all platforms. | ||
``` | ||
base64 -i <in-file> -o <outfile> | ||
``` | ||
|
||
### Remove APNs Configuration | ||
``` | ||
curl --request DELETE \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/ios/remove \ | ||
--cookie JSESSIONID=76D3CE8C7F92E1FC090A79886E43B235 \ | ||
--data '{ | ||
"requestObject": { | ||
"id": 1 | ||
} | ||
}' | ||
``` | ||
|
||
Set the `id` value for the Push Server application ID you want to update. | ||
|
||
### Update FCM Configuration | ||
``` | ||
curl --request POST \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/android/update \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"requestObject": { | ||
"id": 1, | ||
"projectId": "projectId", | ||
"privateKeyBase64": "a2V5" | ||
} | ||
}' | ||
``` | ||
|
||
Set the `id` value for Push Server application ID to want to update. | ||
|
||
Enter the base64-encoded value of APNs private key into `privateKeyBase64`. | ||
|
||
You can encode the file using `base64` command on Mac. You can also use `Certutil.exe` on Windows or OpenSSL on all platforms. | ||
``` | ||
base64 -i <in-file> -o <outfile> | ||
``` | ||
|
||
### Remove FCM Configuration | ||
``` | ||
curl --request DELETE \ | ||
--url http://localhost:8080/powerauth-push-server/admin/app/android/remove \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"requestObject": { | ||
"id": 1 | ||
} | ||
}' | ||
``` | ||
|
||
Set the `id` value for the Push Server application ID you want to update. | ||
|
||
## Administration using SQL Database | ||
|
||
Push server can be also administered by updating the `push_app_credentials` table. | ||
|
||
See the [PowerAuth Push Server Database Structure](./Push-Server-Database.md) for more details. |
Oops, something went wrong.