Live data from Hacker News

Source code for Dutch DigiD app released under Dutch Open Government Act

github.com

11–20 of 161 posts

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#11

In order to verify your ID with the app your phone must have NFC support to scan the passport/id, and on the screen where you do the verification it says: if your phone doesnt have support find a friend with a phone that supports it, I kid you not.. edit, found it in the code: https://github.com/MinBZK/woo-besluit-broncode-digid-app/blo...

Access to a smartphone with NFC can indeed be an issue for some people, but it is still better than having to record videos of yourself holding your ID next to your face, then a couple of years later finding out that your personal data is freely circulating on the web because one of those sleezy identity verification services has been hacked.

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#12

In order to verify your ID with the app your phone must have NFC support to scan the passport/id, and on the screen where you do the verification it says: if your phone doesnt have support find a friend with a phone that supports it, I kid you not.. edit, found it in the code: https://github.com/MinBZK/woo-besluit-broncode-digid-app/blo...

What’s your concern here?

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#13

In order to verify your ID with the app your phone must have NFC support to scan the passport/id, and on the screen where you do the verification it says: if your phone doesnt have support find a friend with a phone that supports it, I kid you not.. edit, found it in the code: https://github.com/MinBZK/woo-besluit-broncode-digid-app/blo...

How this is used in practice is when you log in to a government site, you provide your DigiD account name and password, and then (often but not always) verify that it's really you with either SMS or (apparently) by scanning a document with NFC. Since it's just a single-use authentication I don't see a particular problem with doing it on another device. The actual government interaction after you're logged in happens on the website anyway, not your friend's phone.

btw I see that attaching an nfc reader to your computer is also supported.

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#15
post #11

In order to verify your ID with the app your phone must have NFC support to scan the passport/id, and on the screen where you do the verification it says: if your phone doesnt have support find a friend with a phone that supports it, I kid you not.. edit, found it in the code: https://github.com/MinBZK/woo-besluit-broncode-digid-app/blo...

Access to a smartphone with NFC can indeed be an issue for some people, but it is still better than having to record videos of yourself holding your ID next to your face, then a couple of years later finding out that your personal data is freely circulating on the web because one of those sleezy identity verification services has been hacked.

Doesn't Apple block NFC support? Or do they allow peasant apps to read via NFC?

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#16
post #15
post #11

Earlier quoted context omitted.

Access to a smartphone with NFC can indeed be an issue for some people, but it is still better than having to record videos of yourself holding your ID next to your face, then a couple of years later finding out that your personal data is freely circulating on the web because one of those sleezy identity verification services has been hacked.

Doesn't Apple block NFC support? Or do they allow peasant apps to read via NFC?

Apple iOS supportss NFC.

https://developer.apple.com/documentation/corenfc

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#17
post #2

Example: https://imgur.com/a/9cIDQtk

I'm triggered by the lack of brackets after every if-expression. Sure it looks nicer this way but the default Visual Studio code style settings will complain if you don't do it, hence I'm used to it.

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#18
post #3

Earlier quoted context omitted.

Is this literate programming?

It's been extensively discussed on twitter, and the general conclusion seems to be that yes, this particular snippet is good code.

The only thing that jumps out at me is this:

    if (percentage == 0)
        return […];
    if (percentage > 0.0 && […]
Can a double have a value that is larger than 0 but smaller or equal to 0.0? I would have expected '> 0' instead.

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#19
post #5
post #2

Example: https://imgur.com/a/9cIDQtk

I like it. Easy to understand, fast, no allocations.

It has almost twice as many comparisons as necessary. The term to the left of each AND is redundant because it has already been checked by the preceding IF. It also does not guard against negative arguments. Perhaps the environment in which it is used guarantees that negative arguments cannot occur.

If I were reviewing this code I would at least ask the developer to add an assertion or contract requiring that the argument be in the inclusive range [0..1]

The choice of variable name, percentage, is also misleading. At least I suspect it is because I would expect the comparisons involving percentages to be to numbers between 0 and 100.

If lack of allocations is a requirement then one could create a static array of strings and use

    int(percent * 10)
as the index. This would eliminate all of the comparisons and also throw an index out of range (in any sane language) if the value was outside the allowed range.

Re: Source code for Dutch DigiD app released under Dutch Open Government Act

#20
post #2

Example: https://imgur.com/a/9cIDQtk

I vaguely suspect that this is a product of the sort of environment where you have to fill out a form in triplicate to get the static analyser to let you concatenate strings (which, to be clear, may not be inappropriate for something like this).

I do object to the variable being called ‘percentage’ tho, as it clearly isn't one.

Post reply on HN