@dvelop-sdk/identityprovider 3.1.0 → 4.0.2

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.
Files changed (26) hide show
  1. package/README.md +29 -29
  2. package/lib/authentication/get-auth-session/get-auth-session.d.ts +44 -44
  3. package/lib/authentication/get-auth-session/get-auth-session.js +104 -104
  4. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.d.ts +41 -41
  5. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.js +103 -103
  6. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.d.ts +11 -11
  7. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.js +17 -17
  8. package/lib/authentication/request-app-session/request-app-session.d.ts +36 -45
  9. package/lib/authentication/request-app-session/request-app-session.d.ts.map +1 -1
  10. package/lib/authentication/request-app-session/request-app-session.js +97 -97
  11. package/lib/authentication/request-app-session/request-app-session.js.map +1 -1
  12. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts +31 -23
  13. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts.map +1 -1
  14. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js +62 -55
  15. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js.map +1 -1
  16. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.d.ts +61 -61
  17. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.js +100 -100
  18. package/lib/index.d.ts +40 -40
  19. package/lib/index.d.ts.map +1 -1
  20. package/lib/index.js +45 -45
  21. package/lib/index.js.map +1 -1
  22. package/lib/internal.d.ts +5 -5
  23. package/lib/internal.js +18 -18
  24. package/lib/utils/http.d.ts +23 -23
  25. package/lib/utils/http.js +129 -129
  26. package/package.json +27 -27
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- <div align="center">
2
- <h1>@dvelop-sdk/identityprovider</h1>
3
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
4
- <img alt="npm (scoped)" src="https://img.shields.io/npm/v/@dvelop-sdk/identityprovider?style=for-the-badge">
5
- </a>
6
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
7
- <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/min/@dvelop-sdk/identityprovider?style=for-the-badge">
8
- </a>
9
- <a href="https://github.com/d-velop/dvelop-sdk-node">
10
- <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
11
- </a>
12
- <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
13
- <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
14
- </a
15
-
16
- </br>
17
-
18
- <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>
19
-
20
- <a href="https://d-velop.github.io/dvelop-sdk-node/modules/identityprovider.html"><strong>Explore the docs »</strong></a>
21
-
22
- </br>
23
-
24
- <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider"><strong>Install via npm »</strong></a>
25
-
26
- </br>
27
-
28
- <a href="https://github.com/d-velop/dvelop-sdk-node"><strong>Check us out on GitHub »</strong></a>
29
-
1
+ <div align="center">
2
+ <h1>@dvelop-sdk/identityprovider</h1>
3
+ <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
4
+ <img alt="npm (scoped)" src="https://img.shields.io/npm/v/@dvelop-sdk/identityprovider?style=for-the-badge">
5
+ </a>
6
+ <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider">
7
+ <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/min/@dvelop-sdk/identityprovider?style=for-the-badge">
8
+ </a>
9
+ <a href="https://github.com/d-velop/dvelop-sdk-node">
10
+ <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
11
+ </a>
12
+ <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
13
+ <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
14
+ </a
15
+
16
+ </br>
17
+
18
+ <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>
19
+
20
+ <a href="https://d-velop.github.io/dvelop-sdk-node/modules/identityprovider.html"><strong>Explore the docs »</strong></a>
21
+
22
+ </br>
23
+
24
+ <a href="https://www.npmjs.com/package/@dvelop-sdk/identityprovider"><strong>Install via npm »</strong></a>
25
+
26
+ </br>
27
+
28
+ <a href="https://github.com/d-velop/dvelop-sdk-node"><strong>Check us out on GitHub »</strong></a>
29
+
30
30
  </div>
