diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 220f4725..00000000 --- a/examples/README.md +++ /dev/null @@ -1,12 +0,0 @@ -This directory contains an example of a TUF repository, metadata, and key and -client files. - -## WARNING ## -These examples were last updated 2 years ago. We have since made changes to the -format of our metadata and key files, and will need to regenerate them so the -new tools can properly load them. We are currently working on a 1.0 release -that will make further tweaks to the format of metadata and key files, so these -examples will be modified once again. - -Note: The examples that are up-to-date and normally tested are located here: -https://github.com/theupdateframework/tuf/tree/develop/tests/repository_data/ diff --git a/examples/client/example_client.py b/examples/client/example_client.py deleted file mode 100755 index 01224e9b..00000000 --- a/examples/client/example_client.py +++ /dev/null @@ -1,94 +0,0 @@ -""" - - example_client.py - - - Vladimir Diaz - - - September 2012. - - - See LICENSE for licensing information. - - - Example script demonstrating custom python code a software updater - utilizing The Update Framework may write to securely update files. - The 'basic_client.py' script can be used on the command-line to perform - an update that will download and update all available targets; writing - custom code is not required with 'basic_client.py'. - - The custom examples below demonstrate: - (1) updating all targets - (2) updating all the targets of a specified role - (3) updating a specific target explicitly named. - - It assumes a server is listening on 'http://localhost:8001'. One can be - started by navigating to the 'examples/repository/' and starting: - $ python -m SimpleHTTPServer 8001 -""" - -import logging - -import tuf.client.updater - -# Uncomment the line below to enable printing of debugging information. -tuf.log.set_log_level(logging.INFO) - -# Set the local repository directory containing the metadata files. -settings.repository_directory = '.' - -# Set the repository mirrors. This dictionary is needed by the Updater -# class of updater.py. The client will download metadata and target -# files from any one of these mirrors. -repository_mirrors = {'mirror1': {'url_prefix': 'http://localhost:8001', - 'metadata_path': 'metadata', - 'targets_path': 'targets', - 'confined_target_dirs': ['']}} - -# Create the Upater object using the updater name 'tuf-example' -# and the repository mirrors defined above. -updater = tuf.client.updater.Updater('tuf-example', repository_mirrors) - -# Set the local destination directory to save the target files. -destination_directory = './targets' - -# Refresh the repository's top-level roles, store the target information for -# all the targets tracked, and determine which of these targets have been -# updated. -updater.refresh() -all_targets = updater.all_targets() -updated_targets = updater.updated_targets(all_targets, destination_directory) - -# Download each of these updated targets and save them locally. -for target in updated_targets: - try: - updater.download_target(target, destination_directory) - - except tuf.ssl_commons.exceptions.DownloadError as e: - pass - -# Remove any files from the destination directory that are no longer being -# tracked. -updater.remove_obsolete_targets(destination_directory) - - - -# Example demonstrating an update that only downloads the targets of -# a specific role (i.e., 'targets/project') -updater.refresh() -targets_of_role1 = updater.targets_of_role('targets/project') -updated_targets = updater.updated_targets(targets_of_role1, destination_directory) - -for target in updated_targets: - updater.download_target(target, destination_directory) - - - -# Example demonstrating an update that downloads a specific target. -updater.refresh() -target = updater.target('/file2.txt') -updated_target = updater.updated_targets([target], destination_directory) - -for target in updated_target: - updater.download_target(target, destination_directory) diff --git a/examples/client/metadata/current/root.json b/examples/client/metadata/current/root.json deleted file mode 100644 index 8128041e..00000000 Binary files a/examples/client/metadata/current/root.json and /dev/null differ diff --git a/examples/client/metadata/previous/root.json b/examples/client/metadata/previous/root.json deleted file mode 100644 index 8128041e..00000000 Binary files a/examples/client/metadata/previous/root.json and /dev/null differ diff --git a/examples/keystore/project_key b/examples/keystore/project_key deleted file mode 100644 index ad2c31d8..00000000 --- a/examples/keystore/project_key +++ /dev/null @@ -1 +0,0 @@ -5bc5cdc1e18ff3ccbfd7c33a88bec596@@@@313030303030@@@@39656230336534656264303863303733353832386465383466346232633863356362616234306430333863353239393966643333373730353231386262623339@@@@31caf11a40e9eb48f499dcc6f80c88e8@@@@0400a24989069098ce702d6a8f81826ba482ffd9a17fff5a10c6f986b9179bae1be4d246db2fceda93ce12bd465e896e4e4e847c934eb120c794e12fbcc8569e4aa6964995f1fda9af50057644236c4194ebb78a588804363dbce492db7e4ef2ce39391013a7c2d68260a0e785b6cec39fc02cdff11e9c7a168ae133292fdbe5f2f968d2a0ae098ca9453ec33d175de181f771b016c760ceba51d9c20c431702656e8b09ebda6cf884096b89d80dd6c2c1752c04312e934cd79d49b91e8c7ef4448bf3b969fa6ed9727cac48f91e3921f41d5bf8ec4130ff45fda51e07cd16a7fa8daca1feb6f2dced6881c736565a1b72dc705a97606a0480c0dd681e65bea82fc261762cdad203fd49d45f \ No newline at end of file diff --git a/examples/keystore/project_key.pub b/examples/keystore/project_key.pub deleted file mode 100644 index 0f1c3193..00000000 --- a/examples/keystore/project_key.pub +++ /dev/null @@ -1 +0,0 @@ -{"keytype": "ed25519", "keyval": {"public": "b6e40fb71a6041212a3d84331336ecaa1f48a0c523f80ccc762a034c727606fa"}} \ No newline at end of file diff --git a/examples/keystore/root_key b/examples/keystore/root_key deleted file mode 100644 index 0f87c374..00000000 --- a/examples/keystore/root_key +++ /dev/null @@ -1 +0,0 @@ -70b05482c00cad0fccfcab4ac2b86b50@@@@313030303030@@@@62626137313336626662363862333962636161306561326437336237643436306162323966303038326636306363613965396161353566646330346666356635@@@@5f6612c00c8ed8627dd33754812bb7e1@@@@f651c3db5ac02aa8337264f0badd1f40fbe174ec3f8de8fd95188d31cf41b4863d7a28db297b8a5abd25e49d2af3c6cb2e25789088dce2b5113b7d7db16deea1eadf109d5ec004a2b5bcbdc29e13a9e4c803659def851800969918fb5930c56b816b119be490667f2d629309bc7578dad43c6b0ca6ef0c6f48ad68390fb1fc711b8a40bb5b1c197ae6f72d2b1e83bbc9050f46a3c69efe3b11c55a52d3f68f6e9fe58ad7e67dd6b136681b6d800fed22f15d31ee71ad1ed78f36b6d19b0771c22123f1dcb54a6b2e9742d2661014931cbab8fbbb001e3ac836bc5c64b19fa4cb881485acdafa6a0fd87044534608f50ae13920517c6f2ab2669f8edd4bc6cbe2fc1fc272264a819e2e34bc83 \ No newline at end of file diff --git a/examples/keystore/root_key.pub b/examples/keystore/root_key.pub deleted file mode 100644 index 7cf01390..00000000 --- a/examples/keystore/root_key.pub +++ /dev/null @@ -1 +0,0 @@ -{"keytype": "ed25519", "keyval": {"public": "66dd78c5c2a78abc6fc6b267ff1a8017ba0e8bfc853dd97af351949bba021275"}} \ No newline at end of file diff --git a/examples/keystore/snapshot_key b/examples/keystore/snapshot_key deleted file mode 100644 index 9f999f94..00000000 --- a/examples/keystore/snapshot_key +++ /dev/null @@ -1 +0,0 @@ -cff2ed748f0281d65c8eb535e81dbfd0@@@@313030303030@@@@30353732326564313863306632626336656631636635313666636330383537376466393833313937363261303638336632373530303938623665346239646230@@@@1eda960b65beefb9a2a4afcc9be973f6@@@@ea7c468f9e5ab91e874b2a0fa692a18056293261886400e5976a6c884b13cdd3905b0188f41b0c2b2846d36dabbeecf4d9d1c87123b5b236ccbce24f4b30c9ba25d00ccce270d3da1d202d2fd27a0a007381bf2284c58bb01a812050086264617f94a47cd3931b9129c6b105eec4ff56d1176e6fbde6bf5ade513a0f1c7551cecb04c678582e7fd0656936a1f232fa3a739df3dc4af07ad69580f54b1dd366c78e96c07249732621929aac056f4892af07772011246101cfb9886558fe2cfd1d09e9c280cbecdf2fb8dbeded4a628ef2fa04d5360dae327ccf15a12a00f2f32964ca03abaeaeb60bbece207e09c897413b8a630331df568822880be86359181664aa0806770ab11e30663594 \ No newline at end of file diff --git a/examples/keystore/snapshot_key.pub b/examples/keystore/snapshot_key.pub deleted file mode 100644 index cebf0249..00000000 --- a/examples/keystore/snapshot_key.pub +++ /dev/null @@ -1 +0,0 @@ -{"keytype": "ed25519", "keyval": {"public": "01c61f8dc7d77fcef973f4267927541e355e8ceda757e2c402818dad850f856e"}} \ No newline at end of file diff --git a/examples/keystore/targets_key b/examples/keystore/targets_key deleted file mode 100644 index f56772a5..00000000 --- a/examples/keystore/targets_key +++ /dev/null @@ -1 +0,0 @@ -a0fdf15a675c849cc7bd4cfb46273164@@@@313030303030@@@@62303735356165326132633766333932633137643234323961636166356135666433333234376163356665656330306362366363383332386430356133663831@@@@0d7ce5bc8687edc1a292ebbe203284b6@@@@155dee106e192009ed4dace179e514f518d403d7a83d136047683683090c8dd1e80d6d5f6bd480e1e9e76bf63a265dfdc7e5bce07418039c6457c6d454fd0114fd7311c8508ead020e59e0b5b2ee55101d49535980e598c02c70ecb7bca77a54d04040080ca9403cd23bd0ae4cc5e33131321d2a4c8a4544553f5c54b7af0986a437f37696b4e7d76efed24be9a4c6928542fb93cfd88018537703a1ff0f6ac8fcb625714a161aaa7a548b39963ded1481b47020b1346544a8a9d96f1eb03a6cad326af0f5be43c6756dc1d4e6c7dee550077d7689949a671acd370680d6b29e594675ade9d7525a4ad8af7a1b13a3e4692192d70c189115d52b814af5a53bc9d0528aec6c6417f6f7d0bcb3 \ No newline at end of file diff --git a/examples/keystore/targets_key.pub b/examples/keystore/targets_key.pub deleted file mode 100644 index 5e1d1e1a..00000000 --- a/examples/keystore/targets_key.pub +++ /dev/null @@ -1 +0,0 @@ -{"keytype": "ed25519", "keyval": {"public": "68ead6e54a43f8f36f9717b10669d1ef0ebb38cee6b05317669341309f1069cb"}} \ No newline at end of file diff --git a/examples/keystore/timestamp_key b/examples/keystore/timestamp_key deleted file mode 100644 index 42dc9bda..00000000 --- a/examples/keystore/timestamp_key +++ /dev/null @@ -1 +0,0 @@ -dd0f6b3bff19df2c4ab89e34a5b190e6@@@@313030303030@@@@37613435636666623966633230613439376661303631616635323365326636643039383236333638633162326262616231653531353066656262643265623566@@@@e6d72cc0a99144c4dbf509fa56092454@@@@10bb33112d4083f81d700740e78b315574a0d7b8c042921b1dcb7b8593caff1dbb10b8886ea2f4b7edcb49d3aabc9ec25db59dc0b121890555dc5d69291856f739b280de6fa6216e0ac92b9b95689b9f6ba1a414cb78ee6547968ea5ebd84e34972cf6d0e56cf0443b653f51d8e2742a7454e70039e548e4a69e97e73475940964307b5d5da440767531479b0c940dc8ffebafdf562e3a68d456f9438cb3c2253117180efd868b8b9fd4ea3e717501db8c0a9afe0bcdb34068eef4858103b2126b47d4c22a3d0f16cec0e5cd452201487eb6695139d8235a17a3c1a42fa7552d7ca45625b0000650f22851679ac00c7b71368d4dfc862a1823437b5cc244c282be0c01138fa39dc13511bd59 \ No newline at end of file diff --git a/examples/keystore/timestamp_key.pub b/examples/keystore/timestamp_key.pub deleted file mode 100644 index 3224de62..00000000 --- a/examples/keystore/timestamp_key.pub +++ /dev/null @@ -1 +0,0 @@ -{"keytype": "ed25519", "keyval": {"public": "72378e5bc588793e58f81c8533da64a2e8f1565c1fcc7f253496394ffc52542c"}} \ No newline at end of file diff --git a/examples/repository/metadata.staged/root.json b/examples/repository/metadata.staged/root.json deleted file mode 100644 index 8128041e..00000000 Binary files a/examples/repository/metadata.staged/root.json and /dev/null differ diff --git a/examples/repository/metadata.staged/snapshot.json b/examples/repository/metadata.staged/snapshot.json deleted file mode 100644 index 3294c89e..00000000 Binary files a/examples/repository/metadata.staged/snapshot.json and /dev/null differ diff --git a/examples/repository/metadata.staged/targets.json b/examples/repository/metadata.staged/targets.json deleted file mode 100644 index 6387d30e..00000000 Binary files a/examples/repository/metadata.staged/targets.json and /dev/null differ diff --git a/examples/repository/metadata.staged/targets.json.gz b/examples/repository/metadata.staged/targets.json.gz deleted file mode 100644 index 85fa0890..00000000 Binary files a/examples/repository/metadata.staged/targets.json.gz and /dev/null differ diff --git a/examples/repository/metadata.staged/targets/project.json b/examples/repository/metadata.staged/targets/project.json deleted file mode 100644 index 57f4195a..00000000 Binary files a/examples/repository/metadata.staged/targets/project.json and /dev/null differ diff --git a/examples/repository/metadata.staged/timestamp.json b/examples/repository/metadata.staged/timestamp.json deleted file mode 100644 index 93e124e1..00000000 Binary files a/examples/repository/metadata.staged/timestamp.json and /dev/null differ diff --git a/examples/repository/metadata/root.json b/examples/repository/metadata/root.json deleted file mode 100644 index 8128041e..00000000 Binary files a/examples/repository/metadata/root.json and /dev/null differ diff --git a/examples/repository/metadata/snapshot.json b/examples/repository/metadata/snapshot.json deleted file mode 100644 index 3294c89e..00000000 Binary files a/examples/repository/metadata/snapshot.json and /dev/null differ diff --git a/examples/repository/metadata/targets.json b/examples/repository/metadata/targets.json deleted file mode 100644 index 6387d30e..00000000 Binary files a/examples/repository/metadata/targets.json and /dev/null differ diff --git a/examples/repository/metadata/targets.json.gz b/examples/repository/metadata/targets.json.gz deleted file mode 100644 index 85fa0890..00000000 Binary files a/examples/repository/metadata/targets.json.gz and /dev/null differ diff --git a/examples/repository/metadata/targets/project.json b/examples/repository/metadata/targets/project.json deleted file mode 100644 index 57f4195a..00000000 Binary files a/examples/repository/metadata/targets/project.json and /dev/null differ diff --git a/examples/repository/metadata/timestamp.json b/examples/repository/metadata/timestamp.json deleted file mode 100644 index 93e124e1..00000000 Binary files a/examples/repository/metadata/timestamp.json and /dev/null differ diff --git a/examples/repository/targets/file1.txt b/examples/repository/targets/file1.txt deleted file mode 100644 index 7bf3499f..00000000 --- a/examples/repository/targets/file1.txt +++ /dev/null @@ -1 +0,0 @@ -This is an example target file. \ No newline at end of file diff --git a/examples/repository/targets/file2.txt b/examples/repository/targets/file2.txt deleted file mode 100644 index 606f18ef..00000000 --- a/examples/repository/targets/file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is an another example target file. \ No newline at end of file diff --git a/examples/repository/targets/project/file3.txt b/examples/repository/targets/project/file3.txt deleted file mode 100644 index 60464604..00000000 --- a/examples/repository/targets/project/file3.txt +++ /dev/null @@ -1 +0,0 @@ -This is role1's target file. \ No newline at end of file