Skip to content

Commit

Permalink
PubNub SDK v5.2.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Sep 8, 2021
1 parent 0ee1a51 commit 6968c99
Show file tree
Hide file tree
Showing 105 changed files with 1,381 additions and 446 deletions.
9 changes: 7 additions & 2 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: java
version: 5.1.1
version: 5.2.0
schema: 1
scm: github.com/pubnub/java
files:
- build/libs/pubnub-gson-5.1.1-all.jar
- build/libs/pubnub-gson-5.2.0-all.jar
sdks:
-
type: library
Expand Down Expand Up @@ -234,6 +234,11 @@ sdks:
is-required: Required

changelog:
- version: v5.2.0
date: 2021-09-08
changes:
- type: feature
text: "Extend grantToken method to enable control of Objects API permission. Enhance granularity of permission control to enable permissions per UUID."
- version: v5.1.1
date: 2021-07-13
changes:
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## [v5.2.0](https://github.com/pubnub/java/releases/tag/v5.2.0)
September-08-2021

[Full Changelog](https://github.com/pubnub/java/compare/v5.1.1...v5.2.0)

- 🌟️ Extend grantToken method to enable control of Objects API permission. Enhance granularity of permission control to enable permissions per UUID.

## [v5.1.1](https://github.com/pubnub/java/releases/tag/v5.1.1)
July-13-2021

[Full Changelog](https://github.com/pubnub/java/compare/v5.1.0...v5.1.1)

- 🐛 Update Jackson libraries to avoid known vulnerabilities.

## [v5.1.0](https://github.com/pubnub/java/releases/tag/v5.1.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ You will need the publish and subscribe keys to authenticate your app. Get your
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-gson</artifactId>
<version>5.1.1</version>
<version>5.2.0</version>
</dependency>
```

* for Gradle, add the following dependency in your `gradle.build`:
```groovy
compile group: 'com.pubnub', name: 'pubnub-gson', version: '5.1.1'
compile group: 'com.pubnub', name: 'pubnub-gson', version: '5.2.0'
```

2. Configure your keys:
Expand Down
35 changes: 34 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'io.franzbecker.gradle-lombok' version '1.14'
id 'com.github.johnrengelman.shadow' version '4.0.2'
id 'com.bmuschko.nexus' version '2.3.1'
Expand All @@ -11,16 +12,43 @@ plugins {
}
group = 'com.pubnub'

version = '5.1.1'
version = '5.2.0'

description = """"""

sourceCompatibility = 1.8
targetCompatibility = 1.8


configurations.all {
}

configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}

task cucumber() {
dependsOn assemble, testClasses
group = "verification"
doLast {
javaexec {
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("test.properties")))

main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output

if (localProperties['cucumber.tags'] != null) {
args = ['--tags', localProperties['cucumber.tags'], '--plugin', 'pretty', '--glue', 'com.pubnub.contract', localProperties['features.dir']]
} else {
args = ['--plugin', 'pretty', '--glue', 'com.pubnub.contract', localProperties['features.dir']]
}
}
}
}

lombok {
version = "1.18.4"
}
Expand Down Expand Up @@ -70,6 +98,11 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.6.0'
integrationTestImplementation group: 'org.aeonbits.owner', name: 'owner', version: '1.0.8'
implementation group: 'org.json', name: 'json', version: '20190722'
testImplementation group: 'io.cucumber', name: 'cucumber-java', version: '6.10.4'
testImplementation group: 'io.cucumber', name: 'cucumber-junit', version: '6.10.4'
testImplementation group: 'io.cucumber', name: 'cucumber-picocontainer', version: '6.10.4'
testImplementation group: 'org.aeonbits.owner', name: 'owner', version: '1.0.8'
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}

task integrationTest(type: Test) {
Expand Down
6 changes: 0 additions & 6 deletions ittest.properties.example

This file was deleted.

8 changes: 4 additions & 4 deletions src/integrationTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Java SDK source contains source set with integration tests that can be run against real PubNub application.
In order to run integration tests make sure the dedicated App is created on [PubNub's Admin Portal](https://admin.pubnub.com/).
To launch integration tests use Gradle's `integrationTest` task.
Before doing this make sure correct Subscribe Key is configured in `ittest.properties` file in project's root directory.
See contents of `ittest.properties.example` for more details.
Before doing this make sure correct Subscribe Key is configured in `test.properties` file in project's root directory.
See contents of `test.properties.example` for more details.

Parameters from `ittest.properties` file can be overriden by setting corresponding environment variables. Example:
Parameters from `test.properties` file can be overriden by setting corresponding environment variables. Example:
```$bash
> export PUB_KEY=<SUBSCRIBE_KEY>
> export subKey=<SUBSCRIBE_KEY>
> ./gradlew build integrationTest
```
In current version those tests are not plugged into CI pipeline and they need to be launched on demand.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ private PubNub pubNub() {

@Before
public void assumeTestsAreConfiguredProperly() {
assumeThat("Subscription key must be set in ittest.properties", itTestConfig.subscribeKey(), not(isEmptyOrNullString()));
assumeThat("Subscription key must be set in test.properties", itTestConfig.subscribeKey(), not(isEmptyOrNullString()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.pubnub.api.PNConfiguration;
import com.pubnub.api.PubNub;
import com.pubnub.api.PubNubException;
import com.pubnub.api.enums.PNLogVerbosity;
import com.pubnub.api.integration.util.BaseIntegrationTest;
import com.pubnub.api.models.consumer.access_manager.v3.ChannelGrant;
import com.pubnub.api.models.consumer.access_manager.v3.ChannelGroupGrant;
Expand All @@ -20,6 +21,7 @@ public class GrantTokenIT extends BaseIntegrationTest {
@Test
public void happyPath() throws PubNubException {
//given
pubNubUnderTest.getConfiguration().setLogVerbosity(PNLogVerbosity.BODY);
final int expectedTTL = 1337;
final String expectedChannelResourceName = "channelResource";
final String expectedChannelPattern = "channel.*";
Expand All @@ -40,13 +42,13 @@ public void happyPath() throws PubNubException {

//then
assertEquals(expectedTTL, pnToken.getTtl());
assertEquals(new PNToken.PNResourcePermissions(false, false, false, false, true),
assertEquals(new PNToken.PNResourcePermissions(false, false, false, false, false, false, false),
pnToken.getResources().getChannels().get(expectedChannelResourceName));
assertEquals(new PNToken.PNResourcePermissions(false, true, false, false, false),
assertEquals(new PNToken.PNResourcePermissions(false, true, false, false, false, false, false),
pnToken.getResources().getChannelGroups().get(expectedChannelGroupResourceId));
assertEquals(new PNToken.PNResourcePermissions(false, false, true, false, false),
assertEquals(new PNToken.PNResourcePermissions(false, false, true, false, false, false, false),
pnToken.getPatterns().getChannels().get(expectedChannelPattern));
assertEquals(new PNToken.PNResourcePermissions(false, false, false, true, false),
assertEquals(new PNToken.PNResourcePermissions(false, false, false, true, false, false, false),
pnToken.getPatterns().getChannelGroups().get(expectedChannelGroupPattern));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

import org.aeonbits.owner.Config;

@Config.Sources({"file:ittest.properties"})
@Config.Sources({"file:test.properties"})
public interface ITTestConfig extends Config {

@Config.Key("SUB_KEY")
@Config.Key("subKey")
String subscribeKey();

@Config.Key("PUB_KEY")
@Config.Key("pubKey")
String publishKey();

@Config.Key("PAM_SUB_KEY")
@Config.Key("pamSubKey")
String pamSubKey();

@Config.Key("PAM_PUB_KEY")
@Config.Key("pamPubKey")
String pamPubKey();

@Config.Key("PAM_SEC_KEY")
@Config.Key("pamSecKey")
String pamSecKey();
}
Loading

0 comments on commit 6968c99

Please sign in to comment.