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

FR: Validate postal code #680

Open
mimi89999 opened this issue Jun 10, 2022 · 6 comments
Open

FR: Validate postal code #680

mimi89999 opened this issue Jun 10, 2022 · 6 comments
Assignees
Labels

Comments

@mimi89999
Copy link

Hello,

Recently I found a certificate with an invalid postal code: https://crt.sh/?id=6811189993&opt=zlint

It was found due to the field length exceeding 17 chars. However, if the value in that field was shorter, but still invalid, the certificate would not have been found

I think that Zlint should check if the postal code matches a template/regex for the country. A list of postal code templates can be found on https://en.m.wikipedia.org/wiki/List_of_postal_codes

@zakird
Copy link
Member

zakird commented Jun 21, 2022

Is this formalized in any standard or baseline requirements? We might be able to add a community-based INFO or WARN lint, but I suspect not a hard error without something like that.

@christopher-henderson
Copy link
Member

@zakird that's precisely what I was thinking at first. I balk at the idea of maintaining a list of postal codes as I'm not sure if there is any authority on such a list. I might give something naive a shot and see what shows up in the test corpus. If it's an ocean of postal codes that aren't listed in non-authoritative sources (wiki) then I reckon we might not want to enforce what we don't know.

@mimi89999
Copy link
Author

Is this formalized in any standard or baseline requirements?

No, but it might be declared in a formal way by the national post of each country.

@mimi89999
Copy link
Author

I'm not sure if there is any authority on such a list

For Poland, there is the list maintained by Poczta Polska: https://www.poczta-polska.pl/hermes/uploads/2013/11/spispna.pdf

@cardonator
Copy link
Contributor

I agree that this would be extremely rough for a project like zlint to manage. I can see the benefits of doing so (even for CSL information as well), but it's a massive undertaking that there are entire industries built around that doesn't seem to make much sense in this project.

@mimi89999
Copy link
Author

I think that Zlint shouldn't keep entire lists of postal codes for each country, but just templates like xx-xxx. This should be easier.

Maybe it would be worth trying the templates from Wikipedia on a large number of certificates downloaded from CT logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants