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

Develop #24

Merged
merged 11 commits into from
Aug 22, 2024
Merged
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## [0.0.1](https://github.com/PAYONE-GmbH/PCP-ServerSDK-java/compare/v0.0.2...v0.0.1) (2024-08-21)
# [1.0.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-java/compare/v0.0.3...v1.0.0) (2024-08-22)

### Documentation

* docs: add contributing guidelines and update readme ([c9c7210c6b7655761851ff5564c09ad10c6a0b4a](https://github.com/PAYONE-GmbH/PCP-ServerSDK-java/commit/c9c7210c6b7655761851ff5564c09ad10c6a0b4a))

## [0.0.3](https://github.com/PAYONE-GmbH/PCP-ServerSDK-java/compare/v0.0.2...v0.0.3) (2024-08-21)

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Welcome to the Java SDK for the PAYONE Commerce Platform! This repository contai

```groovy
dependencies {
implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '0.0.3'
implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '1.0.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (JavaVersion.current().majorVersion != '8') {
apply plugin: 'org.sonarqube'
}

version = '0.0.3'
version = '1.0.0'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class RequestHeaderGenerator {

public static final String SERVER_META_INFO_HEADER_NAME = "X-GCS-ServerMetaInfo";
public static final String CLIENT_META_INFO_HEADER_NAME = "X-GCS-ClientMetaInfo";
private static final String DATE_HEADER_NAME = "Date";
private static final String AUTHORIZATION_HEADER_NAME = "Authorization";
private static final String CONTENT_TYPE_HEADER_NAME = "Content-Type";
public static final String DATE_HEADER_NAME = "Date";
public static final String AUTHORIZATION_HEADER_NAME = "Authorization";
public static final String CONTENT_TYPE_HEADER_NAME = "Content-Type";

private static final String ALGORITHM = "HmacSHA256";
private static final String WHITESPACE_REGEX = "\\r?\\n[\\h]*";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static ServerMetaInfo withDefaults(String integrator) {
return new ServerMetaInfo()
.platformIdentifier(String.format("%s, java version is: %s", System.getProperty("os.name"),
System.getProperty("java.version")))
.sdkIdentifier("JavaServerSDK/v0.0.3")
.sdkIdentifier("JavaServerSDK/v1.0.0")
.sdkCreator("PAYONE GmbH")
.integrator(integrator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RequestHeaderGeneratorTest {
@Test
void testSignatureGenerationForGet() {
Date date = new Date(1720520499000l);
Headers headers = new Headers.Builder().add("Date", date)
Headers headers = new Headers.Builder().add(RequestHeaderGenerator.DATE_HEADER_NAME, date)
// the meta info is normally generated internally, but fields and output may
// change overtime, so we pin it for the test
.add(RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME, "server fixed")
Expand All @@ -63,7 +63,7 @@ void testSignatureGenerationWithContentType() {
Date date = new Date(1720520499000l);
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
Headers headers = new Headers.Builder()
.add("Content-Type", mediaType.toString())
.add(RequestHeaderGenerator.CONTENT_TYPE_HEADER_NAME, mediaType.toString())
.add("Date", date)
// the meta info is normally generated internally, but fields and output may
// change overtime, so we pin it for the test
Expand Down Expand Up @@ -96,8 +96,8 @@ void addADateHeaderIfMissingTest() {
try {
Request updatedRequest = HEADER_GENERATOR.generateAdditionalRequestHeaders(request);

assertNotNull(updatedRequest.headers().get("Date"));
assertNotEquals("", updatedRequest.headers().get("Date"));
assertNotNull(updatedRequest.headers().get(RequestHeaderGenerator.DATE_HEADER_NAME));
assertNotEquals("", updatedRequest.headers().get(RequestHeaderGenerator.DATE_HEADER_NAME));
} catch (Exception e) {
fail(e);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "pcp-serversdk-java",
"version": "0.0.3",
"version": "1.0.0",
"type": "commonjs",
"scripts": {
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 --config ./changelog.config.js"
"changelog": "conventional-changelog -i CHANGELOG.md -s --config ./changelog.config.js"
},
"repository": {
"type": "git",
Expand Down
9 changes: 7 additions & 2 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,19 @@ jq --arg version "$VERSION" '
.version = $version |
.packages[""].version = $version
' package-lock.json >tmp.json && mv tmp.json package-lock.json
rm -f tmp.json

git add $BUILD_GRADLE_PATH
git add $SERVER_META_INFO_PATH
git add $README_PATH
git add $PACKAGE_JSON_PATH
git add $PACKAGE_LOCK_JSON_PATH
npm install
npm run changelog
git add CHANGELOG.md
git tag -a v$NEW_VERSION -m "Version $NEW_VERSION"
git commit -m "Update version to $VERSION"
git tag -a $TAG -m "Release version $VERSION"
git push origin $TAG
git push origin tag v$NEW_VERSION
git push origin HEAD

echo "Version updated to $VERSION and tagged in Git."