@dvelop-sdk/identityprovider 3.0.2 → 4.0.1

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.
@@ -1,4 +1,5 @@
1
1
  import { DvelopContext } from "../../../../core/lib";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
2
3
  /**
3
4
  * Used for authentication in the d.velop cloud. Refer to the [documentation](https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html#validating-the-login) for further information.
4
5
  * @category Authentication
@@ -9,6 +10,19 @@ export interface AuthSession {
9
10
  /** Date at which the AuthSessionId will no longer be valid. */
10
11
  expire: Date;
11
12
  }
13
+ /**
14
+ * Default transform-function provided to the {@link getAuthSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
15
+ * @internal
16
+ * @category Authentication
17
+ */
18
+ export declare function _getAuthSessionDefaultTransformFunction(response: HttpResponse, _: DvelopContext): AuthSession;
19
+ /**
20
+ * Factory for the {@link getAuthSession}-function. See internals for more information. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
21
+ * @typeparam T Return type of the {@link getAuthSession}-function. A corresponding transformFuntion has to be supplied.
22
+ * @internal
23
+ * @category Authentication
24
+ */
25
+ export declare function _getAuthSessionFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext) => T): (context: DvelopContext) => Promise<T>;
12
26
  /**
13
27
  * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
14
28
  * **The AuthSessionId should be kept secret and never be publicly available.**
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uJAAuJ;IACvJ,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,MAAM,EAAE,IAAI,CAAC;CACd;AAkCD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjF"}
1
+ {"version":3,"file":"get-auth-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uJAAuJ;IACvJ,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,WAAW,CAK7G;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,GACvE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CASxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjF"}
@@ -1,4 +1,5 @@
1
1
  import { DvelopContext } from "@dvelop-sdk/core";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
2
3
  /**
3
4
  * Parameters for the {@link getImpersonatedAuthSessionId}-function.
4
5
  * @category Authentication
@@ -6,6 +7,19 @@ import { DvelopContext } from "@dvelop-sdk/core";
6
7
  export interface GetImpersonatedAuthSessionIdParams {
7
8
  userId: string;
8
9
  }
10
+ /**
11
+ * Default transform-function provided to the {@link getImpersontedAuthSessionId}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
12
+ * @internal
13
+ * @category Authentication
14
+ */
15
+ export declare function _getImpersonatedAuthSessionIdDefaultTransformFunction(response: HttpResponse, _: DvelopContext, __: GetImpersonatedAuthSessionIdParams): string;
16
+ /**
17
+ * Factory for the {@link getImpersonatedAuthSessionId}}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
18
+ * @typeparam T Return type of the {@link getImpersonatedAuthSessionId}-function. A corresponding transformFuntion has to be supplied.
19
+ * @internal
20
+ * @category Authentication
21
+ */
22
+ export declare function _getImpersonatedAuthSessionIdFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetImpersonatedAuthSessionIdParams) => T): (context: DvelopContext, params: GetImpersonatedAuthSessionIdParams) => Promise<T>;
9
23
  /**
10
24
  * Returns an authSessionId for the given user. All requests with this authSessionId will be in that users name.
11
25
  * **The AuthSessionId should be kept secret and never be publicly available.**
@@ -1 +1 @@
1
- {"version":3,"file":"get-impersonated-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAiCD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtI"}
1
+ {"version":3,"file":"get-impersonated-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,qDAAqD,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,kCAAkC,GAAG,MAAM,CAE9J;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,CAAC,EACpD,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,KAAK,CAAC,GACnH,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,KAAK,OAAO,CAAC,CAAC,CAAC,CAWpF;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtI"}
@@ -10,15 +10,6 @@ export interface RequestAppSessionParams {
10
10
  /** Relative URI to which the appSession will be sent via POST */
11
11
  callback: string;
12
12
  }
