From 3cc4c44f80b883b9f3f7efa43f7c4ae17c8ffe5f Mon Sep 17 00:00:00 2001 From: Ludovic Robert <30499179+bigludo7@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:09:13 +0100 Subject: [PATCH 1/2] Update device-status.yaml to align Device definition Align Device definition - in particular ipV6 definition with other CAMARA APIs --- code/API_definitions/device-status.yaml | 75 +++++++++++-------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/code/API_definitions/device-status.yaml b/code/API_definitions/device-status.yaml index da5c2d79..aacd962e 100644 --- a/code/API_definitions/device-status.yaml +++ b/code/API_definitions/device-status.yaml @@ -487,18 +487,8 @@ components: - NOT_CONNECTED Device: - description: | - End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. - - The developer can choose to provide the below specified device identifiers: - - * `ipv4Address` - * `ipv6Address` - * `phoneNumber` - * `networkAccessIdentifier` - - NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device type: object + minProperties: 1 properties: phoneNumber: $ref: "#/components/schemas/PhoneNumber" @@ -508,28 +498,16 @@ components: $ref: "#/components/schemas/DeviceIpv4Addr" ipv6Address: $ref: "#/components/schemas/Ipv6Address" - minProperties: 1 - NetworkAccessIdentifier: - type: string - example: 123456789@domain.com - description: A public identifier addressing a subscription in a mobile network. In 3GPP terminology, it corresponds to the GPSI formatted with the External Identifier ({Local Identifier}@{Domain Identifier}). Unlike the telephone number, the network access identifier is not subjected to portability ruling in force, and is individually managed by each operator. + description: One or more parameters allocated to the device that allow it to be identified PhoneNumber: type: string pattern: '^\+?[0-9]{5,15}$' - example: 123456789 - description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, optionally prefixed with '+'. + example: "123456789" + description: Subscriber number (MSISDN) in E.164 format, starting with country code and optionally prefixed with '+'. DeviceIpv4Addr: type: object - description: | - The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). - - If the allocated and observed IP addresses are the same (i.e. NAT is not in use) then the same address should be specified for both publicAddress and privateAddress. - - If NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object) - - In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. properties: publicAddress: $ref: "#/components/schemas/SingleIpv4Addr" @@ -540,15 +518,32 @@ components: anyOf: - required: [publicAddress, privateAddress] - required: [publicAddress, publicPort] - example: { "publicAddress": "84.125.93.10", "publicPort": 59765 } + example: + { + "publicAddress": "84.125.93.10", + "publicPort" : 59765 + } + description: | + The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). + + If the allocated and observed IP addresses are the same (i.e. NAT is not in use) then the same address should be specified for both publicAddress and privateAddress. + + If NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object) + + In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. SingleIpv4Addr: - description: A single IPv4 address with no subnet mask type: string + description: A single IPv4 address with no subnet mask + example: "84.125.93.10" pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - example: 84.125.93.10 Ipv6Address: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))?$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)?$' + example: "2001:db8:85a3:8d3:1319:8a2e:370:7344" description: | IPv6 address, following IETF 5952 format, may be specified in form
as: - address - The /128 subnet is optional for single addresses: @@ -557,12 +552,17 @@ components: - address/mask - an IP v6 number with a mask: - 2001:db8:85a3:8d3::0/64 - 2001:db8:85a3:8d3::/64 + + NetworkAccessIdentifier: type: string - format: ipv6 - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))?$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)?$' - example: 2001:db8:85a3:8d3:1319:8a2e:370:7344 + example: "123456789@domain.com" + + Port: + type: integer + minimum: 0 + maximum: 65535 + description: User equipment port. Device port may be required along with IP address to identify the target device + example: 5060 CountryCode: description: The Mobile country code (MCC) as an geographic region identifier for the country and the dependent areas. @@ -590,13 +590,6 @@ components: required: - device - Port: - description: User equipment port. Device port may be required along with IP address to identify the target device - type: integer - minimum: 0 - maximum: 65535 - example: 5060 - ErrorInfo: type: object required: From 60aea425324421c0f37792d44b72c83b924702b8 Mon Sep 17 00:00:00 2001 From: Ludovic Robert <30499179+bigludo7@users.noreply.github.com> Date: Tue, 12 Dec 2023 12:23:32 +0100 Subject: [PATCH 2/2] Update device-status.yaml --- code/API_definitions/device-status.yaml | 78 ++++++++++++------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/code/API_definitions/device-status.yaml b/code/API_definitions/device-status.yaml index aacd962e..2cbf2d81 100644 --- a/code/API_definitions/device-status.yaml +++ b/code/API_definitions/device-status.yaml @@ -487,8 +487,18 @@ components: - NOT_CONNECTED Device: + description: | + End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. + + The developer can choose to provide the below specified device identifiers: + + * `ipv4Address` + * `ipv6Address` + * `phoneNumber` + * `networkAccessIdentifier` + + NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device. type: object - minProperties: 1 properties: phoneNumber: $ref: "#/components/schemas/PhoneNumber" @@ -497,17 +507,30 @@ components: ipv4Address: $ref: "#/components/schemas/DeviceIpv4Addr" ipv6Address: - $ref: "#/components/schemas/Ipv6Address" - description: One or more parameters allocated to the device that allow it to be identified + $ref: "#/components/schemas/DeviceIpv6Address" + minProperties: 1 PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, optionally prefixed with '+'. type: string pattern: '^\+?[0-9]{5,15}$' example: "123456789" - description: Subscriber number (MSISDN) in E.164 format, starting with country code and optionally prefixed with '+'. + + NetworkAccessIdentifier: + description: A public identifier addressing a subscription in a mobile network. In 3GPP terminology, it corresponds to the GPSI formatted with the External Identifier ({Local Identifier}@{Domain Identifier}). Unlike the telephone number, the network access identifier is not subjected to portability ruling in force, and is individually managed by each operator. + type: string + example: "123456789@domain.com" DeviceIpv4Addr: type: object + description: | + The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). + + If the allocated and observed IP addresses are the same (i.e. NAT is not in use) then the same address should be specified for both publicAddress and privateAddress. + + If NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object) + + In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. properties: publicAddress: $ref: "#/components/schemas/SingleIpv4Addr" @@ -519,50 +542,27 @@ components: - required: [publicAddress, privateAddress] - required: [publicAddress, publicPort] example: - { - "publicAddress": "84.125.93.10", - "publicPort" : 59765 - } - description: | - The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). - - If the allocated and observed IP addresses are the same (i.e. NAT is not in use) then the same address should be specified for both publicAddress and privateAddress. - - If NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object) - - In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. + publicAddress: "84.125.93.10" + publicPort: 59765 SingleIpv4Addr: - type: string description: A single IPv4 address with no subnet mask - example: "84.125.93.10" - pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - - Ipv6Address: type: string - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))?$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)?$' - example: "2001:db8:85a3:8d3:1319:8a2e:370:7344" - description: | - IPv6 address, following IETF 5952 format, may be specified in form
as: - - address - The /128 subnet is optional for single addresses: - - 2001:db8:85a3:8d3:1319:8a2e:370:7344 - - 2001:db8:85a3:8d3:1319:8a2e:370:7344/128 - - address/mask - an IP v6 number with a mask: - - 2001:db8:85a3:8d3::0/64 - - 2001:db8:85a3:8d3::/64 - - NetworkAccessIdentifier: - type: string - example: "123456789@domain.com" + format: ipv4 + example: "84.125.93.10" Port: + description: TCP or UDP port number type: integer minimum: 0 maximum: 65535 - description: User equipment port. Device port may be required along with IP address to identify the target device - example: 5060 + + DeviceIpv6Address: + description: | + The device should be identified by the observed IPv6 address, or by any single IPv6 address from within the subnet allocated to the device (e.g. adding ::0 to the /64 prefix). + type: string + format: ipv6 + example: 2001:db8:85a3:8d3:1319:8a2e:370:7344 CountryCode: description: The Mobile country code (MCC) as an geographic region identifier for the country and the dependent areas.