@@ -1,45 +1,45 @@
1
- import { DvelopContext } from "../../../../core/lib";
2
- import { HttpConfig, HttpResponse } from "../../utils/http";
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.
5
- * @category Authentication
6
- */
7
- export interface AuthSession {
8
- /** This key will validate your requests (usually sent as Bearer-Token). **The AuthSessionId should be kept secret and never be publicly available** */
9
- id: string;
10
- /** Date at which the AuthSessionId will no longer be valid. */
11
- expire: Date;
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>;
26
- /**
27
- * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
28
- * **The AuthSessionId should be kept secret and never be publicly available.**
29
- *
30
- *
31
- * ```typescript
32
- * import { getAuthSession } from "@dvelop-sdk/identityprovider";
33
- *
34
- * const authSession = await getAuthSession({
35
- * systemBaseUri: "https://monster-ag.d-velop.cloud",
36
- * authSessionId: "dQw4w9WgXcQ"
37
- * });
38
- *
39
- console.log(authSession);
40
- * ```
41
- *
42
- * @category Authentication
43
- */
44
- export declare function getAuthSession(context: DvelopContext): Promise<AuthSession>;
1
+ import { DvelopContext } from "../../../../core/lib";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
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.
5
+ * @category Authentication
6
+ */
7
+ export interface AuthSession {
8
+ /** This key will validate your requests (usually sent as Bearer-Token). **The AuthSessionId should be kept secret and never be publicly available** */
9
+ id: string;
10
+ /** Date at which the AuthSessionId will no longer be valid. */
11
+ expire: Date;
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>;
26
+ /**
27
+ * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
28
+ * **The AuthSessionId should be kept secret and never be publicly available.**
29
+ *
30
+ *
31
+ * ```typescript
32
+ * import { getAuthSession } from "@dvelop-sdk/identityprovider";
33
+ *
34
+ * const authSession = await getAuthSession({
35
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
36
+ * authSessionId: "dQw4w9WgXcQ"
37
+ * });
38
+ *
39
+ console.log(authSession);
40
+ * ```
41
+ *
42
+ * @category Authentication
43
+ */
44
+ export declare function getAuthSession(context: DvelopContext): Promise<AuthSession>;
45
45
  //# sourceMappingURL=get-auth-session.d.ts.map
@@ -1,105 +1,105 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getAuthSession = exports._getAuthSessionFactory = exports._getAuthSessionDefaultTransformFunction = void 0;
40
- var http_1 = require("../../utils/http");
41
- /**
42
- * 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.
43
- * @internal
44
- * @category Authentication
45
- */
46
- function _getAuthSessionDefaultTransformFunction(response, _) {
47
- return {
48
- id: response.data.AuthSessionId,
49
- expire: new Date(response.data.Expire)
50
- };
51
- }
52
- exports._getAuthSessionDefaultTransformFunction = _getAuthSessionDefaultTransformFunction;
53
- /**
54
- * 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.
55
- * @typeparam T Return type of the {@link getAuthSession}-function. A corresponding transformFuntion has to be supplied.
56
- * @internal
57
- * @category Authentication
58
- */
59
- function _getAuthSessionFactory(httpRequestFunction, transformFunction) {
60
- var _this = this;
61
- return function (context) { return __awaiter(_this, void 0, void 0, function () {
62
- var response;
63
- return __generator(this, function (_a) {
64
- switch (_a.label) {
65
- case 0: return [4 /*yield*/, httpRequestFunction(context, {
66
- method: "GET",
67
- url: "/identityprovider",
68
- follows: ["login"],
69
- })];
70
- case 1:
71
- response = _a.sent();
72
- return [2 /*return*/, transformFunction(response, context)];
73
- }
74
- });
75
- }); };
76
- }
77
- exports._getAuthSessionFactory = _getAuthSessionFactory;
78
- /**
79
- * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
80
- * **The AuthSessionId should be kept secret and never be publicly available.**
81
- *
82
- *
83
- * ```typescript
84
- * import { getAuthSession } from "@dvelop-sdk/identityprovider";
85
- *
86
- * const authSession = await getAuthSession({
87
- * systemBaseUri: "https://monster-ag.d-velop.cloud",
88
- * authSessionId: "dQw4w9WgXcQ"
89
- * });
90
- *
91
- console.log(authSession);
92
- * ```
93
- *
94
- * @category Authentication
95
- */
96
- /* istanbul ignore next */
97
- function getAuthSession(context) {
98
- return __awaiter(this, void 0, void 0, function () {
99
- return __generator(this, function (_a) {
100
- return [2 /*return*/, _getAuthSessionFactory(http_1._defaultHttpRequestFunction, _getAuthSessionDefaultTransformFunction)(context)];
101
- });
102
- });
103
- }
104
- exports.getAuthSession = getAuthSession;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getAuthSession = exports._getAuthSessionFactory = exports._getAuthSessionDefaultTransformFunction = void 0;
40
+ var http_1 = require("../../utils/http");
41
+ /**
42
+ * 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.
43
+ * @internal
44
+ * @category Authentication
45
+ */
46
+ function _getAuthSessionDefaultTransformFunction(response, _) {
47
+ return {
48
+ id: response.data.AuthSessionId,
49
+ expire: new Date(response.data.Expire)
50
+ };
51
+ }
52
+ exports._getAuthSessionDefaultTransformFunction = _getAuthSessionDefaultTransformFunction;
53
+ /**
54
+ * 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.
55
+ * @typeparam T Return type of the {@link getAuthSession}-function. A corresponding transformFuntion has to be supplied.
56
+ * @internal
57
+ * @category Authentication
58
+ */
59
+ function _getAuthSessionFactory(httpRequestFunction, transformFunction) {
60
+ var _this = this;
61
+ return function (context) { return __awaiter(_this, void 0, void 0, function () {
62
+ var response;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
66
+ method: "GET",
67
+ url: "/identityprovider",
68
+ follows: ["login"],
69
+ })];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [2 /*return*/, transformFunction(response, context)];
73
+ }
74
+ });
75
+ }); };
76
+ }
77
+ exports._getAuthSessionFactory = _getAuthSessionFactory;
78
+ /**
79
+ * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
80
+ * **The AuthSessionId should be kept secret and never be publicly available.**
81
+ *
82
+ *
83
+ * ```typescript
84
+ * import { getAuthSession } from "@dvelop-sdk/identityprovider";
85
+ *
86
+ * const authSession = await getAuthSession({
87
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
88
+ * authSessionId: "dQw4w9WgXcQ"
89
+ * });
90
+ *
91
+ console.log(authSession);
92
+ * ```
93
+ *
94
+ * @category Authentication
95
+ */
96
+ /* istanbul ignore next */
97
+ function getAuthSession(context) {
98
+ return __awaiter(this, void 0, void 0, function () {
99
+ return __generator(this, function (_a) {
100
+ return [2 /*return*/, _getAuthSessionFactory(http_1._defaultHttpRequestFunction, _getAuthSessionDefaultTransformFunction)(context)];
101
+ });
102
+ });
103
+ }
104
+ exports.getAuthSession = getAuthSession;
105
105
  //# sourceMappingURL=get-auth-session.js.map
