Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement in_toto_run #7

Merged
merged 28 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6b9cd30
:new: Add Skeleton for InTotoRun
joyliu-q Jun 29, 2021
d8de0e5
:new: Fill-in skeleton, add recordartifacts & runcommand
joyliu-q Jun 30, 2021
fd99f0a
:broom: Clean code, propagate errors
joyliu-q Jul 1, 2021
a6170a3
:shirt: Remove Unnecessary Return Statement
joyliu-q Jul 1, 2021
6a35d8b
:broom: Return status code, correct doc, cosmetics
joyliu-q Jul 2, 2021
2c01646
:heavy_check_mark: Make tests pass
joyliu-q Jul 2, 2021
27e12d3
:new: Add run_dir parameter, canonicalize path
joyliu-q Jul 2, 2021
cb93298
:zap: Better path handling & test_record_artifacts
joyliu-q Jul 4, 2021
6e0ddf5
:new: Add example usage for in_toto_run
joyliu-q Jul 4, 2021
fdfab27
:tada: Handle symbolic links & record_artifacts breakdown
joyliu-q Jul 6, 2021
eff788c
:new: Add hash_algorithms parameter
joyliu-q Jul 6, 2021
640b370
:heavy_check_mark: Add hash_algorithms to example
joyliu-q Jul 8, 2021
46d9a42
:tada: Add path normalization using path_clean
joyliu-q Jul 8, 2021
890372c
:new: Add Link Generation, Rename Metablock
joyliu-q Jul 11, 2021
228bc35
Merge branch 'master' of https://github.com/in-toto/in-toto-rs into a…
joyliu-q Jul 11, 2021
8e6fb7d
:books: Add to Documentation
joyliu-q Jul 12, 2021
99762ee
:bug: Add path-clean as dependency
joyliu-q Jul 19, 2021
2e83e00
:bug: Make Keys a Reference
joyliu-q Jul 19, 2021
402083d
:new: Add runlib tests & placeholders
joyliu-q Jul 26, 2021
714b8c1
:new: Clean-up & Add tests
joyliu-q Jul 30, 2021
2805e39
:bug: More contextual err handling in run_command
joyliu-q Aug 2, 2021
7eae8c9
:art: Add run_command check for empty slice passed
joyliu-q Aug 10, 2021
02d44c1
:new: Add back typ field to preserve type & name
joyliu-q Aug 11, 2021
6639884
:heavy_check_mark: Pass tests for absolute paths
joyliu-q Aug 11, 2021
59e2b14
:heavy_check_mark: Remove symdir
joyliu-q Aug 12, 2021
f8531f1
:bug: Address comments & make test pass on Github
joyliu-q Aug 12, 2021
26023c9
:broom: Delete symbolic link to file
joyliu-q Aug 12, 2021
f5e6479
:broom: Delete symbolic link to folder
joyliu-q Aug 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions examples/example_link.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"signatures": [
{
"keyid": "e0294a3f17cc8563c3ed5fceb3bd8d3f6bfeeaca499b5c9572729ae015566554",
"sig": "9239111d2f81c106d83a087eb1bcb393e6c8ea588cb3a39a71d3dea560717250044095bd5d811f1ea8f8d882961c39c8a00ba32fddb14219ab36c4cdcd229007"
}
],
"signed": {
"_type": "example",
"byproducts": {
"return-value": "0",
"stderr": "",
"stdout": ""
},
"env": {},
"materials": {
"tests/test_runlib/.hidden/.bar": {
"sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
"sha512": "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6"
},
"tests/test_runlib/.hidden/foo": {
"sha256": "7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730",
"sha512": "cc06808cbbee0510331aa97974132e8dc296aeb795be229d064bae784b0a87a5cf4281d82e8c99271b75db2148f08a026c1a60ed9cabdb8cac6d24242dac4063"
},
"tests/test_runlib/hello./symbolic_to_nonparent_folder/.bar": {
"sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
"sha512": "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6"
},
"tests/test_runlib/hello./symbolic_to_nonparent_folder/foo": {
"sha256": "7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730",
"sha512": "cc06808cbbee0510331aa97974132e8dc296aeb795be229d064bae784b0a87a5cf4281d82e8c99271b75db2148f08a026c1a60ed9cabdb8cac6d24242dac4063"
},
"tests/test_runlib/hello./world": {
"sha256": "25623b53e0984428da972f4c635706d32d01ec92dcd2ab39066082e0b9488c9d",
"sha512": "9b589a5fc9f43c3279e3a184f78b62738794913d976d74cd72f862864b8bc09b61f882273e9a64cbfea53c18782583f4bdc842ace58411824a4b15cd0d0c6ff9"
},
"tests/test_runlib/symbolic_to_file": {
"sha256": "25623b53e0984428da972f4c635706d32d01ec92dcd2ab39066082e0b9488c9d",
"sha512": "9b589a5fc9f43c3279e3a184f78b62738794913d976d74cd72f862864b8bc09b61f882273e9a64cbfea53c18782583f4bdc842ace58411824a4b15cd0d0c6ff9"
},
"tests/test_runlib/symbolic_to_license_file": {
"sha256": "61ed40687d2656636a04680013dffe41d5c724201edaa84045e0677b8e2064d6",
"sha512": "95df79b6a38f7e7c6b2c0393fcbc433b5d9f5f5b865467de992ff886965816bdf5e9f564390c9d38e3265396f338970a3335b1f3d6a67556e54100898af2e462"
}
},
"products": {
"tests/test_runlib/.hidden/.bar": {
"sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
"sha512": "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6"
},
"tests/test_runlib/.hidden/foo": {
"sha256": "7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730",
"sha512": "cc06808cbbee0510331aa97974132e8dc296aeb795be229d064bae784b0a87a5cf4281d82e8c99271b75db2148f08a026c1a60ed9cabdb8cac6d24242dac4063"
},
"tests/test_runlib/hello./symbolic_to_nonparent_folder/.bar": {
"sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
"sha512": "0cf9180a764aba863a67b6d72f0918bc131c6772642cb2dce5a34f0a702f9470ddc2bf125c12198b1995c233c34b4afd346c54a2334c350a948a51b6e8b4e6b6"
},
"tests/test_runlib/hello./symbolic_to_nonparent_folder/foo": {
"sha256": "7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730",
"sha512": "cc06808cbbee0510331aa97974132e8dc296aeb795be229d064bae784b0a87a5cf4281d82e8c99271b75db2148f08a026c1a60ed9cabdb8cac6d24242dac4063"
},
"tests/test_runlib/hello./world": {
"sha256": "25623b53e0984428da972f4c635706d32d01ec92dcd2ab39066082e0b9488c9d",
"sha512": "9b589a5fc9f43c3279e3a184f78b62738794913d976d74cd72f862864b8bc09b61f882273e9a64cbfea53c18782583f4bdc842ace58411824a4b15cd0d0c6ff9"
},
"tests/test_runlib/symbolic_to_file": {
"sha256": "25623b53e0984428da972f4c635706d32d01ec92dcd2ab39066082e0b9488c9d",
"sha512": "9b589a5fc9f43c3279e3a184f78b62738794913d976d74cd72f862864b8bc09b61f882273e9a64cbfea53c18782583f4bdc842ace58411824a4b15cd0d0c6ff9"
},
"tests/test_runlib/symbolic_to_license_file": {
"sha256": "61ed40687d2656636a04680013dffe41d5c724201edaa84045e0677b8e2064d6",
"sha512": "95df79b6a38f7e7c6b2c0393fcbc433b5d9f5f5b865467de992ff886965816bdf5e9f564390c9d38e3265396f338970a3335b1f3d6a67556e54100898af2e462"
}
}
}
}
3 changes: 2 additions & 1 deletion examples/in_toto_run_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fn main() {
Some(&["sha512", "sha256"]),
)
.unwrap();
let json = serde_json::to_value(&link).unwrap();

println!("Generated link: {:?}", link)
println!("Generated link: {}", json)
SantiagoTorres marked this conversation as resolved.
Show resolved Hide resolved
}
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::io;
use std::path::Path;
use thiserror::Error;


/// Error type for all in-toto related errors.
#[derive(Error, Debug, PartialEq, Eq)]
pub enum Error {
Expand Down Expand Up @@ -45,7 +44,7 @@ pub enum Error {

/// There is no known or available hash algorithm.
#[error("unknown hash algorithm: {0}")]
UnkonwnHashAlgorithm(String),
UnknownHashAlgorithm(String),

/// There is no known or available key type.
#[error("unknown key type: {0}")]
Expand Down
Loading