@commercetools/connect-payments-sdk 0.0.6 → 0.0.7

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.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 8110cc2: Enable AuthorityAuthorizationHook in Payment SDK
8
+
3
9
  ## 0.0.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JWTAuthenticationHook, Oauth2AuthenticationHook, RequestContextData, RequestContextProvider, SessionAuthenticationHook } from './api';
1
+ import { JWTAuthenticationHook, Oauth2AuthenticationHook, RequestContextData, RequestContextProvider, SessionAuthenticationHook, AuthorityAuthorizationHook } from './api';
2
2
  import { DefaultCommercetoolsAPI } from './commercetools/api/root-api';
3
3
  import { DefaultAuthorizationService } from './commercetools/services/ct-authorization.service';
4
4
  import { DefaultCartService } from './commercetools/services/ct-cart.service';
@@ -30,4 +30,5 @@ export declare const setupPaymentSDK: (opts: {
30
30
  sessionAuthHookFn: SessionAuthenticationHook;
31
31
  jwtAuthHookFn: JWTAuthenticationHook;
32
32
  oauth2AuthHookFn: Oauth2AuthenticationHook;
33
+ authorityAuthorizationHookFn: AuthorityAuthorizationHook;
33
34
  };
package/dist/index.js CHANGED
@@ -70,6 +70,7 @@ const setupPaymentSDK = (opts) => {
70
70
  clientSecret: opts.clientSecret,
71
71
  authUrl: opts.authUrl,
72
72
  });
73
+ const authorityAuthorizationManager = new security_1.AuthorityAuthorizationManager();
73
74
  const jwtAuthenticationManager = new security_1.JWTAuthenticationManager({
74
75
  jwtService,
75
76
  iss: opts.jwtIssuer,
@@ -87,6 +88,10 @@ const setupPaymentSDK = (opts) => {
87
88
  authenticationManager: oauth2AuthenticationManager,
88
89
  contextProvider,
89
90
  });
91
+ const authorityAuthorizationHookFn = new api_1.AuthorityAuthorizationHook({
92
+ authorizationManager: authorityAuthorizationManager,
93
+ contextProvider,
94
+ });
90
95
  return {
91
96
  ctAPI,
92
97
  ctCartService,
@@ -96,6 +101,7 @@ const setupPaymentSDK = (opts) => {
96
101
  sessionAuthHookFn,
97
102
  jwtAuthHookFn,
98
103
  oauth2AuthHookFn,
104
+ authorityAuthorizationHookFn,
99
105
  };
100
106
  };
101
107
  exports.setupPaymentSDK = setupPaymentSDK;
@@ -5,3 +5,4 @@ export * from './authn/session-authn-manager';
5
5
  export * from './authn/types/authn.type';
6
6
  export * from './services/jwt.service';
7
7
  export * from './services/oauth2.service';
8
+ export * from './authz/authorization-manager';
@@ -21,3 +21,4 @@ __exportStar(require("./authn/session-authn-manager"), exports);
21
21
  __exportStar(require("./authn/types/authn.type"), exports);
22
22
  __exportStar(require("./services/jwt.service"), exports);
23
23
  __exportStar(require("./services/oauth2.service"), exports);
24
+ __exportStar(require("./authz/authorization-manager"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools/connect-payments-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Payment SDK for commercetools payment connectors",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",