@@ -1,42 +1,42 @@
1
- import { DvelopContext } from "@dvelop-sdk/core";
2
- import { HttpConfig, HttpResponse } from "../../utils/http";
3
- /**
4
- * Parameters for the {@link getImpersonatedAuthSessionId}-function.
5
- * @category Authentication
6
- */
7
- export interface GetImpersonatedAuthSessionIdParams {
8
- userId: string;
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>;
23
- /**
24
- * Returns an authSessionId for the given user. All requests with this authSessionId will be in that users name.
25
- * **The AuthSessionId should be kept secret and never be publicly available.**
26
- *
27
- * ```typescript
28
- * import { getImpersonatedAuthSessionId } from "@dvelop-sdk/identityprovider";
29
- *
30
- * const authSessionId = await getImpersonatedAuthSessionId({
31
- * systemBaseUri: "https://monster-ag.d-velop.cloud",
32
- * authSessionId: "dQw4w9WgXcQ" // has to be an AppSession
33
- * }, {
34
- * userId: "XiFkyR35v2Y"
35
- * });
36
- *
37
- * console.log(authSessionId);
38
- * ```
39
- * @category Authentication
40
- */
41
- export declare function getImpersonatedAuthSessionId(context: DvelopContext, params: GetImpersonatedAuthSessionIdParams): Promise<string>;
1
+ import { DvelopContext } from "@dvelop-sdk/core";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
3
+ /**
4
+ * Parameters for the {@link getImpersonatedAuthSessionId}-function.
5
+ * @category Authentication
6
+ */
7
+ export interface GetImpersonatedAuthSessionIdParams {
8
+ userId: string;
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>;
23
+ /**
24
+ * Returns an authSessionId for the given user. All requests with this authSessionId will be in that users name.
25
+ * **The AuthSessionId should be kept secret and never be publicly available.**
26
+ *
27
+ * ```typescript
28
+ * import { getImpersonatedAuthSessionId } from "@dvelop-sdk/identityprovider";
29
+ *
30
+ * const authSessionId = await getImpersonatedAuthSessionId({
31
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
32
+ * authSessionId: "dQw4w9WgXcQ" // has to be an AppSession
33
+ * }, {
34
+ * userId: "XiFkyR35v2Y"
35
+ * });
36
+ *
37
+ * console.log(authSessionId);
38
+ * ```
39
+ * @category Authentication
40
+ */
41
+ export declare function getImpersonatedAuthSessionId(context: DvelopContext, params: GetImpersonatedAuthSessionIdParams): Promise<string>;
42
42
  //# sourceMappingURL=get-impersonated-auth-session-id.d.ts.map