Skip to content

ngclient: client-level constants #1402

Closed

Description

@sechkova

The constants could use some thought: We definitely don't want to keep using tuf.settings, but I guess the question is, should these be instance variables in Updater instead of module level ones:

MAX_ROOT_ROTATIONS = 32
MAX_DELEGATIONS = 32
DEFAULT_ROOT_MAX_LENGTH = 512000  # bytes
DEFAULT_TIMESTAMP_MAX_LENGTH = 16384  # bytes
DEFAULT_SNAPSHOT_MAX_LENGTH = 2000000  # bytes
DEFAULT_TARGETS_MAX_LENGTH = 5000000  # bytes

Maybe it does not hurt if they were instance variables instead. They don't even need to be optional constructor arguments (as initialization does not use any of them: caller can initialize the Updater and then modify the values).
I guess the fanciest option is that constructor takes an optional argument dataclass UpdaterOptions with those attributes ...

Originally posted by @jku in #1396 (comment)

Activity

  1. added
    experimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)
    on May 20, 2021
  2. added and removed
    experimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)
    on May 21, 2021
  3. changed the title [-]experimental client: client-level constants[/-] [+]ngclient: client-level constants[/+] on May 25, 2021
  4. added
    backlogIssues to address with priority for current development goals
    on May 26, 2021
  5. self-assigned this
    on Jun 23, 2021
  6. added this to the weeks26-27 milestone on Jun 23, 2021
  7. sechkova commented on Jun 29, 2021

    @sechkova
    ContributorAuthor

    I am in favour of the dataclass option because it groups all the configuration at one place and I drafted a proposal based on it: #1470.
    There is also RequestsFetcher which needs to be configured on init so I added the configuration as an optional parameter to Updater. However I am not totally sure if this solution makes it convenient enough to customise the configuration and I will be happy to hear some opinions about it.

  8. trishankatdatadog commented on Jun 29, 2021

    @trishankatdatadog
    Contributor

    I am in favour of the dataclass option because it groups all the configuration at one place and I drafted a proposal based on it: #1470.

    Me too 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backlogIssues to address with priority for current development goalsngclient

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions