cdh.integration_platform.token_api.fields module

class cdh.integration_platform.token_api.fields.ExpiryField(verbose_name: str = None, default: object = None, choices: object = None, name: str = None, null: bool = False, blank: bool = False, error_messages: dict = None, validators: tuple = ())[source]

Bases: DateTimeField

to_python(value: Union[str, int]) datetime[source]

Custom datetime field which will transform the API’s expiry in seconds to a datetime.

This way we can cache the token, and know _exactly_ when the token is supposed to expire when we retrieve the token from the cache.