Commit 63794097 authored by Anastasios Pandis's avatar Anastasios Pandis
Browse files

refactored OAI location retrieval validation to clarify supported device...

refactored OAI location retrieval validation to clarify supported device identifiers,updated validation logic to reject unsupported identifiers
parent 642dec39
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -178,10 +178,10 @@ class NetworkManager(BaseNetworkClient):
        """
        Validates OAI-specific parameters for location retrieval via NEF monitoring events.

        OAI NEF requires a device identifier that can be resolved to a NEF
        ExternalId. The recommended approach is to provide the device's IPv4 address
        (which the adapter resolves via the NEF UE-ID API at /3gpp-ueid/v1/retrieve),
        or alternatively a pre-resolved ExternalId in the networkAccessIdentifier field.
        OAI NEF only supports networkAccessIdentifier (pre-resolved ExternalId) or
        ipv4Address (resolved via the NEF UE-ID API at /3gpp-ueid/v1/retrieve).
        phoneNumber and ipv6Address are not supported by the OAI southbound and will
        be rejected early here rather than failing later in the build step.

        args:
            retrieve_location_request: The CAMARA location retrieval request to validate.
@@ -194,15 +194,12 @@ class NetworkManager(BaseNetworkClient):
                "OAI requires a device to be specified for location retrieval."
            )
        device = retrieve_location_request.device
        has_identifier = (
            device.networkAccessIdentifier is not None
            or device.ipv4Address is not None
            or device.ipv6Address is not None
            or device.phoneNumber is not None
        has_supported_identifier = (
            device.networkAccessIdentifier is not None or device.ipv4Address is not None
        )
        if not has_identifier:
        if not has_supported_identifier:
            raise OaiValidationError(
                "OAI requires at least one device identifier for location retrieval. "
                "OAI requires a supported device identifier for location retrieval. "
                "Provide ipv4Address (recommended) or a pre-resolved "
                "networkAccessIdentifier (ExternalId)."
            )