TokenChangeHistoryEntry#
- class gafaelfawr.models.history.TokenChangeHistoryEntry(*, token, username, token_type, token_name=None, parent=None, scopes, service=None, expires=None, actor, action, old_token_name=None, old_scopes=None, old_expires=None, ip_address=None, event_time=<factory>, github_project_id=None)#
Bases:
BaseModelA record of a change to a token.
- Parameters:
Attributes Summary
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].Methods Summary
Convert to a dictionary while suppressing some fields.
Attributes Documentation
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- model_dump_reduced()#
Convert to a dictionary while suppressing some fields.
The same as the standard Pydantic
model_dumpmethod, but excludes theold_fields for changes other than edits and when the edit doesn’t change those fields.Notes
Knowing which fields to exclude requires understanding the semantics of the change (particularly when deciding whether to drop
old_expires) in ways that are too complex to do with the standard Pydantic filtering API, hence the hand-rolled method.