Skip to content

Commit

Permalink
PubNub SDK v3.3.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Oct 11, 2021
1 parent 16794d3 commit 58917bf
Show file tree
Hide file tree
Showing 50 changed files with 5,238 additions and 152 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/run_acceptance_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

name: run_acceptance_tests

on: [push]

jobs:
build:
name: Perform Acceptance BDD tests
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Checkout mock-server action
uses: actions/checkout@v2
with:
repository: pubnub/client-engineering-deployment-tools
ref: github-actions
token: ${{ secrets.GH_TOKEN }}
path: client-engineering-deployment-tools
- name: Run mock server action
uses: ./client-engineering-deployment-tools/actions/mock-server
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup environment
run: |
sudo apt-get install -y ninja-build libboost-all-dev libssl-dev
sudo gem install cucumber
- name: Git clone cucumber-cpp
run: |
git clone https://github.com/cucumber/cucumber-cpp.git
- name: Cache cucumber-cpp
id: cache-cucumber-cpp
uses: actions/cache@v2
with:
path: |
cucumber-cpp
key: ${{ runner.os }}-cucumber-cpp-${{ hashFiles('cucumber-cpp/**') }}
restore-keys: |
${{ runner.os }}-cucumber-cpp
- name: Configure cucumber-cpp
if: steps.cache-cucumber-cpp.outputs.cache-hit != 'true'
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug
working-directory: ./cucumber-cpp

- name: Build cucumber-cpp
if: steps.cache-cucumber-cpp.outputs.cache-hit != 'true'
run: |
cmake --build build --config Debug
working-directory: ./cucumber-cpp

