@commercetools/connect-payments-sdk 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @commercetools/connect-payments-sdk
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 766ffd4: Accept manage_project permission when checking the status of the commercetools permissions
8
+
3
9
  ## 0.9.1
4
10
 
5
11
  ### Patch Changes
@@ -70,7 +70,9 @@ exports.statusHandler = statusHandler;
70
70
  const healthCheckCommercetoolsPermissions = (opts) => async () => {
71
71
  try {
72
72
  const token = await opts.ctAuthorizationService.getAccessToken();
73
- const foundAll = opts.requiredPermissions.every((currentScope) => token.scope.split(' ').some((scopeInToken) => scopeInToken === `${currentScope}:${opts.projectKey}`));
73
+ const hasManageProjectPermission = token.scope.split(' ').includes(`manage_project:${opts.projectKey}`);
74
+ const foundAll = hasManageProjectPermission ||
75
+ opts.requiredPermissions.every((currentScope) => token.scope.split(' ').some((scopeInToken) => scopeInToken === `${currentScope}:${opts.projectKey}`));
74
76
  if (foundAll) {
75
77
  return {
76
78
  name: 'commercetools permissions',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools/connect-payments-sdk",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Payment SDK for commercetools payment connectors",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",