From 4ebc96fb7a47b2ea5fd7cf8c4cb78478cd6daa90 Mon Sep 17 00:00:00 2001 From: hemantagogoi-infy Date: Mon, 15 Jun 2026 22:31:19 +0530 Subject: [PATCH 1/3] Update multi-point-vpn API spec Fix typos and improve schemas/consistency in multi-point-vpn spec. --- code/API_definitions/multi-point-vpn.yaml | 44 ++++++++++++++--------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/code/API_definitions/multi-point-vpn.yaml b/code/API_definitions/multi-point-vpn.yaml index c209c02..456b681 100644 --- a/code/API_definitions/multi-point-vpn.yaml +++ b/code/API_definitions/multi-point-vpn.yaml @@ -20,7 +20,7 @@ info: * Physical Location Physical location of the Customer Edge Router. - 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. + 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. # Available scopes @@ -106,6 +106,11 @@ paths: headers: x-correlator: $ref: "#/components/headers/x-correlator" + Location: + description: URL of the newly created network resource + schema: + type: string + format: uri content: application/json: schema: @@ -126,7 +131,7 @@ paths: tags: - Network summary: To update a multipoint virtual private network - description: Update a new multipoint virtual private network + description: Update a multipoint virtual private network operationId: updateNetwork security: - openId: @@ -137,7 +142,7 @@ paths: requestBody: required: true content: - application/json: + application/merge-patch+json: schema: $ref: "#/components/schemas/NetworkUpdate" examples: @@ -171,7 +176,7 @@ paths: - Network summary: retrieve multipoint virtual private network details description: Retrieve multipoint virtual private network details - operationId: getVpnConnection + operationId: getNetwork security: - openId: - multi-point-vpn:network:read @@ -215,7 +220,7 @@ paths: - $ref: '#/components/parameters/serviceId' responses: "202": - description: deleteVPNConnectionResponse + description: Network deletion request accepted. The deletion is processed asynchronously; the resource will be removed once complete. headers: x-correlator: $ref: "#/components/headers/x-correlator" @@ -313,6 +318,7 @@ components: type: string maxLength: 3 description: Currency code (ISO 4217 format, e.g., GBP, USD, EUR) + pattern: '^[A-Z]{3}$' AssessmentRequest: description: Base schema for all areas type: object @@ -329,7 +335,7 @@ components: guaranteeBandwidth: type: integer format: int32 - description: Guarantee Bandwidth (Mps) + description: Guarantee Bandwidth (Mbps) minimum: 1 maximum: 1000000 duration: @@ -338,7 +344,7 @@ components: type: object description: Assessment Result properties: - waitdays: + waitDays: type: integer format: int32 description: the waiting-days until the vpn can be offered @@ -377,7 +383,13 @@ components: unit: type: string maxLength: 20 - description: Time unit for the duration value (e.g., hours, days, months) + description: Time unit for the duration value + enum: + - minutes + - hours + - days + - months + - years ErrorInfo: description: Common schema for errors type: object @@ -498,7 +510,7 @@ components: guaranteeBandwidth: type: integer format: int32 - description: Guarantee Bandwidth (Mps) + description: Guarantee Bandwidth (Mbps) minimum: 1 maximum: 1000000 duration: @@ -511,12 +523,12 @@ components: type: string maxLength: 255 description: Resource Group Id - cloudGatewayIP: + cloudGatewayIp: type: string maxLength: 45 description: Cloud Gateway IP NetworkCreate: - description: Base Connection Entity structure + description: Base Network Entity structure for creation type: object properties: serviceName: @@ -535,7 +547,7 @@ components: guaranteeBandwidth: type: integer format: int32 - description: Guarantee Bandwidth (Mps) + description: Guarantee Bandwidth (Mbps) minimum: 1 maximum: 1000000 sla: @@ -552,13 +564,13 @@ components: maxLength: 255 description: Routing Protocol used for this network NetworkUpdate: - description: Base Connection Entity structure + description: Base Network Entity structure for update type: object properties: guaranteeBandwidth: type: integer format: int32 - description: Guarantee Bandwidth (Mps) + description: Guarantee Bandwidth (Mbps) minimum: 1 maximum: 1000000 sla: @@ -607,7 +619,7 @@ components: summary: Assessment Sample 1 description: Feasibility assessment sample value: - waitdays: 1 + waitDays: 1 sla: A rent: amount: 2000 @@ -664,7 +676,7 @@ components: addressType: Ipv4Addr address: 84.125.94.10 resourceGroupId: '12121' - cloudGatewayIP: 1.2.3.4 + cloudGatewayIp: 1.2.3.4 siteToCloudVPNUpdateConnectionRequest: summary: Update Connection Sample 1 description: Update Connection request sample From 4e223de73e19b52c3ac2e9cce0ca888aeb2cfbb5 Mon Sep 17 00:00:00 2001 From: hemantagogoi-infy Date: Tue, 16 Jun 2026 18:23:37 +0530 Subject: [PATCH 2/3] Add validation constraints to API schema Update multi-point-vpn OpenAPI definition to improve input validation: --- code/API_definitions/multi-point-vpn.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/API_definitions/multi-point-vpn.yaml b/code/API_definitions/multi-point-vpn.yaml index 456b681..2f2bfff 100644 --- a/code/API_definitions/multi-point-vpn.yaml +++ b/code/API_definitions/multi-point-vpn.yaml @@ -111,6 +111,7 @@ paths: schema: type: string format: uri + maxLength: 2048 content: application/json: schema: @@ -302,6 +303,7 @@ components: schema: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' in: path description: Identifier of the Resource schemas: @@ -366,6 +368,7 @@ components: id: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: Unique identifier for the connection customerEdge: $ref: '#/components/schemas/EdgeConnection' @@ -433,6 +436,7 @@ components: location: type: string maxLength: 2048 + format: uri description: connection location IpAddress: type: object @@ -486,10 +490,12 @@ components: serviceId: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: unique id for network service serviceName: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: vpn service name isProtected: type: boolean @@ -518,10 +524,12 @@ components: routeProtocol: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: Routing Protocol used for this network resourceGroupId: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: Resource Group Id cloudGatewayIp: type: string @@ -534,6 +542,7 @@ components: serviceName: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: vpn service name isProtected: type: boolean @@ -562,6 +571,7 @@ components: routeProtocol: type: string maxLength: 255 + pattern: '^[A-Za-z0-9\\-_.]{1,255}$' description: Routing Protocol used for this network NetworkUpdate: description: Base Network Entity structure for update From 8c0b03a3bda12bde05f042a0402b5da8077b7340 Mon Sep 17 00:00:00 2001 From: hemantagogoi-infy Date: Tue, 16 Jun 2026 18:38:28 +0530 Subject: [PATCH 3/3] 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. --- code/API_definitions/multi-point-vpn.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/multi-point-vpn.yaml b/code/API_definitions/multi-point-vpn.yaml index 2f2bfff..a309103 100644 --- a/code/API_definitions/multi-point-vpn.yaml +++ b/code/API_definitions/multi-point-vpn.yaml @@ -110,7 +110,7 @@ paths: description: URL of the newly created network resource schema: type: string - format: uri + pattern: '^[A-Za-z0-9\\-_.]{1,2048}$' maxLength: 2048 content: application/json: @@ -436,7 +436,7 @@ components: location: type: string maxLength: 2048 - format: uri + pattern: '^[A-Za-z0-9\\-_.]{1,2048}$' description: connection location IpAddress: type: object @@ -534,6 +534,7 @@ components: cloudGatewayIp: type: string maxLength: 45 + format: ip description: Cloud Gateway IP NetworkCreate: description: Base Network Entity structure for creation