3 ms·
Imagine an authentication endpoint that accepts either a username/password or a SSH key. If you go the optional fields route, your parser will accept invalid c
by javcasas 3y ago
Imagine an authentication endpoint that accepts either a username/password or a SSH key.
If you go the optional fields route, your parser will accept invalid combinations, for example password+ssh key.
If you go the proper alternatives way, then you need a parser with two branches that parses user/password in one way, or ssh key the other way.
You tell me simple verification is enough, hence you either have a parser that accepts bad data, or deal only with simplistic data so that the parser can't have branches.