Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to master #720

Merged
merged 46 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4ca06ee
Bump org.springframework.boot:spring-boot-starter-parent
dependabot[bot] Sep 25, 2023
60bd392
Fix #676: Set develop version to 1.6.0-SNAPSHOT
banterCZ Sep 26, 2023
305a069
Merge pull request #677 from wultra/issues/676-version-1.6.0-SNAPSHOT
banterCZ Sep 26, 2023
67a78cf
Merge pull request #674 from wultra/dependabot/maven/org.springframew…
dependabot[bot] Sep 26, 2023
80b75c3
Add GitHub action for SCP deploy
banterCZ Oct 17, 2023
d5028d8
Bump org.springframework.boot:spring-boot-starter-parent
dependabot[bot] Oct 23, 2023
3ca40f6
Merge pull request #682 from wultra/dependabot/maven/org.springframew…
dependabot[bot] Oct 23, 2023
442e725
Fix #679: Executable war (#680)
jandusil Oct 24, 2023
db26106
Fix #683: Update Wultra dependencies to SNAPSHOT version
banterCZ Oct 31, 2023
5db83b4
Merge pull request #684 from wultra/issues/683-wultra-dependencies-sn…
banterCZ Oct 31, 2023
c77006d
Fix #685: HHH90000025: PostgreSQLDialect does not need to be specifie…
jnpsk Nov 7, 2023
0317eb6
Merge pull request #678 from wultra/issues/scp-deploy
banterCZ Nov 8, 2023
a443895
Bump org.bouncycastle:bcprov-jdk18on from 1.76 to 1.77
dependabot[bot] Nov 20, 2023
8a00744
Merge pull request #687 from wultra/dependabot/maven/org.bouncycastle…
dependabot[bot] Nov 20, 2023
492e9e2
Fix #675: Null values in extras cause a problem to APNS
banterCZ Nov 23, 2023
ed53c6d
Merge pull request #688 from wultra/issues/675-APNS-null
banterCZ Nov 24, 2023
2af6e86
Bump org.springframework.boot:spring-boot-starter-parent
dependabot[bot] Nov 27, 2023
c89234e
Merge pull request #691 from wultra/dependabot/maven/org.springframew…
dependabot[bot] Nov 27, 2023
869e74c
Bump org.springdoc:springdoc-openapi-starter-webmvc-ui
dependabot[bot] Dec 4, 2023
6be13e6
Fix #703: Swagger UI does not follow HTTPS redirect
banterCZ Dec 4, 2023
af48227
Merge pull request #702 from wultra/dependabot/maven/org.springdoc-sp…
dependabot[bot] Dec 4, 2023
836d857
Merge pull request #704 from wultra/issues/703-swagger-https
banterCZ Dec 4, 2023
03d652a
Fix #705: Coverity: Eq: Problems with implementation of equals()
banterCZ Dec 7, 2023
297be5f
Merge pull request #706 from wultra/issues/705-PagedResponse-equals
banterCZ Dec 8, 2023
14e003b
Fix #709: Update logback
banterCZ Dec 8, 2023
b235330
Fix #711: Custom Spring Boot Banner
banterCZ Dec 8, 2023
d1b5130
Bump io.swagger.core.v3:swagger-annotations-jakarta
dependabot[bot] Dec 11, 2023
a05d151
Merge pull request #714 from wultra/dependabot/maven/io.swagger.core.…
dependabot[bot] Dec 11, 2023
4ccf2d8
Fix #715: Replace gitter by discord
banterCZ Dec 11, 2023
c3c171a
Merge pull request #710 from wultra/issues/709-update-logback
banterCZ Dec 12, 2023
f6451b1
Merge pull request #712 from wultra/issues/711-custom-banner
banterCZ Dec 12, 2023
02b07dc
Fix #718: Update Wultra dependencies
banterCZ Dec 13, 2023
2684b07
Merge pull request #716 from wultra/issues/715-discord
banterCZ Dec 13, 2023
2e834f4
Remove path from h2 mem test configuration
banterCZ Dec 15, 2023
6920ade
Fix #722: Set release version to 1.6.0
banterCZ Dec 15, 2023
448768e
Fix #727: Add Migration Guide for 1.6.0
banterCZ Dec 18, 2023
2d9f36a
Merge pull request #721 from wultra/issues/675-h2-test-configuration
banterCZ Dec 18, 2023
6b9ddff
Merge pull request #728 from wultra/issues/727-migration-guide
banterCZ Dec 18, 2023
e2ded7f
Fix #729: Add micrometer-registry-prometheus
banterCZ Dec 21, 2023
4a33c5a
Merge pull request #730 from wultra/issues/729-prometheus
banterCZ Dec 21, 2023
135b890
Bump io.swagger.core.v3:swagger-annotations-jakarta
dependabot[bot] Dec 25, 2023
03c9049
Bump com.eatthepath:pushy from 0.15.2 to 0.15.3
dependabot[bot] Jan 1, 2024
a0a1819
Merge pull request #733 from wultra/dependabot/maven/com.eatthepath-p…
dependabot[bot] Jan 2, 2024
77e1aa7
Merge pull request #731 from wultra/dependabot/maven/io.swagger.core.…
dependabot[bot] Jan 2, 2024
08580af
Merge pull request #719 from wultra/issues/718-wultra-dependencies
banterCZ Jan 5, 2024
c8ecf6d
Merge pull request #724 from wultra/issues/722-version-1.6.0
banterCZ Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/scp-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run SCP deploy

