[Freeipa-devel] [PATCH] otptoken_yubikey, append CR by default and add a option for not doing so

Nathaniel McCallum npmccallum at redhat.com
Fri Apr 17 11:58:06 UTC 2015


On Thu, 2015-04-16 at 09:12 +0200, Jan Cholasta wrote:
> Dne 9.4.2015 v 15:11 Luc de Louw napsal(a):
> > 
> > On 04/09/2015 02:28 PM, Jan Cholasta wrote:
> > > > > > Let's say you now introduce --no-cr flag. What if we 
> > > > > > decide to change
> > > > > > the default to False? How would you then change the 
> > > > > > option/API?
> > > > > 
> > > > > You would have to add --cr flag.
> > > > 
> > > > That was the point - some clients would send "ct" flag, some 
> > > > "no_cr"
> > > > and there
> > > > would have to be special handling.
> > > > 
> > > > > > It is more flexible IMO to just use something like
> > > > > > 
> > > > > > --cr=TRUE|FALSE with TRUE being the default
> > > > > 
> > > > > I would say --append-cr=TRUE|FALSE with no default, meaning 
> > > > > do not
> > > > > add the flag
> > > > > to the config at all.
> > > > 
> > > > I though the idea was to append the CR by default, i.e.
> > > > --append-cr=TRUE|FALSE
> > > > with TRUE being the default.
> > > > 
> > > 
> > > If you want to hardcode the default into the plugin, there is no 
> > > benefit
> > > in using Bool over Flag, because Flag is actually a Bool with 
> > > hardcoded
> > > default value.
> > > 
> > 
> > I actually started with a bool, default=True. I had the problem 
> > that the
> > Default value was ignored, the value was None.
> > 
> > Changing the default behavior is IMHO bad anyway does not matter 
> > if Bool
> > or Flag.
> 
> +1
> 
> > 
> > Please advise what is you wish to be implemented :-)
> 
> That depends. Is there a difference between "do not set APPEND_CR 
> ticket 
> flag" and "set APPEND_CR ticket flag to false"?

For YubiKey hardware the flag is either present (true) or absent 
(false). This flag controls whether or not the carriage return is sent 
(present) or not (absent).

Nathaniel




More information about the Freeipa-devel mailing list