Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should postal code include country identification #7

Closed
rartych opened this issue Sep 12, 2024 · 4 comments · Fixed by #15
Closed

Should postal code include country identification #7

rartych opened this issue Sep 12, 2024 · 4 comments · Fixed by #15
Labels
enhancement New feature or request

Comments

@rartych
Copy link

rartych commented Sep 12, 2024

Problem description
Postal code is not unique: for example 31000 is Pamplona in Spain and Toulouse in France.
In most cases the country can be derived from the phone number, but there can be other more sophisticated cases.
Making postal code unique should help to detect error API calls.

Possible evolution

Geographical coordinates are unique, the country property can be added to the postal code to make it unique like in https://github.com/camaraproject/DeviceStatus/blob/main/code/API_definitions/device-roaming-status.yaml

  CountryName:
     description: The ISO 3166 ALPHA-2 country-code
     type: string

Alternative solution

Additional context

@rartych rartych added the enhancement New feature or request label Sep 12, 2024
@javier-carrocalabor
Copy link
Contributor

javier-carrocalabor commented Sep 20, 2024

My point is: for me, as a Telco Operator in one country and exposing the API, my service endpoint will receive a call to this API only if the request is for me, and I just have to apply the parameters in the request to the country I am operating on. It is assumed that there is a previous mechanism to route the request to the corresponding operator.
So, from the other perspective, for me, as an API client providing a service in one country, I send a request regarding an MSISDN (or IP:port, ...) and I expect that the request will reach the Telco operator of that user in that country, so I should not need to specify the country. And I think it is similar even though the service provider is operating in several countries: me, as a service provider, I want to verify the postalCode 31000 in the country of the user (which I know, but also its Telco operator knows). So, for me (as an API client), providing the country is redundant.
On the other hand, In Roaming Status it makes sense because it is, effectively, considering the scenario where the user is out of the country, but the country name parameter is in the response, not in the request: in that case the client/service provider is asking whether the user is in a different country from the one that they are suposed to be, which is the home country, the country where the Operator is operating and received the request.

@FabrizioMoggio
Copy link

With roaming and federation it makes sense to add CountryName

@javier-carrocalabor
Copy link
Contributor

Just to try to have content to document our conversation this morning:

We are trying to follow the principles of simplicity for the user and data minimization:

  • Simplicity: a Service Provider wanting to verify the MFL of a end user by using the postal code would be assuming that the postal code is for the country which the phone number belongs to. This will work because the request will reach the telco operator responsible for that phone number.
  • Data minimization: when a telco operator receives a request having a postal code and a country name, I see 3 scenarios:
  1. postal code and country name make sense for the operator: everything is ok to proceed with the request (no error returned), but the country name probably wouldn't have been necessary.
  2. The Service Provider included a wrong country name but a correct postal code (it may happen by accidental error or by wrong information holded by the Service Provider): the telco operator will return an error of mismatching. This is good if the cause was an accidental error, but goes against data minimization if the cause was wrong information holded by the SP).
  3. The Service Provider included a right country name but a wrong postal code (again, either by accidental error or by wrong information of the SP): again, returning an error is good if the cause was an accidental error, and against data minimization if the cause was wrong information.

This said, it's true that there are scenarios where including de country name would help the Developer/Service Provider avoid mistakes. But this would be based on including a parameter to "double check" the information they are providing in the request, and it wouldn't make sense to add parameters in any API just to double check (data minimization). So, we agree that it is very necessary to have a good documentation to make the Developer aware that the postal code will be processed by the telco operator responsible for that user assuming that the postal code is for the country where the telco operator operates.

Anyway, this comment is probably missing other scenarios or causes of mismatches between both parameters...

@rartych
Copy link
Author

rartych commented Oct 17, 2024

Currently postal code is not included in the proposed common definition of Area type: camaraproject/Commonalities#315 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants