@goauthentik/api 2024.10.1-1731327664 → 2024.10.1-1731418991

Sign up to get free protection for your applications and to get access to all the features.
@@ -200,6 +200,7 @@ src/models/IdentificationChallenge.ts
200
200
  src/models/IdentificationChallengeResponseRequest.ts
201
201
  src/models/IdentificationStage.ts
202
202
  src/models/IdentificationStageRequest.ts
203
+ src/models/ImpersonationRequest.ts
203
204
  src/models/InstallID.ts
204
205
  src/models/IntentEnum.ts
205
206
  src/models/InvalidResponseActionEnum.ts
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { Application, ApplicationRequest, AuthenticatedSession, Brand, BrandRequest, Coordinate, CurrentBrand, FilePathRequest, Group, GroupRequest, Link, PaginatedApplicationList, PaginatedAuthenticatedSessionList, PaginatedBrandList, PaginatedGroupList, PaginatedTokenList, PaginatedUserConsentList, PaginatedUserList, PatchedApplicationRequest, PatchedBrandRequest, PatchedGroupRequest, PatchedTokenRequest, PatchedUserRequest, PolicyTestResult, SessionUser, Token, TokenRequest, TokenSetKeyRequest, TokenView, TransactionApplicationRequest, TransactionApplicationResponse, UsedBy, User, UserAccountRequest, UserConsent, UserMetrics, UserPasswordSetRequest, UserPath, UserRequest, UserServiceAccountRequest, UserServiceAccountResponse } from '../models';
13
+ import type { Application, ApplicationRequest, AuthenticatedSession, Brand, BrandRequest, Coordinate, CurrentBrand, FilePathRequest, Group, GroupRequest, ImpersonationRequest, Link, PaginatedApplicationList, PaginatedAuthenticatedSessionList, PaginatedBrandList, PaginatedGroupList, PaginatedTokenList, PaginatedUserConsentList, PaginatedUserList, PatchedApplicationRequest, PatchedBrandRequest, PatchedGroupRequest, PatchedTokenRequest, PatchedUserRequest, PolicyTestResult, SessionUser, Token, TokenRequest, TokenSetKeyRequest, TokenView, TransactionApplicationRequest, TransactionApplicationResponse, UsedBy, User, UserAccountRequest, UserConsent, UserMetrics, UserPasswordSetRequest, UserPath, UserRequest, UserServiceAccountRequest, UserServiceAccountResponse } from '../models';
14
14
  export interface CoreApplicationsCheckAccessRetrieveRequest {
15
15
  slug: string;
16
16
  forUser?: number;
@@ -228,6 +228,7 @@ export interface CoreUsersDestroyRequest {
228
228
  }
229
229
  export interface CoreUsersImpersonateCreateRequest {
230
230
  id: number;
231
+ impersonationRequest: ImpersonationRequest;
231
232
  }
232
233
  export interface CoreUsersListRequest {
233
234
  attributes?: string;
@@ -1964,8 +1964,12 @@ class CoreApi extends runtime.BaseAPI {
1964
1964
  if (requestParameters.id === null || requestParameters.id === undefined) {
1965
1965
  throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling coreUsersImpersonateCreate.');
1966
1966
  }
1967
+ if (requestParameters.impersonationRequest === null || requestParameters.impersonationRequest === undefined) {
1968
+ throw new runtime.RequiredError('impersonationRequest', 'Required parameter requestParameters.impersonationRequest was null or undefined when calling coreUsersImpersonateCreate.');
1969
+ }
1967
1970
  const queryParameters = {};
1968
1971
  const headerParameters = {};
1972
+ headerParameters['Content-Type'] = 'application/json';
1969
1973
  if (this.configuration && this.configuration.accessToken) {
1970
1974
  const token = this.configuration.accessToken;
1971
1975
  const tokenString = yield token("authentik", []);
@@ -1978,6 +1982,7 @@ class CoreApi extends runtime.BaseAPI {
1978
1982
  method: 'POST',
1979
1983
  headers: headerParameters,
1980
1984
  query: queryParameters,
1985
+ body: (0, models_1.ImpersonationRequestToJSON)(requestParameters.impersonationRequest),
1981
1986
  }, initOverrides);
1982
1987
  return new runtime.VoidApiResponse(response);
1983
1988
  });
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { Application, ApplicationRequest, AuthenticatedSession, Brand, BrandRequest, Coordinate, CurrentBrand, FilePathRequest, Group, GroupRequest, Link, PaginatedApplicationList, PaginatedAuthenticatedSessionList, PaginatedBrandList, PaginatedGroupList, PaginatedTokenList, PaginatedUserConsentList, PaginatedUserList, PatchedApplicationRequest, PatchedBrandRequest, PatchedGroupRequest, PatchedTokenRequest, PatchedUserRequest, PolicyTestResult, SessionUser, Token, TokenRequest, TokenSetKeyRequest, TokenView, TransactionApplicationRequest, TransactionApplicationResponse, UsedBy, User, UserAccountRequest, UserConsent, UserMetrics, UserPasswordSetRequest, UserPath, UserRequest, UserServiceAccountRequest, UserServiceAccountResponse } from '../models';
13
+ import type { Application, ApplicationRequest, AuthenticatedSession, Brand, BrandRequest, Coordinate, CurrentBrand, FilePathRequest, Group, GroupRequest, ImpersonationRequest, Link, PaginatedApplicationList, PaginatedAuthenticatedSessionList, PaginatedBrandList, PaginatedGroupList, PaginatedTokenList, PaginatedUserConsentList, PaginatedUserList, PatchedApplicationRequest, PatchedBrandRequest, PatchedGroupRequest, PatchedTokenRequest, PatchedUserRequest, PolicyTestResult, SessionUser, Token, TokenRequest, TokenSetKeyRequest, TokenView, TransactionApplicationRequest, TransactionApplicationResponse, UsedBy, User, UserAccountRequest, UserConsent, UserMetrics, UserPasswordSetRequest, UserPath, UserRequest, UserServiceAccountRequest, UserServiceAccountResponse } from '../models';
14
14
  export interface CoreApplicationsCheckAccessRetrieveRequest {
15
15
  slug: string;
16
16
  forUser?: number;
@@ -228,6 +228,7 @@ export interface CoreUsersDestroyRequest {
228
228
  }
229
229
  export interface CoreUsersImpersonateCreateRequest {
230
230
  id: number;
231
+ impersonationRequest: ImpersonationRequest;
231
232
  }
232
233
  export interface CoreUsersListRequest {
233
234
  attributes?: string;
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { ApplicationFromJSON, ApplicationRequestToJSON, AuthenticatedSessionFromJSON, BrandFromJSON, BrandRequestToJSON, CoordinateFromJSON, CurrentBrandFromJSON, FilePathRequestToJSON, GroupFromJSON, GroupRequestToJSON, LinkFromJSON, PaginatedApplicationListFromJSON, PaginatedAuthenticatedSessionListFromJSON, PaginatedBrandListFromJSON, PaginatedGroupListFromJSON, PaginatedTokenListFromJSON, PaginatedUserConsentListFromJSON, PaginatedUserListFromJSON, PatchedApplicationRequestToJSON, PatchedBrandRequestToJSON, PatchedGroupRequestToJSON, PatchedTokenRequestToJSON, PatchedUserRequestToJSON, PolicyTestResultFromJSON, SessionUserFromJSON, TokenFromJSON, TokenRequestToJSON, TokenSetKeyRequestToJSON, TokenViewFromJSON, TransactionApplicationRequestToJSON, TransactionApplicationResponseFromJSON, UsedByFromJSON, UserFromJSON, UserAccountRequestToJSON, UserConsentFromJSON, UserMetricsFromJSON, UserPasswordSetRequestToJSON, UserPathFromJSON, UserRequestToJSON, UserServiceAccountRequestToJSON, UserServiceAccountResponseFromJSON, } from '../models';
24
+ import { ApplicationFromJSON, ApplicationRequestToJSON, AuthenticatedSessionFromJSON, BrandFromJSON, BrandRequestToJSON, CoordinateFromJSON, CurrentBrandFromJSON, FilePathRequestToJSON, GroupFromJSON, GroupRequestToJSON, ImpersonationRequestToJSON, LinkFromJSON, PaginatedApplicationListFromJSON, PaginatedAuthenticatedSessionListFromJSON, PaginatedBrandListFromJSON, PaginatedGroupListFromJSON, PaginatedTokenListFromJSON, PaginatedUserConsentListFromJSON, PaginatedUserListFromJSON, PatchedApplicationRequestToJSON, PatchedBrandRequestToJSON, PatchedGroupRequestToJSON, PatchedTokenRequestToJSON, PatchedUserRequestToJSON, PolicyTestResultFromJSON, SessionUserFromJSON, TokenFromJSON, TokenRequestToJSON, TokenSetKeyRequestToJSON, TokenViewFromJSON, TransactionApplicationRequestToJSON, TransactionApplicationResponseFromJSON, UsedByFromJSON, UserFromJSON, UserAccountRequestToJSON, UserConsentFromJSON, UserMetricsFromJSON, UserPasswordSetRequestToJSON, UserPathFromJSON, UserRequestToJSON, UserServiceAccountRequestToJSON, UserServiceAccountResponseFromJSON, } from '../models';
25
25
  /**
26
26
  *
27
27
  */
@@ -1961,8 +1961,12 @@ export class CoreApi extends runtime.BaseAPI {
1961
1961
  if (requestParameters.id === null || requestParameters.id === undefined) {
1962
1962
  throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling coreUsersImpersonateCreate.');
1963
1963
  }
1964
+ if (requestParameters.impersonationRequest === null || requestParameters.impersonationRequest === undefined) {
1965
+ throw new runtime.RequiredError('impersonationRequest', 'Required parameter requestParameters.impersonationRequest was null or undefined when calling coreUsersImpersonateCreate.');
1966
+ }
1964
1967
  const queryParameters = {};
1965
1968
  const headerParameters = {};
1969
+ headerParameters['Content-Type'] = 'application/json';
1966
1970
  if (this.configuration && this.configuration.accessToken) {
1967
1971
  const token = this.configuration.accessToken;
1968
1972
  const tokenString = yield token("authentik", []);
@@ -1975,6 +1979,7 @@ export class CoreApi extends runtime.BaseAPI {
1975
1979
  method: 'POST',
1976
1980
  headers: headerParameters,
1977
1981
  query: queryParameters,
1982
+ body: ImpersonationRequestToJSON(requestParameters.impersonationRequest),
1978
1983
  }, initOverrides);
1979
1984
  return new runtime.VoidApiResponse(response);
1980
1985
  });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * authentik
3
+ * Making authentication simple.
4
+ *
5
+ * The version of the OpenAPI document: 2024.10.1
6
+ * Contact: hello@goauthentik.io
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ImpersonationRequest
16
+ */
17
+ export interface ImpersonationRequest {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ImpersonationRequest
22
+ */
23
+ reason: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ImpersonationRequest interface.
27
+ */
28
+ export declare function instanceOfImpersonationRequest(value: object): boolean;
29
+ export declare function ImpersonationRequestFromJSON(json: any): ImpersonationRequest;
30
+ export declare function ImpersonationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImpersonationRequest;
31
+ export declare function ImpersonationRequestToJSON(value?: ImpersonationRequest | null): any;
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * authentik
5
+ * Making authentication simple.
6
+ *
7
+ * The version of the OpenAPI document: 2024.10.1
8
+ * Contact: hello@goauthentik.io
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the ImpersonationRequest interface.
16
+ */
17
+ export function instanceOfImpersonationRequest(value) {
18
+ let isInstance = true;
19
+ isInstance = isInstance && "reason" in value;
20
+ return isInstance;
21
+ }
22
+ export function ImpersonationRequestFromJSON(json) {
23
+ return ImpersonationRequestFromJSONTyped(json, false);
24
+ }
25
+ export function ImpersonationRequestFromJSONTyped(json, ignoreDiscriminator) {
26
+ if ((json === undefined) || (json === null)) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'reason': json['reason'],
31
+ };
32
+ }
33
+ export function ImpersonationRequestToJSON(value) {
34
+ if (value === undefined) {
35
+ return undefined;
36
+ }
37
+ if (value === null) {
38
+ return null;
39
+ }
40
+ return {
41
+ 'reason': value.reason,
42
+ };
43
+ }
@@ -63,6 +63,12 @@ export interface PatchedSettingsRequest {
63
63
  * @memberof PatchedSettingsRequest
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof PatchedSettingsRequest
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -35,6 +35,7 @@ export function PatchedSettingsRequestFromJSONTyped(json, ignoreDiscriminator) {
35
35
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
36
36
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
37
37
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
38
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
38
39
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
39
40
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
40
41
  };
@@ -55,6 +56,7 @@ export function PatchedSettingsRequestToJSON(value) {
55
56
  'footer_links': value.footerLinks,
56
57
  'gdpr_compliance': value.gdprCompliance,
57
58
  'impersonation': value.impersonation,
59
+ 'impersonation_require_reason': value.impersonationRequireReason,
58
60
  'default_token_duration': value.defaultTokenDuration,
59
61
  'default_token_length': value.defaultTokenLength,
60
62
  };
@@ -63,6 +63,12 @@ export interface Settings {
63
63
  * @memberof Settings
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof Settings
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -35,6 +35,7 @@ export function SettingsFromJSONTyped(json, ignoreDiscriminator) {
35
35
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
36
36
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
37
37
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
38
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
38
39
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
39
40
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
40
41
  };
@@ -55,6 +56,7 @@ export function SettingsToJSON(value) {
55
56
  'footer_links': value.footerLinks,
56
57
  'gdpr_compliance': value.gdprCompliance,
57
58
  'impersonation': value.impersonation,
59
+ 'impersonation_require_reason': value.impersonationRequireReason,
58
60
  'default_token_duration': value.defaultTokenDuration,
59
61
  'default_token_length': value.defaultTokenLength,
60
62
  };
@@ -63,6 +63,12 @@ export interface SettingsRequest {
63
63
  * @memberof SettingsRequest
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof SettingsRequest
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -35,6 +35,7 @@ export function SettingsRequestFromJSONTyped(json, ignoreDiscriminator) {
35
35
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
36
36
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
37
37
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
38
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
38
39
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
39
40
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
40
41
  };
@@ -55,6 +56,7 @@ export function SettingsRequestToJSON(value) {
55
56
  'footer_links': value.footerLinks,
56
57
  'gdpr_compliance': value.gdprCompliance,
57
58
  'impersonation': value.impersonation,
59
+ 'impersonation_require_reason': value.impersonationRequireReason,
58
60
  'default_token_duration': value.defaultTokenDuration,
59
61
  'default_token_length': value.defaultTokenLength,
60
62
  };
@@ -173,6 +173,7 @@ export * from './IdentificationChallenge';
173
173
  export * from './IdentificationChallengeResponseRequest';
174
174
  export * from './IdentificationStage';
175
175
  export * from './IdentificationStageRequest';
176
+ export * from './ImpersonationRequest';
176
177
  export * from './InstallID';
177
178
  export * from './IntentEnum';
178
179
  export * from './InvalidResponseActionEnum';
@@ -175,6 +175,7 @@ export * from './IdentificationChallenge';
175
175
  export * from './IdentificationChallengeResponseRequest';
176
176
  export * from './IdentificationStage';
177
177
  export * from './IdentificationStageRequest';
178
+ export * from './ImpersonationRequest';
178
179
  export * from './InstallID';
179
180
  export * from './IntentEnum';
180
181
  export * from './InvalidResponseActionEnum';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * authentik
3
+ * Making authentication simple.
4
+ *
5
+ * The version of the OpenAPI document: 2024.10.1
6
+ * Contact: hello@goauthentik.io
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ImpersonationRequest
16
+ */
17
+ export interface ImpersonationRequest {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ImpersonationRequest
22
+ */
23
+ reason: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ImpersonationRequest interface.
27
+ */
28
+ export declare function instanceOfImpersonationRequest(value: object): boolean;
29
+ export declare function ImpersonationRequestFromJSON(json: any): ImpersonationRequest;
30
+ export declare function ImpersonationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImpersonationRequest;
31
+ export declare function ImpersonationRequestToJSON(value?: ImpersonationRequest | null): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * authentik
6
+ * Making authentication simple.
7
+ *
8
+ * The version of the OpenAPI document: 2024.10.1
9
+ * Contact: hello@goauthentik.io
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ImpersonationRequestToJSON = exports.ImpersonationRequestFromJSONTyped = exports.ImpersonationRequestFromJSON = exports.instanceOfImpersonationRequest = void 0;
17
+ /**
18
+ * Check if a given object implements the ImpersonationRequest interface.
19
+ */
20
+ function instanceOfImpersonationRequest(value) {
21
+ let isInstance = true;
22
+ isInstance = isInstance && "reason" in value;
23
+ return isInstance;
24
+ }
25
+ exports.instanceOfImpersonationRequest = instanceOfImpersonationRequest;
26
+ function ImpersonationRequestFromJSON(json) {
27
+ return ImpersonationRequestFromJSONTyped(json, false);
28
+ }
29
+ exports.ImpersonationRequestFromJSON = ImpersonationRequestFromJSON;
30
+ function ImpersonationRequestFromJSONTyped(json, ignoreDiscriminator) {
31
+ if ((json === undefined) || (json === null)) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'reason': json['reason'],
36
+ };
37
+ }
38
+ exports.ImpersonationRequestFromJSONTyped = ImpersonationRequestFromJSONTyped;
39
+ function ImpersonationRequestToJSON(value) {
40
+ if (value === undefined) {
41
+ return undefined;
42
+ }
43
+ if (value === null) {
44
+ return null;
45
+ }
46
+ return {
47
+ 'reason': value.reason,
48
+ };
49
+ }
50
+ exports.ImpersonationRequestToJSON = ImpersonationRequestToJSON;
@@ -63,6 +63,12 @@ export interface PatchedSettingsRequest {
63
63
  * @memberof PatchedSettingsRequest
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof PatchedSettingsRequest
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -40,6 +40,7 @@ function PatchedSettingsRequestFromJSONTyped(json, ignoreDiscriminator) {
40
40
  'footerLinks': !(0, runtime_1.exists)(json, 'footer_links') ? undefined : json['footer_links'],
41
41
  'gdprCompliance': !(0, runtime_1.exists)(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
42
42
  'impersonation': !(0, runtime_1.exists)(json, 'impersonation') ? undefined : json['impersonation'],
43
+ 'impersonationRequireReason': !(0, runtime_1.exists)(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
43
44
  'defaultTokenDuration': !(0, runtime_1.exists)(json, 'default_token_duration') ? undefined : json['default_token_duration'],
44
45
  'defaultTokenLength': !(0, runtime_1.exists)(json, 'default_token_length') ? undefined : json['default_token_length'],
45
46
  };
@@ -61,6 +62,7 @@ function PatchedSettingsRequestToJSON(value) {
61
62
  'footer_links': value.footerLinks,
62
63
  'gdpr_compliance': value.gdprCompliance,
63
64
  'impersonation': value.impersonation,
65
+ 'impersonation_require_reason': value.impersonationRequireReason,
64
66
  'default_token_duration': value.defaultTokenDuration,
65
67
  'default_token_length': value.defaultTokenLength,
66
68
  };
@@ -63,6 +63,12 @@ export interface Settings {
63
63
  * @memberof Settings
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof Settings
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -40,6 +40,7 @@ function SettingsFromJSONTyped(json, ignoreDiscriminator) {
40
40
  'footerLinks': !(0, runtime_1.exists)(json, 'footer_links') ? undefined : json['footer_links'],
41
41
  'gdprCompliance': !(0, runtime_1.exists)(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
42
42
  'impersonation': !(0, runtime_1.exists)(json, 'impersonation') ? undefined : json['impersonation'],
43
+ 'impersonationRequireReason': !(0, runtime_1.exists)(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
43
44
  'defaultTokenDuration': !(0, runtime_1.exists)(json, 'default_token_duration') ? undefined : json['default_token_duration'],
44
45
  'defaultTokenLength': !(0, runtime_1.exists)(json, 'default_token_length') ? undefined : json['default_token_length'],
45
46
  };
@@ -61,6 +62,7 @@ function SettingsToJSON(value) {
61
62
  'footer_links': value.footerLinks,
62
63
  'gdpr_compliance': value.gdprCompliance,
63
64
  'impersonation': value.impersonation,
65
+ 'impersonation_require_reason': value.impersonationRequireReason,
64
66
  'default_token_duration': value.defaultTokenDuration,
65
67
  'default_token_length': value.defaultTokenLength,
66
68
  };
@@ -63,6 +63,12 @@ export interface SettingsRequest {
63
63
  * @memberof SettingsRequest
64
64
  */
65
65
  impersonation?: boolean;
66
+ /**
67
+ * Require administrators to provide a reason for impersonating a user.
68
+ * @type {boolean}
69
+ * @memberof SettingsRequest
70
+ */
71
+ impersonationRequireReason?: boolean;
66
72
  /**
67
73
  * Default token duration
68
74
  * @type {string}
@@ -40,6 +40,7 @@ function SettingsRequestFromJSONTyped(json, ignoreDiscriminator) {
40
40
  'footerLinks': !(0, runtime_1.exists)(json, 'footer_links') ? undefined : json['footer_links'],
41
41
  'gdprCompliance': !(0, runtime_1.exists)(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
42
42
  'impersonation': !(0, runtime_1.exists)(json, 'impersonation') ? undefined : json['impersonation'],
43
+ 'impersonationRequireReason': !(0, runtime_1.exists)(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
43
44
  'defaultTokenDuration': !(0, runtime_1.exists)(json, 'default_token_duration') ? undefined : json['default_token_duration'],
44
45
  'defaultTokenLength': !(0, runtime_1.exists)(json, 'default_token_length') ? undefined : json['default_token_length'],
45
46
  };
@@ -61,6 +62,7 @@ function SettingsRequestToJSON(value) {
61
62
  'footer_links': value.footerLinks,
62
63
  'gdpr_compliance': value.gdprCompliance,
63
64
  'impersonation': value.impersonation,
65
+ 'impersonation_require_reason': value.impersonationRequireReason,
64
66
  'default_token_duration': value.defaultTokenDuration,
65
67
  'default_token_length': value.defaultTokenLength,
66
68
  };
@@ -173,6 +173,7 @@ export * from './IdentificationChallenge';
173
173
  export * from './IdentificationChallengeResponseRequest';
174
174
  export * from './IdentificationStage';
175
175
  export * from './IdentificationStageRequest';
176
+ export * from './ImpersonationRequest';
176
177
  export * from './InstallID';
177
178
  export * from './IntentEnum';
178
179
  export * from './InvalidResponseActionEnum';
@@ -191,6 +191,7 @@ __exportStar(require("./IdentificationChallenge"), exports);
191
191
  __exportStar(require("./IdentificationChallengeResponseRequest"), exports);
192
192
  __exportStar(require("./IdentificationStage"), exports);
193
193
  __exportStar(require("./IdentificationStageRequest"), exports);
194
+ __exportStar(require("./ImpersonationRequest"), exports);
194
195
  __exportStar(require("./InstallID"), exports);
195
196
  __exportStar(require("./IntentEnum"), exports);
196
197
  __exportStar(require("./InvalidResponseActionEnum"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goauthentik/api",
3
- "version": "2024.10.1-1731327664",
3
+ "version": "2024.10.1-1731418991",
4
4
  "description": "OpenAPI client for @goauthentik/api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -26,6 +26,7 @@ import type {
26
26
  GenericError,
27
27
  Group,
28
28
  GroupRequest,
29
+ ImpersonationRequest,
29
30
  Link,
30
31
  PaginatedApplicationList,
31
32
  PaginatedAuthenticatedSessionList,
@@ -82,6 +83,8 @@ import {
82
83
  GroupToJSON,
83
84
  GroupRequestFromJSON,
84
85
  GroupRequestToJSON,
86
+ ImpersonationRequestFromJSON,
87
+ ImpersonationRequestToJSON,
85
88
  LinkFromJSON,
86
89
  LinkToJSON,
87
90
  PaginatedApplicationListFromJSON,
@@ -412,6 +415,7 @@ export interface CoreUsersDestroyRequest {
412
415
 
413
416
  export interface CoreUsersImpersonateCreateRequest {
414
417
  id: number;
418
+ impersonationRequest: ImpersonationRequest;
415
419
  }
416
420
 
417
421
  export interface CoreUsersListRequest {
@@ -2650,10 +2654,16 @@ export class CoreApi extends runtime.BaseAPI {
2650
2654
  throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling coreUsersImpersonateCreate.');
2651
2655
  }
2652
2656
 
2657
+ if (requestParameters.impersonationRequest === null || requestParameters.impersonationRequest === undefined) {
2658
+ throw new runtime.RequiredError('impersonationRequest','Required parameter requestParameters.impersonationRequest was null or undefined when calling coreUsersImpersonateCreate.');
2659
+ }
2660
+
2653
2661
  const queryParameters: any = {};
2654
2662
 
2655
2663
  const headerParameters: runtime.HTTPHeaders = {};
2656
2664
 
2665
+ headerParameters['Content-Type'] = 'application/json';
2666
+
2657
2667
  if (this.configuration && this.configuration.accessToken) {
2658
2668
  const token = this.configuration.accessToken;
2659
2669
  const tokenString = await token("authentik", []);
@@ -2667,6 +2677,7 @@ export class CoreApi extends runtime.BaseAPI {
2667
2677
  method: 'POST',
2668
2678
  headers: headerParameters,
2669
2679
  query: queryParameters,
2680
+ body: ImpersonationRequestToJSON(requestParameters.impersonationRequest),
2670
2681
  }, initOverrides);
2671
2682
 
2672
2683
  return new runtime.VoidApiResponse(response);
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * authentik
5
+ * Making authentication simple.
6
+ *
7
+ * The version of the OpenAPI document: 2024.10.1
8
+ * Contact: hello@goauthentik.io
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ImpersonationRequest
20
+ */
21
+ export interface ImpersonationRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ImpersonationRequest
26
+ */
27
+ reason: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ImpersonationRequest interface.
32
+ */
33
+ export function instanceOfImpersonationRequest(value: object): boolean {
34
+ let isInstance = true;
35
+ isInstance = isInstance && "reason" in value;
36
+
37
+ return isInstance;
38
+ }
39
+
40
+ export function ImpersonationRequestFromJSON(json: any): ImpersonationRequest {
41
+ return ImpersonationRequestFromJSONTyped(json, false);
42
+ }
43
+
44
+ export function ImpersonationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImpersonationRequest {
45
+ if ((json === undefined) || (json === null)) {
46
+ return json;
47
+ }
48
+ return {
49
+
50
+ 'reason': json['reason'],
51
+ };
52
+ }
53
+
54
+ export function ImpersonationRequestToJSON(value?: ImpersonationRequest | null): any {
55
+ if (value === undefined) {
56
+ return undefined;
57
+ }
58
+ if (value === null) {
59
+ return null;
60
+ }
61
+ return {
62
+
63
+ 'reason': value.reason,
64
+ };
65
+ }
66
+
@@ -67,6 +67,12 @@ export interface PatchedSettingsRequest {
67
67
  * @memberof PatchedSettingsRequest
68
68
  */
69
69
  impersonation?: boolean;
70
+ /**
71
+ * Require administrators to provide a reason for impersonating a user.
72
+ * @type {boolean}
73
+ * @memberof PatchedSettingsRequest
74
+ */
75
+ impersonationRequireReason?: boolean;
70
76
  /**
71
77
  * Default token duration
72
78
  * @type {string}
@@ -108,6 +114,7 @@ export function PatchedSettingsRequestFromJSONTyped(json: any, ignoreDiscriminat
108
114
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
109
115
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
110
116
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
117
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
111
118
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
112
119
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
113
120
  };
@@ -130,6 +137,7 @@ export function PatchedSettingsRequestToJSON(value?: PatchedSettingsRequest | nu
130
137
  'footer_links': value.footerLinks,
131
138
  'gdpr_compliance': value.gdprCompliance,
132
139
  'impersonation': value.impersonation,
140
+ 'impersonation_require_reason': value.impersonationRequireReason,
133
141
  'default_token_duration': value.defaultTokenDuration,
134
142
  'default_token_length': value.defaultTokenLength,
135
143
  };
@@ -67,6 +67,12 @@ export interface Settings {
67
67
  * @memberof Settings
68
68
  */
69
69
  impersonation?: boolean;
70
+ /**
71
+ * Require administrators to provide a reason for impersonating a user.
72
+ * @type {boolean}
73
+ * @memberof Settings
74
+ */
75
+ impersonationRequireReason?: boolean;
70
76
  /**
71
77
  * Default token duration
72
78
  * @type {string}
@@ -108,6 +114,7 @@ export function SettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean):
108
114
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
109
115
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
110
116
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
117
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
111
118
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
112
119
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
113
120
  };
@@ -130,6 +137,7 @@ export function SettingsToJSON(value?: Settings | null): any {
130
137
  'footer_links': value.footerLinks,
131
138
  'gdpr_compliance': value.gdprCompliance,
132
139
  'impersonation': value.impersonation,
140
+ 'impersonation_require_reason': value.impersonationRequireReason,
133
141
  'default_token_duration': value.defaultTokenDuration,
134
142
  'default_token_length': value.defaultTokenLength,
135
143
  };
@@ -67,6 +67,12 @@ export interface SettingsRequest {
67
67
  * @memberof SettingsRequest
68
68
  */
69
69
  impersonation?: boolean;
70
+ /**
71
+ * Require administrators to provide a reason for impersonating a user.
72
+ * @type {boolean}
73
+ * @memberof SettingsRequest
74
+ */
75
+ impersonationRequireReason?: boolean;
70
76
  /**
71
77
  * Default token duration
72
78
  * @type {string}
@@ -108,6 +114,7 @@ export function SettingsRequestFromJSONTyped(json: any, ignoreDiscriminator: boo
108
114
  'footerLinks': !exists(json, 'footer_links') ? undefined : json['footer_links'],
109
115
  'gdprCompliance': !exists(json, 'gdpr_compliance') ? undefined : json['gdpr_compliance'],
110
116
  'impersonation': !exists(json, 'impersonation') ? undefined : json['impersonation'],
117
+ 'impersonationRequireReason': !exists(json, 'impersonation_require_reason') ? undefined : json['impersonation_require_reason'],
111
118
  'defaultTokenDuration': !exists(json, 'default_token_duration') ? undefined : json['default_token_duration'],
112
119
  'defaultTokenLength': !exists(json, 'default_token_length') ? undefined : json['default_token_length'],
113
120
  };
@@ -130,6 +137,7 @@ export function SettingsRequestToJSON(value?: SettingsRequest | null): any {
130
137
  'footer_links': value.footerLinks,
131
138
  'gdpr_compliance': value.gdprCompliance,
132
139
  'impersonation': value.impersonation,
140
+ 'impersonation_require_reason': value.impersonationRequireReason,
133
141
  'default_token_duration': value.defaultTokenDuration,
134
142
  'default_token_length': value.defaultTokenLength,
135
143
  };
@@ -175,6 +175,7 @@ export * from './IdentificationChallenge';
175
175
  export * from './IdentificationChallengeResponseRequest';
176
176
  export * from './IdentificationStage';
177
177
  export * from './IdentificationStageRequest';
178
+ export * from './ImpersonationRequest';
178
179
  export * from './InstallID';
179
180
  export * from './IntentEnum';
180
181
  export * from './InvalidResponseActionEnum';