Commit graph

12 commits

Author SHA1 Message Date
Aditya Sirish
ad96717b0e
gitinterface: Fix test config value and invocation
This fixes a previously unnoticed bug in setting the test config where
the user's name and email were actually left blank. This is an issue
with how go-git parses the raw parts of the config vs the defined
structs. This was primarily noticed because of mismatched hashes on
GitHub actions in the tag, the expected values have changed in some
existing tests as well.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-09-13 13:30:16 -04:00
Aditya Sirish
bdf56b6577
gitinterface: Generalize signature functions
This is in preparation for re-use with tags.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-09-13 12:24:26 -04:00
Aditya Sirish
29b795abe3
*: Update gitinterface.Commit behavior
1. Commit now returns the ID of the newly created commit. This will help
   us avoid extraneous calls to repo.Reference to get the new state of
   the affected ref.
2. Commit also creates the ref if it doesn't already exist. This allows
   to skip initializing (to zero) refs we're about to commit to anyway.
   Note: this commit does not actually remove those extra
   initializations. That is left to a future patch or clean up pass.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-09-12 13:06:53 -04:00
Aditya Sirish
b850488960
gitinterface: Changes and commit reachability
* Add functions to track changes introduced by commits or between commits
* Add function to check if a commit knows another using reachability

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-09-11 15:34:14 -04:00
Aditya Sirish
3192cdb861
Rename module to use gittuf org
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-08-30 13:13:54 -04:00
Aditya Sirish
5bb804a767
gitinterface: Identify changed files
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-08-18 16:07:45 -04:00
Aditya Sirish
0d4be41b91
Early gitsign support
This commit introduces early, experimental support for gitsign
signatures on git commits. It uses TAP-18 to specify sigstore identity
constraints in delegations.

The feature introduced here depends on unreleased prototype code in
go-securesystemslib and is also insufficiently tested due to some
sigstore library constraints.

See: #73

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-08-07 15:27:37 -04:00
Aditya Sirish
5fa283d717
policy: Add basic verification functions
This commit introduces basic verification workflows for Git refs.
Specifically, a Git ref can be verified against either the latest policy
or from the very start of the RSL. As part of this, relative
verification is also introduced from one RSL entry to the next.

Note: also adds basic Match functionality for delegation patterns in the tuf
package.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-07-14 10:48:22 -04:00
Aditya Sirish
22b87ba83e
gitinterface: Add docstrings
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-06-20 15:51:43 -07:00
Aditya Sirish
24244629a7
gitinterface, sv: Add support for GPG signing
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-06-20 15:48:00 -07:00
Aditya Sirish
e085386a16
Remove repo parameter when crafting signing command
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-05-07 15:01:01 -04:00
Aditya Sirish
c94f87d5f9
Add gitinterface package
This package includes a set of helpers to interface with the underlying
git repository. Features:
* parse git configs to determine commit signing mechanism
* create and sign commit objects

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-02-20 14:09:44 -05:00