on:
workflow_dispatch:

jobs:
scp-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
server-id: jfrog-central
server-username: INTERNAL_USERNAME
server-password: INTERNAL_PASSWORD
cache: maven
- name: Run Maven Package Step
run: |
mvn -B -U package -Dmaven.test.skip=true
env:
INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }}
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SCP_CERTIFICATE }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa ${{ secrets.SCP_HOST }} >> ~/.ssh/known_hosts
- name: Deploy powerauth-push-server.war
shell: bash
run: |
scp -i ~/.ssh/id_rsa **/target/powerauth-push-server-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/powerauth-push-server.war
1 change: 0 additions & 1 deletion docs-private/Developer-How-To-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

### Standalone Run

- Enable maven profile `standalone`
- Use IntelliJ Idea run configuration at `../.run/PowerAuthPushServerJavaApplication.run.xml`
- Open [http://localhost:8089/powerauth-push-server/actuator/health](http://localhost:8089/powerauth-push-server/actuator/health) and you should get `{"status":"UP"}`

Expand Down
8 changes: 7 additions & 1 deletion docs/Configuration-Properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,10 @@ The Push Server uses the following public configuration properties:
| `powerauth.service.correlation-header.enabled` | `false` | Whether correlation header is enabled |
| `powerauth.service.correlation-header.name` | `X-Correlation-ID` | Correlation header name |
| `powerauth.service.correlation-header.value.validation-regexp` | `[a-zA-Z0-9\\-]{8,1024}` | Regular expression for correlation header value validation |
| `logging.pattern.console` | [See application.properties](https://github.com/wultra/powerauth-push-server/blob/develop/powerauth-push-server/src/main/resources/application.properties#docucheck-keep-link) | Logging pattern for console which includes the correlation header value |
| `logging.pattern.console` | [See application.properties](https://github.com/wultra/powerauth-push-server/blob/develop/powerauth-push-server/src/main/resources/application.properties#docucheck-keep-link) | Logging pattern for console which includes the correlation header value |


## Monitoring and Observability

The WAR file includes the `micrometer-registry-prometheus` dependency.
Discuss its configuration with the [Spring Boot documentation](https://docs.spring.io/spring-boot/docs/3.1.x/reference/html/actuator.html#actuator.metrics).
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 Push Server migration instructions.

- [PowerAuth Push Server 1.6.0](./PowerAuth-Push-Server-1.6.0.md)
- [PowerAuth Push Server 1.5.0](./PowerAuth-Push-Server-1.5.0.md)
- [PowerAuth Push Server 1.4.0](./PowerAuth-Push-Server-1.4.0.md)
- [PowerAuth Push Server 1.3.0](./PowerAuth-Push-Server-1.3.0.md)
Expand Down
5 changes: 5 additions & 0 deletions docs/PowerAuth-Push-Server-1.6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Migration from 1.5.x to 1.6.x

This guide contains instructions for migration from PowerAuth Push Server version `1.5.x` to version `1.6.x`.

No migration steps nor database changes are required.
22 changes: 12 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

<groupId>io.getlime.security</groupId>
<artifactId>powerauth-push-server-parent</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
<packaging>pom</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.3</version>
<version>3.1.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -69,21 +69,23 @@

<properties>
<!-- Wultra Dependencies -->
<wultra-core.version>1.7.0</wultra-core.version>
<powerauth.version>1.5.0</powerauth.version>
<powerauth-crypto.version>1.5.1</powerauth-crypto.version>
<powerauth-restful-integration.version>1.5.0</powerauth-restful-integration.version>
<wultra-core.version>1.8.0</wultra-core.version>
<powerauth.version>1.6.0</powerauth.version>
<powerauth-crypto.version>1.6.0</powerauth-crypto.version>
<powerauth-restful-integration.version>1.6.0</powerauth-restful-integration.version>

<!-- Library Versions -->
<pushy.version>0.15.2</pushy.version>
<pushy.version>0.15.3</pushy.version>
<google-api-client.version>1.35.2</google-api-client.version>
<firebase-admin.version>9.2.0</firebase-admin.version>
<bc.version>1.76</bc.version>
<bc.version>1.77</bc.version>
<logstash.version>7.4</logstash.version>
<!-- TODO (racansky, 2023-12-08) temporarily override the version 1.4.11 from spring boot version because of CVE -->
<logback.version>1.4.14</logback.version>

<!-- Documentation Dependencies -->
<springdoc-openapi-starter-webmvc-ui.version>2.2.0</springdoc-openapi-starter-webmvc-ui.version>
<swagger-annotations-jakarta.version>2.2.15</swagger-annotations-jakarta.version>
<springdoc-openapi-starter-webmvc-ui.version>2.3.0</springdoc-openapi-starter-webmvc-ui.version>
<swagger-annotations-jakarta.version>2.2.20</swagger-annotations-jakarta.version>

<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion powerauth-push-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<artifactId>powerauth-push-server-parent</artifactId>
<groupId>io.getlime.security</groupId>
<version>1.5.0</version>
<version>1.6.0</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion powerauth-push-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<artifactId>powerauth-push-server-parent</artifactId>
<groupId>io.getlime.security</groupId>
<version>1.5.0</version>
<version>1.6.0</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.getlime.push.model.base;

import io.getlime.core.rest.model.base.response.ObjectResponse;
import lombok.EqualsAndHashCode;

/**
* Generic response class for paged results
Expand All @@ -25,6 +26,7 @@
*
* @param <T> Type of the paged records.
*/
@EqualsAndHashCode(callSuper = true)
public class PagedResponse<T> extends ObjectResponse<T> {

private int page;
Expand Down
52 changes: 22 additions & 30 deletions powerauth-push-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,24 @@
<parent>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-push-server-parent</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
</parent>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- Spring Dependencies -->
Expand All @@ -30,12 +45,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -48,12 +57,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -115,6 +118,12 @@
<artifactId>postgresql</artifactId>
</dependency>

<!-- Monitoring -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<!-- Logging -->
<dependency>
<groupId>net.logstash.logback</groupId>
Expand Down Expand Up @@ -175,11 +184,6 @@
<version>${bc.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>test</scope>
</dependency>

<!-- Documentation -->
<dependency>
Expand Down Expand Up @@ -241,18 +245,6 @@
</plugins>
</build>
</profile>

<profile>
<id>standalone</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>liquibase</id>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
import io.swagger.v3.oas.annotations.info.Contact;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.info.License;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import jakarta.servlet.ServletContext;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
* Swagger configuration class for api documentation
*
Expand Down Expand Up @@ -63,4 +68,13 @@ public GroupedOpenApi pushApiGroup() {
.build();
}

@Bean
public OpenAPI openAPI(final ServletContext servletContext) {
final Server server = new Server()
.url(servletContext.getContextPath())
.description("Default Server URL");
return new OpenAPI()
.servers(List.of(server));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class PushCampaignEntity implements Serializable {
/**
* Message.
*/
@Column(name = "message", nullable = false, updatable = false)
@Column(name = "message", nullable = false, updatable = false, length = 4000)
private String message;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 2023 Wultra s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.getlime.push.service;

import com.eatthepath.pushy.apns.util.ApnsPayloadBuilder;
import com.eatthepath.pushy.apns.util.SimpleApnsPayloadBuilder;
import io.getlime.push.model.entity.PushMessageBody;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
* Convert {@link PushMessageBody} to platform dependant payload.
*
* @author Lubos Racansky, [email protected]
*/
@Slf4j
final class PayloadBuilder {

private PayloadBuilder() {
throw new IllegalStateException("Should not be instantiated.");
}

/**
* Method to build APNs message payload.
*
* @param push Push message object with APNs data.
* @param isSilent Indicates if the message is silent or not.
* @return String with APNs JSON payload.
*/
static String buildApnsPayload(final PushMessageBody push, final boolean isSilent) {
final ApnsPayloadBuilder payloadBuilder = new SimpleApnsPayloadBuilder();
if (!isSilent) { // include alert, body, sound and category only in case push message is not silent.
payloadBuilder
.setAlertTitle(push.getTitle())
.setLocalizedAlertTitle(push.getTitleLocKey(), push.getTitleLocArgs())
.setAlertBody(push.getBody())
.setLocalizedAlertMessage(push.getBodyLocKey(), push.getBodyLocArgs())
.setSound(push.getSound())
.setCategoryName(push.getCategory());
}

payloadBuilder
.setBadgeNumber(push.getBadge())
.setContentAvailable(isSilent)
.setThreadId(push.getCollapseKey());

final Map<String, Object> extras = push.getExtras();
if (extras != null) {
for (Map.Entry<String, Object> entry : extras.entrySet()) {
if (entry.getValue() != null) {
payloadBuilder.addCustomProperty(entry.getKey(), entry.getValue());
} else {
// Workaround for a known Apple issue, the JSON is valid but APNS would not send the push message.
logger.debug("Skipping extras key: {} because of null value.", entry.getKey());
}
}
}

return payloadBuilder.build();
}
}
Loading
Loading