[Satosa-dev] Default value semantics

Ivan Kanakarakis ivan.kanak at gmail.com
Wed Nov 8 14:05:55 CET 2017


Hello all,


Across the satosa codebase there are places where a default behaviour
is needed. There are two ways we signify this:

- Using the empty string as a dictionary key
- Using the string "default" as a dictionary key

(where other keys define behaviour/settings for specific entities.)

I am not sure how the project ended up with two ways to signify a
default set, but it is annoying.

In terms of the chosen strings to represent the default set, "" seems
to be a valid choice, as no entity (usually entityid) should be empty.
"default" on the other hand, is more descriptive and self documenting,
and hopefully nobody uses that to describe and entity (or as an
entityid).

In terms of handling this, there is currently a function under
`src/satosa/util.py` namely `get_dict_defaults()` that favours "" over
"default" – it fallbacks to "default" if "" is not set. While this is
fine and works, it is not used across the codebase.


I would like this to be resolved and have a single way to signify a
default behaviour.

What are your opinions? Do you think this should settle to a single
way of representing a default set, even if that means that people
using "" or "default" will have to migrate (this would be a breaking
change for their configs)? Which is the most appropriate way to go?


Cheers,


PS: This discussion was triggered by skoranda's PR here:
https://github.com/IdentityPython/satosa_microservices/pull/6/files#r148260877


-- 
Ivan c00kiemon5ter Kanakarakis  >:3


More information about the Satosa-dev mailing list