Skip to content

Commit d54e85c

Browse files
Update multi-point-vpn API spec (#38)
* Update multi-point-vpn API spec Fix typos and improve schemas/consistency in multi-point-vpn spec. * Add validation constraints to API schema Update multi-point-vpn OpenAPI definition to improve input validation: * Tighten field validation: uri->pattern, add ip Replace loose 'format: uri' validation with a stricter regex pattern ('^[A-Za-z0-9\\-_.]{1,2048}$') for the resource URL and connection location fields, while keeping the maxLength constraint. Also add 'format: ip' to cloudGatewayIp to explicitly mark it as an IP address. These changes tighten input validation in code/API_definitions/multi-point-vpn.yaml.
1 parent d4ea181 commit d54e85c

1 file changed

Lines changed: 39 additions & 16 deletions

File tree

code/API_definitions/multi-point-vpn.yaml

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ info:
2020
2121
* Physical Location Physical location of the Customer Edge Router.
2222
23-
NOTE- The private physical link between CE and cloud PE is default deployed for one click calling, otherwise it is required to install the physical link, which is out of the scope of this API.
23+
NOTE: The private physical link between CE and cloud PE is default deployed for one click calling, otherwise it is required to install the physical link, which is out of the scope of this API.
2424
2525
# Available scopes
2626
@@ -106,6 +106,12 @@ paths:
106106
headers:
107107
x-correlator:
108108
$ref: "#/components/headers/x-correlator"
109+
Location:
110+
description: URL of the newly created network resource
111+
schema:
112+
type: string
113+
pattern: '^[A-Za-z0-9\\-_.]{1,2048}$'
114+
maxLength: 2048
109115
content:
110116
application/json:
111117
schema:
@@ -126,7 +132,7 @@ paths:
126132
tags:
127133
- Network
128134
summary: To update a multipoint virtual private network
129-
description: Update a new multipoint virtual private network
135+
description: Update a multipoint virtual private network
130136
operationId: updateNetwork
131137
security:
132138
- openId:
@@ -137,7 +143,7 @@ paths:
137143
requestBody:
138144
required: true
139145
content:
140-
application/json:
146+
application/merge-patch+json:
141147
schema:
142148
$ref: "#/components/schemas/NetworkUpdate"
143149
examples:
@@ -171,7 +177,7 @@ paths:
171177
- Network
172178
summary: retrieve multipoint virtual private network details
173179
description: Retrieve multipoint virtual private network details
174-
operationId: getVpnConnection
180+
operationId: getNetwork
175181
security:
176182
- openId:
177183
- multi-point-vpn:network:read
@@ -215,7 +221,7 @@ paths:
215221
- $ref: '#/components/parameters/serviceId'
216222
responses:
217223
"202":
218-
description: deleteVPNConnectionResponse
224+
description: Network deletion request accepted. The deletion is processed asynchronously; the resource will be removed once complete.
219225
headers:
220226
x-correlator:
221227
$ref: "#/components/headers/x-correlator"
@@ -297,6 +303,7 @@ components:
297303
schema:
298304
type: string
299305
maxLength: 255
306+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
300307
in: path
301308
description: Identifier of the Resource
302309
schemas:
@@ -313,6 +320,7 @@ components:
313320
type: string
314321
maxLength: 3
315322
description: Currency code (ISO 4217 format, e.g., GBP, USD, EUR)
323+
pattern: '^[A-Z]{3}$'
316324
AssessmentRequest:
317325
description: Base schema for all areas
318326
type: object
@@ -329,7 +337,7 @@ components:
329337
guaranteeBandwidth:
330338
type: integer
331339
format: int32
332-
description: Guarantee Bandwidth (Mps)
340+
description: Guarantee Bandwidth (Mbps)
333341
minimum: 1
334342
maximum: 1000000
335343
duration:
@@ -338,7 +346,7 @@ components:
338346
type: object
339347
description: Assessment Result
340348
properties:
341-
waitdays:
349+
waitDays:
342350
type: integer
343351
format: int32
344352
description: the waiting-days until the vpn can be offered
@@ -360,6 +368,7 @@ components:
360368
id:
361369
type: string
362370
maxLength: 255
371+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
363372
description: Unique identifier for the connection
364373
customerEdge:
365374
$ref: '#/components/schemas/EdgeConnection'
@@ -377,7 +386,13 @@ components:
377386
unit:
378387
type: string
379388
maxLength: 20
380-
description: Time unit for the duration value (e.g., hours, days, months)
389+
description: Time unit for the duration value
390+
enum:
391+
- minutes
392+
- hours
393+
- days
394+
- months
395+
- years
381396
ErrorInfo:
382397
description: Common schema for errors
383398
type: object
@@ -421,6 +436,7 @@ components:
421436
location:
422437
type: string
423438
maxLength: 2048
439+
pattern: '^[A-Za-z0-9\\-_.]{1,2048}$'
424440
description: connection location
425441
IpAddress:
426442
type: object
@@ -474,10 +490,12 @@ components:
474490
serviceId:
475491
type: string
476492
maxLength: 255
493+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
477494
description: unique id for network service
478495
serviceName:
479496
type: string
480497
maxLength: 255
498+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
481499
description: vpn service name
482500
isProtected:
483501
type: boolean
@@ -498,30 +516,34 @@ components:
498516
guaranteeBandwidth:
499517
type: integer
500518
format: int32
501-
description: Guarantee Bandwidth (Mps)
519+
description: Guarantee Bandwidth (Mbps)
502520
minimum: 1
503521
maximum: 1000000
504522
duration:
505523
$ref: '#/components/schemas/Duration'
506524
routeProtocol:
507525
type: string
508526
maxLength: 255
527+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
509528
description: Routing Protocol used for this network
510529
resourceGroupId:
511530
type: string
512531
maxLength: 255
532+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
513533
description: Resource Group Id
514-
cloudGatewayIP:
534+
cloudGatewayIp:
515535
type: string
516536
maxLength: 45
537+
format: ip
517538
description: Cloud Gateway IP
518539
NetworkCreate:
519-
description: Base Connection Entity structure
540+
description: Base Network Entity structure for creation
520541
type: object
521542
properties:
522543
serviceName:
523544
type: string
524545
maxLength: 255
546+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
525547
description: vpn service name
526548
isProtected:
527549
type: boolean
@@ -535,7 +557,7 @@ components:
535557
guaranteeBandwidth:
536558
type: integer
537559
format: int32
538-
description: Guarantee Bandwidth (Mps)
560+
description: Guarantee Bandwidth (Mbps)
539561
minimum: 1
540562
maximum: 1000000
541563
sla:
@@ -550,15 +572,16 @@ components:
550572
routeProtocol:
551573
type: string
552574
maxLength: 255
575+
pattern: '^[A-Za-z0-9\\-_.]{1,255}$'
553576
description: Routing Protocol used for this network
554577
NetworkUpdate:
555-
description: Base Connection Entity structure
578+
description: Base Network Entity structure for update
556579
type: object
557580
properties:
558581
guaranteeBandwidth:
559582
type: integer
560583
format: int32
561-
description: Guarantee Bandwidth (Mps)
584+
description: Guarantee Bandwidth (Mbps)
562585
minimum: 1
563586
maximum: 1000000
564587
sla:
@@ -607,7 +630,7 @@ components:
607630
summary: Assessment Sample 1
608631
description: Feasibility assessment sample
609632
value:
610-
waitdays: 1
633+
waitDays: 1
611634
sla: A
612635
rent:
613636
amount: 2000
@@ -664,7 +687,7 @@ components:
664687
addressType: Ipv4Addr
665688
address: 84.125.94.10
666689
resourceGroupId: '12121'
667-
cloudGatewayIP: 1.2.3.4
690+
cloudGatewayIp: 1.2.3.4
668691
siteToCloudVPNUpdateConnectionRequest:
669692
summary: Update Connection Sample 1
670693
description: Update Connection request sample

0 commit comments

Comments
 (0)