Skip to content

Commit 29bbed7

Browse files
api auth and multi factor auth changes
1 parent 6e1a521 commit 29bbed7

File tree

2 files changed

+111
-93
lines changed

2 files changed

+111
-93
lines changed

api/defaultApi.ts

Lines changed: 62 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ export class DefaultApi {
11871187
authorization: string,
11881188
createAuthorizationServerRequest: CreateAuthorizationServerRequest,
11891189
options: { headers: { [name: string]: string } } = { headers: {} }
1190-
): Promise<{ response: http.IncomingMessage; body: Id }> {
1190+
): Promise<{ response: http.IncomingMessage; body: { id: string } }> {
11911191
const localVarPath = this.basePath + "/api/2/api_authorizations";
11921192
let localVarQueryParameters: any = {};
11931193
let localVarHeaderParams: any = (<any>Object).assign(
@@ -1201,7 +1201,6 @@ export class DefaultApi {
12011201
} else {
12021202
localVarHeaderParams.Accept = produces.join(",");
12031203
}
1204-
let localVarFormParams: any = {};
12051204

12061205
// verify required parameter 'authorization' is not null or undefined
12071206
if (authorization === null || authorization === undefined) {
@@ -1226,9 +1225,7 @@ export class DefaultApi {
12261225
);
12271226
(<any>Object).assign(localVarHeaderParams, options.headers);
12281227

1229-
let localVarUseFormData = false;
1230-
1231-
let localVarRequestOptions: localVarRequest.Options = {
1228+
const localVarRequestOptions: localVarRequest.Options = {
12321229
method: "POST",
12331230
qs: localVarQueryParameters,
12341231
headers: localVarHeaderParams,
@@ -1237,7 +1234,7 @@ export class DefaultApi {
12371234
json: true,
12381235
body: ObjectSerializer.serialize(
12391236
createAuthorizationServerRequest,
1240-
"CreateAuthorizationServerRequest"
1237+
"object"
12411238
),
12421239
};
12431240

@@ -1254,35 +1251,30 @@ export class DefaultApi {
12541251
}
12551252

12561253
return interceptorPromise.then(() => {
1257-
if (Object.keys(localVarFormParams).length) {
1258-
if (localVarUseFormData) {
1259-
(<any>localVarRequestOptions).formData = localVarFormParams;
1260-
} else {
1261-
localVarRequestOptions.form = localVarFormParams;
1262-
}
1263-
}
1264-
return new Promise<{ response: http.IncomingMessage; body: Id }>(
1265-
(resolve, reject) => {
1266-
localVarRequest(localVarRequestOptions, (error, response, body) => {
1267-
if (error) {
1268-
reject(error);
1254+
return new Promise<{
1255+
response: http.IncomingMessage;
1256+
body: { id: string };
1257+
}>((resolve, reject) => {
1258+
localVarRequest(localVarRequestOptions, (error, response, body) => {
1259+
if (error) {
1260+
reject(error);
1261+
} else {
1262+
if (
1263+
response.statusCode &&
1264+
response.statusCode >= 200 &&
1265+
response.statusCode <= 299
1266+
) {
1267+
body = ObjectSerializer.deserialize(body, "object");
1268+
resolve({ response: response, body: body });
12691269
} else {
1270-
if (
1271-
response.statusCode &&
1272-
response.statusCode >= 200 &&
1273-
response.statusCode <= 299
1274-
) {
1275-
body = ObjectSerializer.deserialize(body, "Id");
1276-
resolve({ response: response, body: body });
1277-
} else {
1278-
reject(new HttpError(response, body, response.statusCode));
1279-
}
1270+
reject(new HttpError(response, body, response.statusCode));
12801271
}
1281-
});
1282-
}
1283-
);
1272+
}
1273+
});
1274+
});
12841275
});
12851276
}
1277+
12861278
/**
12871279
*
12881280
* @param authorization
@@ -3482,7 +3474,7 @@ export class DefaultApi {
34823474
options: { headers: { [name: string]: string } } = { headers: {} }
34833475
): Promise<{
34843476
response: http.IncomingMessage;
3485-
body: Array<Array<FactorInner>>;
3477+
body: FactorInner;
34863478
}> {
34873479
const localVarPath =
34883480
this.basePath +
@@ -3568,7 +3560,7 @@ export class DefaultApi {
35683560
}
35693561
return new Promise<{
35703562
response: http.IncomingMessage;
3571-
body: Array<Array<FactorInner>>;
3563+
body: FactorInner;
35723564
}>((resolve, reject) => {
35733565
localVarRequest(localVarRequestOptions, (error, response, body) => {
35743566
if (error) {
@@ -3579,10 +3571,7 @@ export class DefaultApi {
35793571
response.statusCode >= 200 &&
35803572
response.statusCode <= 299
35813573
) {
3582-
body = ObjectSerializer.deserialize(
3583-
body,
3584-
"Array<Array<FactorInner>>"
3585-
);
3574+
body = ObjectSerializer.deserialize(body, "FactorInner");
35863575
resolve({ response: response, body: body });
35873576
} else {
35883577
reject(new HttpError(response, body, response.statusCode));
@@ -3605,7 +3594,7 @@ export class DefaultApi {
36053594
response: http.IncomingMessage;
36063595
body: GenerateMfaToken200Response;
36073596
}> {
3608-
const localVarPath = this.basePath + "/api/2/mfs/users/{user_id}/mfa_token";
3597+
const localVarPath = this.basePath + "/api/2/mfa/users/{user_id}/mfa_token";
36093598
let localVarQueryParameters: any = {};
36103599
let localVarHeaderParams: any = (<any>Object).assign(
36113600
{},
@@ -11118,7 +11107,7 @@ export class DefaultApi {
1111811107
registrationId: number,
1111911108
verifyEnrollmentRequest: VerifyEnrollmentRequest,
1112011109
options: { headers: { [name: string]: string } } = { headers: {} }
11121-
): Promise<{ response: http.IncomingMessage; body: Array<Registration> }> {
11110+
): Promise<{ response: http.IncomingMessage; body: Registration }> {
1112211111
const localVarPath =
1112311112
this.basePath +
1112411113
"/api/2/mfa/users/{user_id}/registrations/{registration_id}"
@@ -11215,7 +11204,7 @@ export class DefaultApi {
1121511204
}
1121611205
return new Promise<{
1121711206
response: http.IncomingMessage;
11218-
body: Array<Registration>;
11207+
body: Registration;
1121911208
}>((resolve, reject) => {
1122011209
localVarRequest(localVarRequestOptions, (error, response, body) => {
1122111210
if (error) {
@@ -11226,7 +11215,7 @@ export class DefaultApi {
1122611215
response.statusCode >= 200 &&
1122711216
response.statusCode <= 299
1122811217
) {
11229-
body = ObjectSerializer.deserialize(body, "Array<Registration>");
11218+
body = ObjectSerializer.deserialize(body, "Registration");
1123011219
resolve({ response: response, body: body });
1123111220
} else {
1123211221
reject(new HttpError(response, body, response.statusCode));
@@ -11247,7 +11236,7 @@ export class DefaultApi {
1124711236
userId: number,
1124811237
registrationId: number,
1124911238
options: { headers: { [name: string]: string } } = { headers: {} }
11250-
): Promise<{ response: http.IncomingMessage; body: Array<Registration> }> {
11239+
): Promise<{ response: http.IncomingMessage; body: Registration }> {
1125111240
const localVarPath =
1125211241
this.basePath +
1125311242
"/api/2/mfa/users/{user_id}/registrations/{registration_id}"
@@ -11330,7 +11319,7 @@ export class DefaultApi {
1133011319
}
1133111320
return new Promise<{
1133211321
response: http.IncomingMessage;
11333-
body: Array<Registration>;
11322+
body: Registration;
1133411323
}>((resolve, reject) => {
1133511324
localVarRequest(localVarRequestOptions, (error, response, body) => {
1133611325
if (error) {
@@ -11341,7 +11330,7 @@ export class DefaultApi {
1134111330
response.statusCode >= 200 &&
1134211331
response.statusCode <= 299
1134311332
) {
11344-
body = ObjectSerializer.deserialize(body, "Array<Registration>");
11333+
body = ObjectSerializer.deserialize(body, "Registration");
1134511334
resolve({ response: response, body: body });
1134611335
} else {
1134711336
reject(new HttpError(response, body, response.statusCode));
@@ -11364,7 +11353,10 @@ export class DefaultApi {
1136411353
verificationId: number,
1136511354
verifyFactorRequest: VerifyFactorRequest,
1136611355
options: { headers: { [name: string]: string } } = { headers: {} }
11367-
): Promise<{ response: http.IncomingMessage; body: Status2 }> {
11356+
): Promise<{
11357+
response: http.IncomingMessage;
11358+
body: VerifyFactorVoice200ResponseInner;
11359+
}> {
1136811360
const localVarPath =
1136911361
this.basePath +
1137011362
"/api/2/mfa/users/{user_id}/verifications/{verification_id}"
@@ -11456,26 +11448,30 @@ export class DefaultApi {
1145611448
localVarRequestOptions.form = localVarFormParams;
1145711449
}
1145811450
}
11459-
return new Promise<{ response: http.IncomingMessage; body: Status2 }>(
11460-
(resolve, reject) => {
11461-
localVarRequest(localVarRequestOptions, (error, response, body) => {
11462-
if (error) {
11463-
reject(error);
11451+
return new Promise<{
11452+
response: http.IncomingMessage;
11453+
body: VerifyFactorVoice200ResponseInner;
11454+
}>((resolve, reject) => {
11455+
localVarRequest(localVarRequestOptions, (error, response, body) => {
11456+
if (error) {
11457+
reject(error);
11458+
} else {
11459+
if (
11460+
response.statusCode &&
11461+
response.statusCode >= 200 &&
11462+
response.statusCode <= 299
11463+
) {
11464+
body = ObjectSerializer.deserialize(
11465+
body,
11466+
"VerifyFactorVoice200ResponseInner"
11467+
);
11468+
resolve({ response: response, body: body });
1146411469
} else {
11465-
if (
11466-
response.statusCode &&
11467-
response.statusCode >= 200 &&
11468-
response.statusCode <= 299
11469-
) {
11470-
body = ObjectSerializer.deserialize(body, "Status2");
11471-
resolve({ response: response, body: body });
11472-
} else {
11473-
reject(new HttpError(response, body, response.statusCode));
11474-
}
11470+
reject(new HttpError(response, body, response.statusCode));
1147511471
}
11476-
});
11477-
}
11478-
);
11472+
}
11473+
});
11474+
});
1147911475
});
1148011476
}
1148111477
/**
@@ -11603,7 +11599,7 @@ export class DefaultApi {
1160311599
options: { headers: { [name: string]: string } } = { headers: {} }
1160411600
): Promise<{
1160511601
response: http.IncomingMessage;
11606-
body: Array<VerifyFactorVoice200ResponseInner>;
11602+
body: VerifyFactorVoice200ResponseInner;
1160711603
}> {
1160811604
const localVarPath =
1160911605
this.basePath +
@@ -11687,7 +11683,7 @@ export class DefaultApi {
1168711683
}
1168811684
return new Promise<{
1168911685
response: http.IncomingMessage;
11690-
body: Array<VerifyFactorVoice200ResponseInner>;
11686+
body: VerifyFactorVoice200ResponseInner;
1169111687
}>((resolve, reject) => {
1169211688
localVarRequest(localVarRequestOptions, (error, response, body) => {
1169311689
if (error) {
@@ -11700,7 +11696,7 @@ export class DefaultApi {
1170011696
) {
1170111697
body = ObjectSerializer.deserialize(
1170211698
body,
11703-
"Array<VerifyFactorVoice200ResponseInner>"
11699+
"VerifyFactorVoice200ResponseInner"
1170411700
);
1170511701
resolve({ response: response, body: body });
1170611702
} else {

model/createAuthorizationServerRequest.ts

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,64 @@
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
55
* The version of the OpenAPI document: 3.0.0-alpha.1
6-
*
6+
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
99
* https://openapi-generator.tech
1010
* Do not edit the class manually.
1111
*/
1212

13-
import { RequestFile } from './models';
14-
import { AuthServerConfiguration } from './authServerConfiguration';
13+
import { AuthServerConfiguration } from "./authServerConfiguration";
14+
import { RequestFile } from "./models";
1515

1616
export class CreateAuthorizationServerRequest {
17-
'name'?: string;
18-
'description'?: string;
19-
'configuration'?: AuthServerConfiguration;
17+
"name"?: string;
18+
"description"?: string;
19+
"resource"?: string;
20+
"audiences"?: Array<string>;
21+
"access_token_expiration_minutes"?: number;
22+
"refresh_token_expiration_minutes"?: number;
2023

21-
static discriminator: string | undefined = undefined;
24+
static discriminator: string | undefined = undefined;
2225

23-
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
24-
{
25-
"name": "name",
26-
"baseName": "name",
27-
"type": "string"
28-
},
29-
{
30-
"name": "description",
31-
"baseName": "description",
32-
"type": "string"
33-
},
34-
{
35-
"name": "configuration",
36-
"baseName": "configuration",
37-
"type": "AuthServerConfiguration"
38-
} ];
26+
static attributeTypeMap: Array<{
27+
name: string;
28+
baseName: string;
29+
type: string;
30+
}> = [
31+
{
32+
name: "name",
33+
baseName: "name",
34+
type: "string",
35+
},
36+
{
37+
name: "description",
38+
baseName: "description",
39+
type: "string",
40+
},
41+
{
42+
name: "resource",
43+
baseName: "resource",
44+
type: "string",
45+
},
46+
{
47+
name: "audiences",
48+
baseName: "audiences",
49+
type: "Array<string>",
50+
},
51+
{
52+
name: "access_token_expiration_minutes",
53+
baseName: "access_token_expiration_minutes",
54+
type: "number",
55+
},
56+
{
57+
name: "refresh_token_expiration_minutes",
58+
baseName: "refresh_token_expiration_minutes",
59+
type: "number",
60+
},
61+
];
3962

40-
static getAttributeTypeMap() {
41-
return CreateAuthorizationServerRequest.attributeTypeMap;
42-
}
63+
static getAttributeTypeMap() {
64+
return CreateAuthorizationServerRequest.attributeTypeMap;
65+
}
4366
}
44-

0 commit comments

Comments
 (0)