[Bug]: Inconsistent value
behaviour between generate_token
and decode_token
for DISABLE_PAYG
and COUNTER_SYNC
#25
Labels
bug
Something isn't working
Preflight Checklist
Expected Behavior
Token value and Token Type have a 1:1 relation for
DISABLE_PAYG
andCOUNTER_SYNC
. As a user I would expectgenerate_token
anddecode_token
to have the same interface in terms of howDISABLE_PAYG
andCOUNTER_SYNC
are specified.Actual Behavior
In generate_token only
token_type
must be specified. Providing a non-None
value yields:ValueError: A value is not allowed for this token type.
In decode_token both
token_type
andtoken_value
are returned.Steps to reproduce
What operating system(s) are you using?
macOS
Additional Information
Suggested solutions:
Change
generate_token
to allow a token value that matches the provided token type. If none is given, the token value is derived from token_type. If a token type is provided that does not match the token value throw an error explaining the problem.Alternative solution:
Change
decode_token
to not return token values forDISABLE_PAYG
andCOUNTER_SYNC
The text was updated successfully, but these errors were encountered: