Skip to content

Commit bcbe030

Browse files
committed
fix security alerts in resteasy/eap and typescript/angular
1 parent 1964898 commit bcbe030

File tree

24 files changed

+1518
-2208
lines changed

24 files changed

+1518
-2208
lines changed

bin/typescript-angular-v5-petstore-with-npm.1.sh

100644100755
File mode changed.

bin/typescript-angular-v6-petstore-with-npm.sh

100644100755
File mode changed.

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
175175
// Libraries generated with v2.x of ng-packagr will ship with AoT metadata in v4, which is intended for Angular v5 (and Angular v6).
176176
additionalProperties.put("useOldNgPackagr", !ngVersion.atLeast("5.0.0"));
177177

178+
additionalProperties.put("supportedNgVersion", ngVersion.atLeast("6.0.0"));
179+
178180
//Files for building our lib
179181
supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json"));
180182
supportingFiles.add(new SupportingFile("typings.mustache", getIndexDirectory(), "typings.json"));

modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ dependencies {
1919
providedCompile 'javax.validation:validation-api:1.1.0.Final'
2020
{{/useBeanValidation}}
2121
{{^java8}}
22-
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3'
22+
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9'
2323
compile 'joda-time:joda-time:2.7'
2424
{{/java8}}
2525
{{#java8}}
26-
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.3'
26+
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9'
2727
{{/java8}}
2828
testCompile 'junit:junit:4.12',
2929
'org.hamcrest:hamcrest-core:1.3'

modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,30 +187,30 @@
187187
<dependency>
188188
<groupId>com.fasterxml.jackson.datatype</groupId>
189189
<artifactId>jackson-datatype-joda</artifactId>
190-
<version>2.6.3</version>
190+
<version>2.9.9</version>
191191
</dependency>
192192
{{/java8}}
193193
{{#java8}}
194194
<dependency>
195195
<groupId>com.fasterxml.jackson.datatype</groupId>
196196
<artifactId>jackson-datatype-jsr310</artifactId>
197-
<version>2.6.3</version>
197+
<version>2.9.9</version>
198198
</dependency>
199199
{{/java8}}
200200
<dependency>
201201
<groupId>com.fasterxml.jackson.core</groupId>
202202
<artifactId>jackson-databind</artifactId>
203-
<version>2.6.3</version>
203+
<version>2.9.9</version>
204204
</dependency>
205205
<dependency>
206206
<groupId>com.fasterxml.jackson.core</groupId>
207207
<artifactId>jackson-core</artifactId>
208-
<version>2.6.3</version>
208+
<version>2.9.9</version>
209209
</dependency>
210210
<dependency>
211211
<groupId>com.fasterxml.jackson.core</groupId>
212212
<artifactId>jackson-annotations</artifactId>
213-
<version>2.6.3</version>
213+
<version>2.9.9</version>
214214
</dependency>
215215
<dependency>
216216
<groupId>org.apache.httpcomponents</groupId>

modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@angular/compiler": "^{{ngVersion}}",
2929
"core-js": "^2.4.0",
3030
"reflect-metadata": "^0.1.3",
31-
"rxjs": "{{#useRxJS6}}^6.1.0{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
31+
"rxjs": "{{#useRxJS6}}{{#supportedNgVersion}}~6.3.3{{/supportedNgVersion}}{{^supportedNgVersion}}^6.1.0{{/supportedNgVersion}}{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
3232
"zone.js": "^0.7.6"
3333
},
3434
"devDependencies": {
@@ -38,9 +38,9 @@
3838
"@angular/common": "^{{ngVersion}}",
3939
"@angular/compiler": "^{{ngVersion}}",
4040
"@angular/platform-browser": "^{{ngVersion}}",{{#useNgPackagr}}
41-
"ng-packagr": {{#useOldNgPackagr}}"^1.6.0"{{/useOldNgPackagr}}{{^useOldNgPackagr}}"^2.4.1"{{/useOldNgPackagr}},{{/useNgPackagr}}
41+
"ng-packagr": {{#useOldNgPackagr}}"^1.6.0"{{/useOldNgPackagr}}{{^useOldNgPackagr}}{{#supportedNgVersion}}"5.3.0"{{/supportedNgVersion}}{{^supportedNgVersion}}"^2.4.1"{{/supportedNgVersion}}{{/useOldNgPackagr}},{{/useNgPackagr}}
4242
"reflect-metadata": "^0.1.3",
43-
"rxjs": "{{#useRxJS6}}^6.1.0{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
43+
"rxjs": "{{#useRxJS6}}{{#supportedNgVersion}}~6.3.3{{/supportedNgVersion}}{{^supportedNgVersion}}^6.1.0{{/supportedNgVersion}}{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
4444
"zone.js": "^0.7.6",
4545
"typescript": ">=2.1.5 <2.8"
4646
}{{#npmRepository}},{{/npmRepository}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3-SNAPSHOT
1+
2.4.8-SNAPSHOT

samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class PetService {
6868
public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
6969
public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
7070
public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
71+
7172
if (body === null || body === undefined) {
7273
throw new Error('Required parameter body was null or undefined when calling addPet.');
7374
}
@@ -125,10 +126,12 @@ export class PetService {
125126
public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
126127
public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
127128
public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
129+
128130
if (petId === null || petId === undefined) {
129131
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
130132
}
131133

134+
132135
let headers = this.defaultHeaders;
133136
if (apiKey !== undefined && apiKey !== null) {
134137
headers = headers.set('api_key', String(apiKey));
@@ -177,6 +180,7 @@ export class PetService {
177180
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
178181
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
179182
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
183+
180184
if (status === null || status === undefined) {
181185
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
182186
}
@@ -232,6 +236,7 @@ export class PetService {
232236
public findPetsByTags(tags: Array<string>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
233237
public findPetsByTags(tags: Array<string>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
234238
public findPetsByTags(tags: Array<string>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
239+
235240
if (tags === null || tags === undefined) {
236241
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
237242
}
@@ -287,6 +292,7 @@ export class PetService {
287292
public getPetById(petId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Pet>>;
288293
public getPetById(petId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Pet>>;
289294
public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
295+
290296
if (petId === null || petId === undefined) {
291297
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
292298
}
@@ -333,6 +339,7 @@ export class PetService {
333339
public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
334340
public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
335341
public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
342+
336343
if (body === null || body === undefined) {
337344
throw new Error('Required parameter body was null or undefined when calling updatePet.');
338345
}
@@ -391,10 +398,13 @@ export class PetService {
391398
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
392399
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
393400
public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
401+
394402
if (petId === null || petId === undefined) {
395403
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
396404
}
397405

406+
407+
398408
let headers = this.defaultHeaders;
399409

400410
// authentication (petstore_auth) required
@@ -462,10 +472,13 @@ export class PetService {
462472
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<ApiResponse>>;
463473
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<ApiResponse>>;
464474
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
475+
465476
if (petId === null || petId === undefined) {
466477
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
467478
}
468479

480+
481+
469482
let headers = this.defaultHeaders;
470483

471484
// authentication (petstore_auth) required

samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class StoreService {
6767
public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
6868
public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
6969
public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
70+
7071
if (orderId === null || orderId === undefined) {
7172
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
7273
}
@@ -149,6 +150,7 @@ export class StoreService {
149150
public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
150151
public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
151152
public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
153+
152154
if (orderId === null || orderId === undefined) {
153155
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
154156
}
@@ -190,6 +192,7 @@ export class StoreService {
190192
public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
191193
public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
192194
public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
195+
193196
if (body === null || body === undefined) {
194197
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
195198
}

samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class UserService {
6767
public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
6868
public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
6969
public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
70+
7071
if (body === null || body === undefined) {
7172
throw new Error('Required parameter body was null or undefined when calling createUser.');
7273
}
@@ -113,6 +114,7 @@ export class UserService {
113114
public createUsersWithArrayInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
114115
public createUsersWithArrayInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
115116
public createUsersWithArrayInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
117+
116118
if (body === null || body === undefined) {
117119
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
118120
}
@@ -159,6 +161,7 @@ export class UserService {
159161
public createUsersWithListInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
160162
public createUsersWithListInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
161163
public createUsersWithListInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
164+
162165
if (body === null || body === undefined) {
163166
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
164167
}
@@ -205,6 +208,7 @@ export class UserService {
205208
public deleteUser(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
206209
public deleteUser(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
207210
public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
211+
208212
if (username === null || username === undefined) {
209213
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
210214
}
@@ -246,6 +250,7 @@ export class UserService {
246250
public getUserByName(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<User>>;
247251
public getUserByName(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<User>>;
248252
public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
253+
249254
if (username === null || username === undefined) {
250255
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
251256
}
@@ -288,9 +293,11 @@ export class UserService {
288293
public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<string>>;
289294
public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<string>>;
290295
public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
296+
291297
if (username === null || username === undefined) {
292298
throw new Error('Required parameter username was null or undefined when calling loginUser.');
293299
}
300+
294301
if (password === null || password === undefined) {
295302
throw new Error('Required parameter password was null or undefined when calling loginUser.');
296303
}
@@ -379,9 +386,11 @@ export class UserService {
379386
public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
380387
public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
381388
public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
389+
382390
if (username === null || username === undefined) {
383391
throw new Error('Required parameter username was null or undefined when calling updateUser.');
384392
}
393+
385394
if (body === null || body === undefined) {
386395
throw new Error('Required parameter body was null or undefined when calling updateUser.');
387396
}

0 commit comments

Comments
 (0)