- name: Build acceptance tests
run: |
cd cpp
make -f posix_openssl.mk openssl/pubnub_sync
cd ..
g++ -std=c++11 -g -o BoostSteps.o -c features/step_definitions/BoostSteps.cpp -Icucumber-cpp/include -Icucumber-cpp/build/src/ -Iposix -Icore -I. -Icpp -D PUBNUB_CRYPTO_API=1 -D PUBNUB_USE_SSL=0
g++ -o steps BoostSteps.o cpp/pubnub_sync.a cucumber-cpp/build/src/libcucumber-cpp.a -Lboost -lboost_unit_test_framework -lpthread -lboost_regex -lboost_thread -lboost_program_options -lboost_filesystem -lssl -lcrypto -D PUBNUB_USE_SSL=0
- name: Run acceptance tests
env:
PAM_PUB_KEY: "pub_key"
PAM_SUB_KEY: "sub_key"
PAM_SEC_KEY: "sec_key"
run: |
mv sdk-specifications/features/access features
sudo python3 run_contract_tests.py features/access/grant-token.feature
ls -la results
- name: Upload acceptance tests reports
if: always()
uses: actions/upload-artifact@v2
with:
name: acceptance-test-reports
path: ./results/**
14 changes: 13 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: c-core
schema: 1
version: "3.2.0"
version: "3.3.0"
scm: github.com/pubnub/c-core
changelog:
- version: v3.3.0
date: 2021-10-11
changes:
- type: feature
text: "Implemented PAMv3 support."
- type: bug
text: "Handle subscribe error for empty channel-group."
- version: v3.2.0
date: 2021-09-15
changes:
Expand Down Expand Up @@ -438,6 +445,11 @@ changelog:
- type: feature
text: First "core feature complete" release
features:
access:
- ACCESS-OBJECTS-V2-MANAGEMENT
- ACCESS-GRANT-TOKEN
- ACCESS-PARSE-TOKEN
- ACCESS-SET-TOKEN
channel-groups:
- CHANNEL-GROUPS-ADD-CHANNELS
- CHANNEL-GROUPS-REMOVE-CHANNELS
Expand Down
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## [v3.2.0](https://github.com/pubnub/c-core/releases/tag/v3.2.0)
September 15 2021
## [v3.3.0](https://github.com/pubnub/c-core/releases/tag/v3.3.0)
October 11 2021

[Full Changelog](https://github.com/pubnub/c-core/compare/v3.1.0...v3.2.0)
[Full Changelog](https://github.com/pubnub/c-core/compare/v3.2.0...v3.3.0)

- Error codes for missing subscribe timetoken.
- Implemented PAMv3 support.
- Handle subscribe error for empty channel-group.


29 changes: 18 additions & 11 deletions core/pbcc_actions_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ enum pubnub_res pbcc_add_action_prep(struct pbcc_context* pb,
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (pb->secret_key == NULL && pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
if (pb->secret_key == NULL) { ADD_URL_AUTH_PARAM(pb, qparam, auth); }
ADD_TS_TO_URL_PARAM();
#else
if (pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
ADD_URL_AUTH_PARAM(pb, qparam, auth);
#endif

#if PUBNUB_CRYPTO_API
Expand All @@ -129,6 +129,7 @@ enum pubnub_res pbcc_add_action_prep(struct pbcc_context* pb,

APPEND_MESSAGE_BODY_M(PNR_OK, pb, value);

PUBNUB_LOG_DEBUG("pbcc_add_action_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down Expand Up @@ -267,10 +268,12 @@ enum pubnub_res pbcc_remove_action_prep(struct pbcc_context* pb,
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (pb->secret_key == NULL && pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
if (pb->secret_key == NULL){
ADD_URL_AUTH_PARAM(pb, qparam, auth);
}
ADD_TS_TO_URL_PARAM();
#else
if (pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
ADD_URL_AUTH_PARAM(pb, qparam, auth);
#endif

#if PUBNUB_CRYPTO_API
Expand All @@ -285,7 +288,8 @@ enum pubnub_res pbcc_remove_action_prep(struct pbcc_context* pb,
}
}
#endif


PUBNUB_LOG_DEBUG("pbcc_remove_action_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down Expand Up @@ -315,10 +319,10 @@ enum pubnub_res pbcc_get_actions_prep(struct pbcc_context* pb,
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (pb->secret_key == NULL && pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
if (pb->secret_key == NULL) { ADD_URL_AUTH_PARAM(pb, qparam, auth); }
ADD_TS_TO_URL_PARAM();
#else
if (pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
ADD_URL_AUTH_PARAM(pb, qparam, auth);
#endif
if (start) { ADD_URL_PARAM(qparam, start, start); }
if (end) { ADD_URL_PARAM(qparam, end, end); }
Expand All @@ -337,6 +341,7 @@ enum pubnub_res pbcc_get_actions_prep(struct pbcc_context* pb,
}
#endif

PUBNUB_LOG_DEBUG("pbcc_get_actions_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down Expand Up @@ -396,10 +401,10 @@ enum pubnub_res pbcc_get_actions_more_prep(struct pbcc_context* pb)
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (pb->secret_key == NULL && pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
if (pb->secret_key == NULL) { ADD_URL_AUTH_PARAM(pb, qparam, auth); }
ADD_TS_TO_URL_PARAM();
#else
if (pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
ADD_URL_AUTH_PARAM(pb, qparam, auth);
#endif

#if PUBNUB_CRYPTO_API
Expand All @@ -415,6 +420,7 @@ enum pubnub_res pbcc_get_actions_more_prep(struct pbcc_context* pb)
}
#endif

PUBNUB_LOG_DEBUG("pbcc_get_actions_more_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down Expand Up @@ -444,10 +450,10 @@ enum pubnub_res pbcc_history_with_actions_prep(struct pbcc_context* pb,
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (pb->secret_key == NULL && pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
if (pb->secret_key == NULL) { ADD_URL_AUTH_PARAM(pb, qparam, auth); }
ADD_TS_TO_URL_PARAM();
#else
if (pb->auth != NULL) { ADD_URL_PARAM(qparam, auth, pb->auth); }
ADD_URL_AUTH_PARAM(pb, qparam, auth);
#endif
if (start) { ADD_URL_PARAM(qparam, start, start); }
if (end) { ADD_URL_PARAM(qparam, end, end); }
Expand All @@ -466,6 +472,7 @@ enum pubnub_res pbcc_history_with_actions_prep(struct pbcc_context* pb,
}
#endif

PUBNUB_LOG_DEBUG("pbcc_history_with_actions_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down
5 changes: 3 additions & 2 deletions core/pbcc_advanced_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ enum pubnub_res pbcc_message_counts_prep(
if (uname) { ADD_URL_PARAM(qparam, pnsdk, uname); }
if (uuid) { ADD_URL_PARAM(qparam, uuid, uuid); }
#if PUBNUB_CRYPTO_API
if (p->secret_key == NULL && p->auth != NULL) { ADD_URL_PARAM(qparam, auth, p->auth); }
if (p->secret_key == NULL) { ADD_URL_AUTH_PARAM(p, qparam, auth); }
ADD_TS_TO_URL_PARAM();
#else
if (p->auth != NULL) { ADD_URL_PARAM(qparam, auth, p->auth); }
ADD_URL_AUTH_PARAM(p, qparam, auth);
#endif
if (timetoken) { ADD_URL_PARAM(qparam, timetoken, timetoken); }
if (channel_timetokens) { ADD_URL_PARAM(qparam, channelsTimetoken, channel_timetokens); }
Expand All @@ -536,5 +536,6 @@ enum pubnub_res pbcc_message_counts_prep(
}
#endif

PUBNUB_LOG_DEBUG("pbcc_message_counts_prep. REQUEST =%s\n", p->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}
1 change: 1 addition & 0 deletions core/pbcc_grant_token_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ enum pubnub_res pbcc_grant_token_prep(

APPEND_MESSAGE_BODY_M(rslt, pb, perm_obj);

PUBNUB_LOG_DEBUG("pbcc_grant_token_prep. REQUEST =%s\n", pb->http_buf);
return (rslt != PNR_OK) ? rslt : PNR_STARTED;
}

Expand Down
Loading

0 comments on commit 58917bf

Please sign in to comment.