question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make confined_target_dirs optional field in the MIRROR_SCHEMA

See original GitHub issue

Description of issue or feature request: I was thinking about why confined_target_dirs is not an optional field in the MIRROR_SCHEMA. https://github.com/theupdateframework/tuf/blob/fdccb8dc0bf34e2b016ce20f1570e582dcd459e7/tuf/formats.py#L408

Given that [''] matches everything and [] matches nothing this API can be confusing and lead to a mistake. For me, it sounds more logical to not provide confined_target_dirs list at all if I want to accept queries for all targets for that mirror and provide a list of confined_target_dirs if it’s otherwise.

Current behavior: confined_target_dirs is a mandatory field in the MIRROR_SCHEMA.

Expected behavior:

confined_target_dirs to be an optional field in the MIRROR_SCHEMA.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mnm678commented, Sep 30, 2020

We should just remove it. Nobody uses it AFAIK.

For backwards compatibility, we can make it optional for now, then remove it in a future major version release.

1reaction
MVrachevcommented, Oct 6, 2020

Do you @mnm678 and @trishankatdatadog think we can change the API for confined_target_dirs key in the MIRROR_SCHEMA? Instead of using [''] to allow all targets that we can change the documentation and check that if confined_target_dirs does exist for MIRROR_SCHEMA and if it doesn’t it means that all targets are allowed.

Of course, it’s good if we don’t remove the checks if confined_target_dirs is [] because of possible clients using it the older way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to parse XML files with optional fields in ADF?
I have a XML file where we need flattening. The problem is some fields in the XML are optional(as per XSD). The field...
Read more >
Phing User Guide
Phing is used to "compile" the XML metadata into PHP arrays that can be processed without overhead by PHP scripts. Of course, XML...
Read more >
Domain XML format - Libvirt
0 optional migratable attribute may be used to explicitly request such features to be removed from (on) or kept in (off) the virtual...
Read more >
Administration Guide: SUSE Manager 4.1
OPTIONAL : Complete the SSL fields if your repository requires client certificate authentication. 6. Click [Create Repository] .
Read more >
HIBERNATE - Relational Persistence for Idiomatic ... - JBoss.org
Declare accessors and mutators for persistent fields (optional) ... First, we'll create a simple console-based Hibernate application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found