13
- /**
14
- * AppSession which will be postet to your app after using the {@link requestAppSession}-function.
15
- * @category Authentication
16
- */
17
- export interface AppSession {
18
- appSessionId: string;
19
- expire: string;
20
- sign: string;
21
- }
22
13
  /**
23
14
  * Factory for the {@link requestAppSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
24
15
  * @typeparam T Return type of the {@link requestAppSession}-function. A corresponding transformFuntion has to be supplied.
@@ -1 +1 @@
1
- {"version":3,"file":"request-app-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,CAAC,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,CAAC,CAAC,CAgBzE;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9G"}
1
+ {"version":3,"file":"request-app-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,CAAC,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,CAAC,CAAC,CAgBzE;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9G"}
@@ -1 +1 @@
1
- {"version":3,"file":"request-app-session.js","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAuBzF;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAmBC;IAdC,OAAO,UAAO,OAAsB,EAAE,MAA+B;;;;wBAElD,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,8BAA8B;wBACnC,IAAI,EAAE;4BACJ,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,SAAS,EAAE,OAAO,CAAC,SAAS;yBAC7B;qBACF,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAnBD,8DAmBC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,0BAA0B;AAC1B,SAAsB,iBAAiB,CAAC,OAAsB,EAAE,MAA+B;;;;wBACtF,qBAAM,yBAAyB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA/F,sBAAO,SAAwF,EAAC;;;;CACjG;AAFD,8CAEC"}
1
+ {"version":3,"file":"request-app-session.js","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAazF;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAmBC;IAdC,OAAO,UAAO,OAAsB,EAAE,MAA+B;;;;wBAElD,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,8BAA8B;wBACnC,IAAI,EAAE;4BACJ,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,SAAS,EAAE,OAAO,CAAC,SAAS;yBAC7B;qBACF,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAnBD,8DAmBC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,0BAA0B;AAC1B,SAAsB,iBAAiB,CAAC,OAAsB,EAAE,MAA+B;;;;wBACtF,qBAAM,yBAAyB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA/F,sBAAO,SAAwF,EAAC;;;;CACjG;AAFD,8CAEC"}
@@ -1,4 +1,3 @@
1
- import { AppSession } from "../request-app-session/request-app-session";
2
1
  /**
3
2
  * Indicates an invalid sign-value
4
3
  * @category Error
@@ -6,6 +5,15 @@ import { AppSession } from "../request-app-session/request-app-session";
6
5
  export declare class InvalidAppSessionSignatureError extends Error {
7
6
  constructor();
8
7
  }
8
+ /**
9
+ * AppSession which will be postet to your app after using the {@link requestAppSession}-function.
10
+ * @category Authentication
11
+ */
12
+ export interface AppSession {
13
+ authSessionId: string;
14
+ expire: string;
15
+ sign: string;
16
+ }
9
17
  /**
10
18
  * Validate the sign value which is provided when an appSession is sent to your app. For further information on this process refer to the [documentation](https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html#IdentityproviderApp-Inter-appcommunicationwithappsessions).
11
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"validate-app-session-signature.d.ts","sourceRoot":"","sources":["../../../src/authentication/validate-app-session-signature/validate-app-session-signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE;;;EAGE;AACF,qBAAa,+BAAgC,SAAQ,KAAK;;CAMzD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAK5G"}
1
+ {"version":3,"file":"validate-app-session-signature.d.ts","sourceRoot":"","sources":["../../../src/authentication/validate-app-session-signature/validate-app-session-signature.ts"],"names":[],"mappings":"AAEA;;;EAGE;AACF,qBAAa,+BAAgC,SAAQ,KAAK;;CAMzD;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAa5G"}
@@ -47,8 +47,15 @@ exports.InvalidAppSessionSignatureError = InvalidAppSessionSignatureError;
47
47
  * @category Authentication
48
48
  */
49
49
  function validateAppSessionSignature(appName, requestId, appSession) {
50
- var expectedSign = crypto_1.createHash("sha256").update(appName + appSession.appSessionId + appSession.expire + requestId, "utf8").digest("hex");
51
- if (expectedSign !== appSession.sign) {
50
+ var validSignature = false;
51
+ try {
52
+ var expectedSign = crypto_1.createHash("sha256").update(appName + appSession.authSessionId + appSession.expire + requestId, "utf8").digest("hex");
53
+ validSignature = crypto_1.timingSafeEqual(Buffer.from(appSession.sign), Buffer.from(expectedSign));
54
+ }
55
+ catch (e) {
56
+ throw new InvalidAppSessionSignatureError();
57
+ }
58
+ if (!validSignature) {
52
59
  throw new InvalidAppSessionSignatureError();
53
60
  }
54
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate-app-session-signature.js","sourceRoot":"","sources":["../../../src/authentication/validate-app-session-signature/validate-app-session-signature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAoC;AAGpC;;;EAGE;AACF;IAAqD,mDAAK;IACxD,0CAA0C;IAC1C;QAAA,YACE,kBAAM,uFAAuF,CAAC,SAE/F;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC;;IACzE,CAAC;IACH,sCAAC;AAAD,CAAC,AAND,CAAqD,KAAK,GAMzD;AANY,0EAA+B;AAQ5C;;;;;;;;;;;;;GAaG;AACH,SAAgB,2BAA2B,CAAC,OAAe,EAAE,SAAiB,EAAE,UAAsB;IACpG,IAAM,YAAY,GAAW,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC,YAAY,GAAG,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClJ,IAAI,YAAY,KAAK,UAAU,CAAC,IAAI,EAAE;QACpC,MAAM,IAAI,+BAA+B,EAAE,CAAC;KAC7C;AACH,CAAC;AALD,kEAKC"}
1
+ {"version":3,"file":"validate-app-session-signature.js","sourceRoot":"","sources":["../../../src/authentication/validate-app-session-signature/validate-app-session-signature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAqD;AAErD;;;EAGE;AACF;IAAqD,mDAAK;IACxD,0CAA0C;IAC1C;QAAA,YACE,kBAAM,uFAAuF,CAAC,SAE/F;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC;;IACzE,CAAC;IACH,sCAAC;AAAD,CAAC,AAND,CAAqD,KAAK,GAMzD;AANY,0EAA+B;AAkB5C;;;;;;;;;;;;;GAaG;AACH,SAAgB,2BAA2B,CAAC,OAAe,EAAE,SAAiB,EAAE,UAAsB;IAEpG,IAAI,cAAc,GAAY,KAAK,CAAC;IAEpC,IAAI;QACF,IAAM,YAAY,GAAW,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC,aAAa,GAAG,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnJ,cAAc,GAAG,wBAAe,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAC3F;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,+BAA+B,EAAE,CAAC;KAC7C;IACD,IAAI,CAAC,cAAc,EAAE;QACnB,MAAM,IAAI,+BAA+B,EAAE,CAAC;KAC7C;AACH,CAAC;AAbD,kEAaC"}
@@ -31,6 +31,12 @@ export interface DvelopUser {
31
31
  type?: string;
32
32
  }[];
33
33
  }
34
+ /**
35
+ * Default transform-function provided to the {@link validateAuthSessionId}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
36
+ * @internal
37
+ * @category Authentication
38
+ */
39
+ export declare function _validateAuthSessionIdDefaultTransformFunction(response: HttpResponse, _: DvelopContext): DvelopUser;
34
40
  /**
35
41
  * Factory for the {@link validateAuthSessionId}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
36
42
  * @typeparam T Return type of the {@link validateAuthSessionId}-function. A corresponding transformFuntion has to be supplied.
@@ -1 +1 @@
1
- {"version":3,"file":"validate-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/validate-auth-session-id/validate-auth-session-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,UAAU;IAEzB,oBAAoB;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sBAAsB;IACtB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IAEJ,kCAAkC;IAClC,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IAEJ,2DAA2D;IAC3D,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL;AAWD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,GACvE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CASxC;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAEvF"}
1
+ {"version":3,"file":"validate-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/validate-auth-session-id/validate-auth-session-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,UAAU;IAEzB,oBAAoB;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sBAAsB;IACtB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IAEJ,kCAAkC;IAClC,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IAEJ,2DAA2D;IAC3D,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL;AAED;;;;GAIG;AACH,wBAAgB,8CAA8C,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,UAAU,CAEnH;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,GACvE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CASxC;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAEvF"}
package/lib/index.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
15
15
  </a
16
16
  </br>
17
- <p>This package contains functionality for the <a href="https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html">Identityprovider-App</a> in the d.velop cloud.</p>
17
+ <p>This package contains functionality for the <a href="https://developer.d-velop.de/documentation/idpapi/en">Identityprovider-App</a> in the d.velop cloud.</p>
18
18
  <a href="https://d-velop.github.io/dvelop-sdk-node/modules/identityprovider.html"><strong>Explore the docs »</strong></a>
19
19
  </br>
20
20
  <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider"><strong>Install via npm »</strong></a>
@@ -23,13 +23,19 @@
23
23
  </div>
24
24
  * @module identityprovider
25
25
  */
26
+ import { DvelopUser } from "./authentication/validate-auth-session-id/validate-auth-session-id";
27
+ declare module "@dvelop-sdk/core" {
28
+ interface DvelopContext {
29
+ user?: DvelopUser;
30
+ }
31
+ }
26
32
  export { DvelopContext, BadInputError, UnauthorizedError, ForbiddenError, NotFoundError } from "@dvelop-sdk/core";
27
33
  export { IdentityproviderError } from "./utils/http";
28
34
  export * as internals from "./internal";
29
35
  export { getAuthSession } from "./authentication/get-auth-session/get-auth-session";
30
36
  export { GetImpersonatedAuthSessionIdParams, getImpersonatedAuthSessionId } from "./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id";
31
- export { RequestAppSessionParams, requestAppSession, AppSession } from "./authentication/request-app-session/request-app-session";
37
+ export { RequestAppSessionParams, requestAppSession } from "./authentication/request-app-session/request-app-session";
32
38
  export { getLoginRedirectionUri } from "./authentication/get-login-redirection-uri/get-login-redirection-uri";
33
- export { validateAppSessionSignature, InvalidAppSessionSignatureError } from "./authentication/validate-app-session-signature/validate-app-session-signature";
39
+ export { AppSession, validateAppSessionSignature, InvalidAppSessionSignatureError } from "./authentication/validate-app-session-signature/validate-app-session-signature";
34
40
  export { validateAuthSessionId, DvelopUser } from "./authentication/validate-auth-session-id/validate-auth-session-id";
35
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAE,kCAAkC,EAAE,4BAA4B,EAAE,MAAM,oFAAoF,CAAC;AACtK,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AAClI,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,gFAAgF,CAAC;AAC9J,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,oEAAoE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oEAAoE,CAAC;AAEhG,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,aAAa;QACrB,IAAI,CAAC,EAAE,UAAU,CAAA;KAClB;CACF;AAGD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAE,kCAAkC,EAAE,4BAA4B,EAAE,MAAM,oFAAoF,CAAC;AACtK,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAC;AACtH,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,gFAAgF,CAAC;AAC1K,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,oEAAoE,CAAC"}
package/lib/index.js CHANGED
@@ -1,29 +1,4 @@
1
1
  "use strict";
2
- /**
3
- <div align="center">
4
- <h1>@dvelop-sdk/identityprovider</h1>
5
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
6
- <img alt="npm (scoped)" src="https://img.shields.io/npm/v/@dvelop-sdk/identityprovider?style=for-the-badge">
7
- </a>
8
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
9
- <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/min/@dvelop-sdk/identityprovider?style=for-the-badge">
10
- </a>
11
- <a href="https://github.com/d-velop/dvelop-sdk-node">
12
- <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
13
- </a>
14
- <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
15
- <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
16
- </a
17
- </br>
18
- <p>This package contains functionality for the <a href="https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html">Identityprovider-App</a> in the d.velop cloud.</p>
19
- <a href="https://d-velop.github.io/dvelop-sdk-node/modules/identityprovider.html"><strong>Explore the docs »</strong></a>
20
- </br>
21
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider"><strong>Install via npm »</strong></a>
22
- </br>
23
- <a href="https://github.com/d-velop/dvelop-sdk-node"><strong>Check us out on GitHub »</strong></a>
24
- </div>
25
- * @module identityprovider
26
- */
27
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
28
3
  if (k2 === undefined) k2 = k;
29
4
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;;;;;;;AAEH,QAAQ;AACR,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAqD;AAA5C,6GAAA,qBAAqB,OAAA;AAC9B,wDAAwC;AAExC,iBAAiB;AACjB,uFAAoF;AAA3E,kHAAA,cAAc,OAAA;AACvB,uIAAsK;AAAzH,gJAAA,4BAA4B,OAAA;AACzE,gGAAkI;AAAhG,wHAAA,iBAAiB,OAAA;AACnD,kHAA8G;AAArG,mIAAA,sBAAsB,OAAA;AAC/B,iIAA8J;AAArJ,6IAAA,2BAA2B,OAAA;AAAE,iJAAA,+BAA+B,OAAA;AACrE,+GAAuH;AAA9G,iIAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,QAAQ;AACR,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAqD;AAA5C,6GAAA,qBAAqB,OAAA;AAC9B,wDAAwC;AAExC,iBAAiB;AACjB,uFAAoF;AAA3E,kHAAA,cAAc,OAAA;AACvB,uIAAsK;AAAzH,gJAAA,4BAA4B,OAAA;AACzE,gGAAsH;AAApF,wHAAA,iBAAiB,OAAA;AACnD,kHAA8G;AAArG,mIAAA,sBAAsB,OAAA;AAC/B,iIAA0K;AAArJ,6IAAA,2BAA2B,OAAA;AAAE,iJAAA,+BAA+B,OAAA;AACjF,+GAAuH;AAA9G,iIAAA,qBAAqB,OAAA"}
@@ -1,4 +1,4 @@
1
- import { DvelopSdkError } from "@dvelop-sdk/core";
1
+ import { DvelopContext, DvelopHttpRequestConfig, DvelopHttpResponse, DvelopHttpClient, DvelopSdkError } from "@dvelop-sdk/core";
2
2
  export { DvelopHttpRequestConfig as HttpConfig, DvelopHttpResponse as HttpResponse } from "@dvelop-sdk/core";
3
3
  /**
4
4
  * Generic Error for identityprovider-package.
@@ -9,4 +9,16 @@ export declare class IdentityproviderError extends DvelopSdkError {
9
9
  originalError?: Error | undefined;
10
10
  constructor(message: string, originalError?: Error | undefined);
11
11
  }
12
+ /**
13
+ * Factory used to create the default httpRequestFunction. Mostly used for HTTP-Error handling.
14
+ * @internal
15
+ * @category Http
16
+ */
17
+ export declare function _defaultHttpRequestFunctionFactory(httpClient: DvelopHttpClient): (context: DvelopContext, config: DvelopHttpRequestConfig) => Promise<DvelopHttpResponse>;
18
+ /**
19
+ * Default httpRequestFunction used in dms-package.
20
+ * @internal
21
+ * @category Http
22
+ */
23
+ export declare function _defaultHttpRequestFunction(context: DvelopContext, config: DvelopHttpRequestConfig): Promise<DvelopHttpResponse>;
12
24
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAiL,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjO,OAAO,EAAE,uBAAuB,IAAI,UAAU,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7G;;;EAGE;AAEF,qBAAa,qBAAsB,SAAQ,cAAc;IAEpC,OAAO,EAAE,MAAM;IAAS,aAAa,CAAC;gBAAtC,OAAO,EAAE,MAAM,EAAS,aAAa,CAAC,mBAAO;CAIjE"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,gBAAgB,EAAmG,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjO,OAAO,EAAE,uBAAuB,IAAI,UAAU,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7G;;;EAGE;AAEF,qBAAa,qBAAsB,SAAQ,cAAc;IAEpC,OAAO,EAAE,MAAM;IAAS,aAAa,CAAC;gBAAtC,OAAO,EAAE,MAAM,EAAS,aAAa,CAAC,mBAAO;CAIjE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,gBAAgB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CA8BzK;AAED;;;;GAIG;AAEH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEtI"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dvelop-sdk/identityprovider",
3
3
  "description": "This package contains functionality for the Identityprovider-App in the d.velop cloud.",
4
- "version": "3.0.2",
4
+ "version": "4.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -23,6 +23,6 @@
23
23
  "license": "license-checker --production --onlyAllow Apache-2.0;MIT;ISC;BSD-2-Clause;BSD-3-Clause"
24
24
  },
25
25
  "dependencies": {
26
- "@dvelop-sdk/core": "^1.1.1"
26
+ "@dvelop-sdk/core": "^2.0.0"
27
27
  }
28
28
  }