Skip to content

Commit

Permalink
cloudscape ccp in initApp fix and disabling request-storage-access (#887
Browse files Browse the repository at this point in the history
)

* Fixing initApp bug due to hasAnySearchParameter
* Disable RSA by default

Co-authored-by: Andy Wang <[email protected]>
  • Loading branch information
andywang219 and Andy Wang authored Jun 11, 2024
1 parent 8e20f4f commit 8cfe111
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-streams",
"version": "2.14.2",
"version": "2.14.3",
"description": "Amazon Connect Streams Library",
"engines": {
"node": ">=12.0.0"
Expand Down
2 changes: 1 addition & 1 deletion release/connect-streams-dr-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-dr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions release/connect-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
connect.core.initCCP(container, ccpParams);
};

hasAnySearchParameter = function (url) {
var hasAnySearchParameter = function (url) {
var regex = /[?&]?[^=?&]+=[^=?&]+/g;
return regex.test(url);
}
Expand Down Expand Up @@ -26896,7 +26896,7 @@ AWS.apiLoader.services['connect']['2017-02-15'] = require('../apis/connect-2017-

connect.core = {};
connect.core.initialized = false;
connect.version = "2.14.2";
connect.version = "2.14.3";
connect.outerContextStreamsVersion = null;
connect.DEFAULT_BATCH_SIZE = 500;

Expand Down Expand Up @@ -31174,7 +31174,7 @@ AWS.apiLoader.services['connect']['2017-02-15'] = require('../apis/connect-2017-
*/
const defaultStorageAccessParams = {
/* Config which controls the opt out/in - we expect customers to explicitely opt out. */
canRequest: true,
canRequest: false,
/* ["custom", "default"] - decides the rsa page view */
mode: 'default',
custom: {
Expand Down
2 changes: 1 addition & 1 deletion src/agent-app/agent-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
connect.core.initCCP(container, ccpParams);
};

hasAnySearchParameter = function (url) {
var hasAnySearchParameter = function (url) {
var regex = /[?&]?[^=?&]+=[^=?&]+/g;
return regex.test(url);
}
Expand Down
2 changes: 1 addition & 1 deletion src/request-storage-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
const defaultStorageAccessParams = {
/* Config which controls the opt out/in - we expect customers to explicitely opt out. */
canRequest: true,
canRequest: false,
/* ["custom", "default"] - decides the rsa page view */
mode: 'default',
custom: {
Expand Down
9 changes: 6 additions & 3 deletions test/unit/request-storage-access.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('Request Storage Access module', () => {

before(() => {
sandbox = sinon.createSandbox();
connect.storageAccess.optInForRequestAccess();
});

beforeEach(() => {
Expand Down Expand Up @@ -54,9 +53,9 @@ describe('Request Storage Access module', () => {
assert.throws(() => connect.storageAccess.init(ccpUrl), connect.ValueError, 'container must be provided');
});

it('Should return canRequest true with no additional settings from customers and they will be opted in by default', () => {
it('Should return canRequest false with no additional settings from customers and they will be opted out by default', () => {
connect.storageAccess.init(ccpUrl, container);
expect(connect.storageAccess.canRequest()).to.be.true;
expect(connect.storageAccess.canRequest()).to.be.false;
});

it('Should return canRequest false with explicit customer opt out', () => {
Expand Down Expand Up @@ -178,6 +177,10 @@ describe('Request Storage Access module', () => {
describe('Request method', () => {
let onGrantSpy;

before(() => {
connect.storageAccess.optInForRequestAccess();
});

beforeEach(() => {
onGrantSpy = sandbox.spy();
createCcpIframeStub();
Expand Down

0 comments on commit 8cfe111

Please sign in to comment.