Live data from Hacker News

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

github.com

151–160 of 161 posts

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

#151
post #39

I find the DigiD app to be one of the most annoying implementations of 2FA out there. You have to unlock the app with a pin code, then enter an app-generated code on the site, then scan a QR with the app, and then grant permission to login to that site. If you compare that to 2FA for Office 365 for example, where you just have a push notification where you press a button to allow, then you can't help but think that s…

I have dozens of 2FA codes now that requires searching for the correct one and I have to store backup codes in physical form. Which probably a lot of people keep unencrypted on their desktop somewhere.

With the Digid app you just need to remember the pin code or unlock with face id. The app generates the codes for each login and then you just scan the QR. It's very simple to use.

Recently I lost my phone and had to set everything up again. I had to start digging for 2fa backup codes, but Digid I could easily set up again using the NFC chip in my passport.

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

#152

The Norwegian welfare agency publish most of their code on github: https://github.com/navikt/ It's the organization you use if you're sick, lost your job, where you get your social security etc. Basically a huge behemoth of all kinds of social or labor services. While most of the code probably has little value for others (2000 different repos), I think it's quite noble that it's public, given it's made with tax payer…

Quite similar to Estonia. Tho they run their own Gitlab instance https://koodivaramu.eesti.ee/explore And not everything is there. ID Card software is hosted on Github https://github.com/open-eid

I think all countries should use their own instances of gitlab or others. It feels wrong that they all depend on GitHub to publish such important information.

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

#153
post #112

Earlier quoted context omitted.

> The fact that we do not have a standardized national ID easily available to everyone is embarrassing. Surely that's hyperbole. State IDs are pretty standardized, and even more so with the REAL ID system (if the mandates for it ever go into effect). When have you ever had a problem using one state's ID in another state?

It makes coordinating your information across many different service providers much more efficient. Here in the Netherlands for example, I can use DigiD to login and pay my taxes, pay for health insurance with a private company, authenticate to my pension plan and a ton of other things. I cant vote with my Texas ID in Wyoming. A passport might be sufficient to vote in a different state for a national election but I’m…

I can vote with an out-of-state driver's license in Pennsylvania, it just means that I have to provide a signature to them instead of it getting auto-populated from my driver's license. I'm pretty sure this should be the case in any state.

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

#154
post #32

Earlier quoted context omitted.

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 arg…

You know it's only a matter of time before someone dissects each one of your objections. In fact you could do so yourself with a bit of a wider perspective.

How long do I need to wait?

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

#155
post #33

Earlier quoted context omitted.

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 arg…

If you have int(percent * 10) + 1 you can just generate that many blue circles (checking for the edge-case of zero, or even better using ceil instead of int), the rest white and return it - no need for manually crafting the array (since the performance is, I presume, not a critical thing here). If tomorrow you want stars instead of the circles you just edit 2 chars in one place, instead of typing manually all combina…

The compile time allocated array is to avoid allocations at run time, if that is a requirement. In a language with proper macros such as Nim or Lisp this can be done at compile time using exactly your approach. That way it executes fast and is just as simple .

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

#156
post #141

Earlier quoted context omitted.

You don't know what tooling anyone editing your code is using though.

If you enforce correct formatting before commits or in your CI builds that is no longer a problem.

That's a big if though.

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

#157
post #32

Earlier quoted context omitted.

You know it's only a matter of time before someone dissects each one of your objections. In fact you could do so yourself with a bit of a wider perspective.

How long do I need to wait?

I think they're all great suggestions (albeit for such a tiny, irrelevant piece of code). The only problem I can think of is that the given code rounds up, but your suggestion of `int(percent * 10)` rounds down.

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

#158
post #33

Earlier quoted context omitted.

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 arg…

If you have int(percent * 10) + 1 you can just generate that many blue circles (checking for the edge-case of zero, or even better using ceil instead of int), the rest white and return it - no need for manually crafting the array (since the performance is, I presume, not a critical thing here). If tomorrow you want stars instead of the circles you just edit 2 chars in one place, instead of typing manually all combina…

Find-and-replace exists.

Having a separate string for each level of progress also lets you do other kinds of customizations: you could have a rainbow progress bar, or put little bits of encouraging text to the right of the progress bar, like "Almost there!" at 90%.

Essentially, you're making one type of customization (i.e., changing the symbols) slightly easier, at the expense of making other types of customization harder.

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

#159
post #32

Earlier quoted context omitted.

You know it's only a matter of time before someone dissects each one of your objections. In fact you could do so yourself with a bit of a wider perspective.

How long do I need to wait?

It's just too obvious. The metrics you're optimizing for don't matter to any of the stakeholders.

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

#160
post #33

Earlier quoted context omitted.

If you have int(percent * 10) + 1 you can just generate that many blue circles (checking for the edge-case of zero, or even better using ceil instead of int), the rest white and return it - no need for manually crafting the array (since the performance is, I presume, not a critical thing here). If tomorrow you want stars instead of the circles you just edit 2 chars in one place, instead of typing manually all combina…

The compile time allocated array is to avoid allocations at run time, if that is a requirement. In a language with proper macros such as Nim or Lisp this can be done at compile time using exactly your approach. That way it executes fast and is just as simple .

I've been looking into nim lately (just for fun with the Advent of Code problems) and it looks fantastic. I plan to allocate more time to it in future definitely.
Post reply on HN