Commit graph

37 commits

Author SHA1 Message Date
Lukas Puehringer
6f94aa1653 Remove link to outdated client docs in tutorial
Remove link to incomplete and severely outdated
client_setup_and_repository_example.md in client section of
TUTORIAL.md.

Instead we should link (or move the entire client tutorial part) to
tuf/client/README.md, which is more comprehensive and less outdated
than above document (see #808).

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-03-16 10:31:14 +01:00
Lukas Puehringer
c490a8daee Quickfix critical tutorial typo
In tutorial code snippet fix a call to repository.mark_dirty that
passes a non-existing bin role name raising:
"tuf.exceptions.UnknownRoleError: Role name does not exist: 90-7"

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-03-06 10:47:52 +01:00
Lukas Puehringer
da26e9adcd doc: Revert accidental space deletion in tutorial
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
7e8b7e5db1 doc: Explicitly mark roles dirty in tutorial
TUF does not reliably mark roles as dirty whose metadata needs
to be re-generated.

Only roles that have changed are marked as dirty, but sometimes
roles metadata needs to be updated, although the role wasn't
changed directly (see #958).

Furthermore, the tutorial assumes at one point that the reader
leaves and re-enter the interpreter session, being forced to reload the
signing keys, roles that later need to be re-written, are marked as
dirty. If the reader does not leave the interpreter, the roles are
not marked as dirty (see #964).

To not confuse the reader with flawed state-keeping, and to never
write an inconsistent repository to disk, the tutorial lets the
reader explicitly mark all roles that need to be re-written as
"dirty".

This can be changed once above issues are fixed.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
fc23496e38 doc: Update "Delegate to Hashed Bins" in tutorial
Explain and show output of delegate_hashed_bins() function call in
tutorial snippet.

Also update the subsequent comment for better continuity.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
5a8dbd42cb doc: Update delegation section in tutorial
- Ask the reader to ignore a misleading warning about the location of
  a delegation path pattern.
  The comment may be removed when fixing the warning in
  theupdateframework/tuf#963.

- Comment out text that has become obsolete when commenting out
  the "Revoke Delegated Role" section (in an earlier commit).

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
lukpueh
9375885389 docs: Fix typos in tutorial code snippet comments
Co-Authored-By: Joshua Lock <jlock@vmware.com>
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
512c62daa3 doc: Update "How to Perform an Update" in tutorial
- Change directory names to what cli tool repo.py expects
- Remove unrelated "tufenv" note
- Mention that `tuf` must be installed

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
bb6a32ae27 doc: Comment out "Consistent Snapshots" snippet
The text above the snippet explains the basic idea of "consistent
snapshots" and how to generate them with `write` and `writeall`.

The commands in the snippet just leave the repo in an inconsistent
state (see comment).

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
ca8e9cc53a doc: Fix repo.dirty_roles() output in tutorial
- Fix expected output
- Update comments
- Add a few additional calls, to help the reader understand the
  repo state
- Also see theupdateframework/tuf#958

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
bd813d86a5 doc: Update delegation-related tutorial sections
In "Targets" section:
- Remove `repository.targets('<delegated rolename>').add_target(...)`
  command, because it is not copy-pastable and delegations
  have not yet been covered at that point.
- Update the "remove targets" snippet to remove the previously added
  "myproject/file4.txt" instead of "file3.txt", because we will add
  "myproject/file4.txt" to the delegated "unclaimed" role in the
  Delegation section.

In "Delegation" section:
- Change "unclaimed" delegation pattern from 'foo*.tgz', for which
  no file exists in the tutorial, to 'myproject/*.txt'.
- Add "myproject/file4.txt" to the delegated unclaimed targets role
- Remove the command that updates the version of the "unclaimed"
  role, because this should not be done manually, and the add_target
  call shows just as well how to access delegated roles.
- Comment out the revoke delgated role section, leaving a TODO note
  for required updates (should be ticketized).

In "Delegate to Hashed Bins":
- Add call to remove target "myproject/file4.txt" from "unclaimed",
  because it is further delgated to hashed bins
- Add dirty_roles() call to show all the newly created bins
- Add mark_dirty() and writeall() calls to create a consistent
  state of the repo

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
45c4f4c08e doc: Update "Dump Metadata and ..." tutorial
The section does not fit in the continuity of the tutorial and
misses commands to make it fully copy-pastable.

This commit marks the section as "Excursion" and updates the
snippets to make the commands fully copy-pastable, using files
created in prior tutorial sections.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
654e8dc3a0 doc: Fix targets file paths in tutorial snippets
- Correctly show that repo.get_filepaths_in_directory() returns
  absolute and not relative paths
- Pass absolute path to repo.targets.add_target() to fix exception
- Also see theupdateframework/tuf#957

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
5616fd206c doc: Fix repo.status() output in tutorial snippet
- Fix expected output
- Update comments
- Also see theupdateframework/tuf#955

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
eed900354a doc: Add "continuing..." line in tutorial snippets
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Lukas Puehringer
b86b4aad5b doc: Remove Python prompt tutorial snippet
Reasons are:

- The prompt says 2.7.3  Sep 26 2013, which makes the tutorial look
  outdated
- There is another section that explains how snippets should be
  executed in a Python interactive interpreter
- The only activity in the snippet is importing tuf functions and
  creating a repo, both of which is done in another snippet below.
  And the here created repo is not re-used
- The tutorial is long enough

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-12-16 15:16:24 +01:00
Sebastien Awwad
8e22de5842 Correct remove_target() call in TUTORIAL.md and test_tutorial.py
Target removal is done relative to the root of the targets dir.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-12-16 15:16:24 +01:00
Sebastien Awwad
e24525c94c In repo tutorial, fix consistent snapshots instructions
to include loading the root signing keys and explaining why.

Also update test_tutorial.py

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-12-16 15:16:24 +01:00
Sebastien Awwad
608e377d83 Exclude leading '/' for target fnames in tutorial and its tester
Because leading '/' is no longer allowed in target filenames in
target addition or delegation.

See https://github.com/theupdateframework/tuf/issues/639

While we're at it, remove some other unnecessary '/' characters
in repository creation and loading in the tutorial and tutorial
test.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-12-16 15:16:24 +01:00
Sebastien Awwad
56f14c4342 Remove add_restricted_paths from TUTORIAL.md and test_tutorial.py
add_restricted_paths was renamed to add_path; however, this
function represents a problematic element of TUF that assumes
that roles are have a single delegator and delegatee, and that
one can refer to a role's expected keys without being concerned
about any delegation metadata....

So this is being removed from the tutorial. In time, add_paths
will either be removed or changed (to expect a delegator role
and a delegatee role, not just a delegatee role).

This comment does not do justice to the issue: please see TUF
GitHub Issue #660:
https://github.com/theupdateframework/tuf/issues/660

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-12-16 15:16:24 +01:00
Sebastien Awwad
e2ec3ef158 Remove keystore/ use from TUTORIAL.md and test_tutorial
While it may be nice, the use of a keystore/ directory for the
temporary keys created in the tutorial complicates the code a
good bit when it's done in a portable way (tons of os.path.join()
calls), and that's not worth it. It also is a slight complication
in a tutorial that profits from being as simple as possible.

Tests will be run in multiple environments (including non-Linux
environments) and to leave so many extra subdirectory uses in the
tutorial means that the tutorial test will deviate over a large
number of lines from the TUTORIAL.md content it is intended to
test, which would be bad.

This commit adjusts both the tutorial doc and the regression test
for the tutorial.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-12-16 15:16:24 +01:00
lukpueh
c5dac3136d Revert "Minor tutorial related tweaks made after reviewing PR #775"
- line-wraps are integrated with
190a736d297ef5d8d3c1e8761ac196666954f3a2 in #775
- sorting the value returned by `get_dirty_roles()` in
`dirty_roles()` is not necessary as `get_dirty_roles()` already
returns a sorted list per ac010337f0e154f9c183f8abe759ce26ed16731c
in #775.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-11-29 12:35:28 +01:00
Joshua Lock
282c9aa98b TUTORIAL: minor cleanup
An attempt to make part of the tutorial less jarring, and reformatting
of the surrounding text to keep the lines <80 characters.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2019-11-28 22:01:33 +00:00
Sebastien Awwad
ed6acd4ef1
minor DOC: label the advanced tutorial as such
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 11:56:45 -04:00
Sebastien Awwad
24618a956b
DOC: Clarify repository_tool interface to delegated roles
Add note to make clear what was implicit: that once a delegated role is created,
it can be accessed (for the same purposes as you'd access the Targets role
using `repository.targets`) as: `repository.targets("<delegated rolename>")`.

Also add that specific note to the add_targets section of the tutorial.
2019-03-25 10:47:11 -04:00
lukpueh
c3e28e7082
Merge pull request #827 from huynq0911/fix_some_typos
Fix some typos
2019-02-21 09:56:48 +01:00
huynq0911
3772ed3d2d Fix some typos
Correct some words spelling for reading more easily.

Signed-off-by: huynq0911 <huynq0911@gmail.com>
2019-02-21 00:02:24 +07:00
huynq0911
4af9cf5899 Change http to https for security links
For security, we should change http into https links.

Signed-off-by: huynq0911 <huynq0911@gmail.com>
2019-02-20 23:47:26 +07:00
Vladimir Diaz
6ae7eb42ce
Revise text to cover new password behavior of securesystemslib
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-21 15:02:19 -04:00
Vladimir Diaz
fbc02d3034
Use a working example in the overview section
Some users will actually attempt to execute the example listed in the overview section.  Use a working example that doesn't raise an error.

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-21 11:19:59 -04:00
Vladimir Diaz
965e121148
Update text covering the client update
* The client script is now named 'client.py' and the user is no longer required to manually copy the basic_client.py to the CWD
* A log file is not saved to the CWD, by default
* The client.py script doesn't download all target files available on the repo.

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-21 11:07:16 -04:00
Sebastien Awwad
c3393db29b
DOC: Typo fix in tutorial
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2018-06-15 14:33:42 -04:00
Alan J Castonguay
c5dd5531a6
Update TUTORIAL.md
Reinstate link to ATTACKS.md, which demonstrates how the code
protects against the attacks outlined in SECURITY.md.
2018-03-13 12:21:00 -04:00
Alan J Castonguay
09c703d5b6
Update TUTORIAL.md
Correct links to modules and documentation.
Broken links appear to be mostly fallout from moving
documentation into the docs/ directory, as relative paths
to python source modules were broken.
2018-03-11 16:16:04 -04:00
Vladimir Diaz
4b1fea27d1
Use glob pattern example in documentation for delegate()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-03-01 16:08:35 -05:00
Vladimir Diaz
d051e2b962
Update TUTORIAL.md following modified behavior to securesystemslib functions
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-01-31 16:12:18 -05:00
Vladimir Diaz
ab0c38efa3
Add TUTORIAL.md
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-01-26 11:51:04 -05:00