You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libtuf.py needs method for dynamically retrieving a delegated targets role #165
Presently, libtuf.py assumes that the developer knows the name of a delegated targets role before runtime. For example, retrieving the "unclaimed" role would be specified as repository.targets.unclaimed.
However, this is not always true or even possible. For example, how would a developer address in this manner a delegated targets role with the name recently-unclaimed? Furthermore, sometimes the developer may not known the names of the delegated targets role until name (perhaps because it is supplied by a user at the command-line).
Expected
We simply need a method for retrieving a delegated targets role by its name in a string. I will defer the exact mechanism to @vladimir-v-diaz , but a simple function should do the job.
Delegated roles are no longer added as attributes of a Targets object by libtuf.py (e.g., repository.targets.delegated_role). The previous bahavior restricted rolenames to Python identifiers (i.e., can only include letters, numbers, the underscore character, and must start with a nonnumeric character). Now, delegated roles may be referenced as strings (e.g., repository.targets('recently-claimed')) and include characters other than '_'. In addition, methods have been added to return all the delegated rolesnames of a target (e.g., repository.targets.get_delegated_rolenames()) and the immediate delegated Target objects of a role.
Previous behavior: repository.targets.unclaimed.django.version = 8
Current behavior: repository.targets('unclaimed')('django').version = 8.
Activity
Address Issues #165, #158, and #147.
vladimir-v-diaz commentedon Jan 2, 2014
Delegated roles are no longer added as attributes of a Targets object by libtuf.py (e.g., repository.targets.delegated_role). The previous bahavior restricted rolenames to Python identifiers (i.e., can only include letters, numbers, the underscore character, and must start with a nonnumeric character). Now, delegated roles may be referenced as strings (e.g., repository.targets('recently-claimed')) and include characters other than '_'. In addition, methods have been added to return all the delegated rolesnames of a target (e.g., repository.targets.get_delegated_rolenames()) and the immediate delegated Target objects of a role.
Previous behavior: repository.targets.unclaimed.django.version = 8
Current behavior: repository.targets('unclaimed')('django').version = 8.
Update libtuf-diagram.
Update README.md
trishankkarthik commentedon Jan 5, 2014
👍
Seems more Python-ish, though, to make it index-able (like dictionaries or lists). Community can decide this later.
Use TUF exceptions instead of SSL exceptions where appropriate
Use TUF exceptions instead of SSL exceptions where appropriate
Use TUF exceptions instead of SSL exceptions where appropriate