Commit graph

20 commits

Author SHA1 Message Date
Aditya Sirish A Yelgundhalli
a3fedc1524
sigstore: Add support for private sigstore instances
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-10-16 15:14:38 -04:00
Aditya Sirish A Yelgundhalli
2f0be5c46f
*: Refactor TUF
This is a massive commit that isn't easy to split up, my apologies to
reviewers. Here's everything that's happening.

First, the base tuf package now includes interfaces for RootMetadata,
TargetsMetadata, Rule, and Principal. The first two are self-explanatory. Rule
represents some protection rule, currently matched by the Delegation schema,
while Principal defines a new take on who a trusted party is. Existing schemas
have been moved into a v01 subpackage. v01 also includes a Key type based on
signerverifier.SSLibKey which implements the Principal interface. This means
that expectations elsewhere (such as in repository and policy) re a principal
can be met by existing policy metadata.

Second, with most of the policy metadata manipulations having moved to the tuf
package, this commit drops them from the policy package as they were thin
wrappers. While we originally kept them around for the purposes of migrating
versions when a repository must move from the old metadata schema to a newer
one, it doesn't make sense to implement this in every individual manipulation
function.

Finally, the rest of the packages that handle keys (for adding to metadata or
for signing / verifying) have been updated to use either
signerverifier.SSLibKey directly or the new Principal interface, depending on
what the purpose is. For now, the idea is to continue using the
signerverifier.SSLibKey representation of a key itself for the signature
verification flows, though we may eventually move that into gittuf rather than
rely on go-securesystemslib. Note that some of the transitions have been
included in this commit for compatibility reasons, and subsequent PRs will
update that. For example, the GitHub app pull request approval attestation must
be updated to not use tufv01.Key objects to represent approvers.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-10-15 12:58:44 -04:00
Aditya Sirish A Yelgundhalli
f7dd00b7bd
*: Remove use of signerverifier dispatcher
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-10-09 12:59:32 -04:00
Aditya Sirish A Yelgundhalli
9ed0c936d4
*: Use signerverifier/ssh for git signing / verifying
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-10-09 11:08:45 -04:00
Pat Zielinski
d571facb8d *: Add copyright notice to code files
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-09-27 15:28:12 -04:00
Aditya Sirish A Yelgundhalli
fe6d1d343a
*: Drop old gitinterface APIs
This commit also renames ReplacementTreeBuilder to TreeBuilder.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-07-01 10:21:25 -04:00
patzielinski
0cff7df8db
Merge pull request #436 from gittuf/ssh-cli
Wire up ssh-keygen signer to CLI
2024-06-18 16:24:56 +00:00
Aditya Sirish A Yelgundhalli
576ba3bc0e *: Adds SSH support to verification APIs
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-06-18 12:14:49 -04:00
Aditya Sirish A Yelgundhalli
e871053716 gitinterface: Fixes for executor
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-06-13 11:42:27 -04:00
Aditya Sirish A Yelgundhalli
d1ecf8fb70 gitinterface: Clean up repository.execute methods
This commit applies @wlynch's feedback from https://github.com/gittuf/gittuf/pull/383#discussion_r1628088633.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-06-11 16:46:22 -04:00
Aditya Sirish
aae8e0cbdf
gitinterface: Add commits and tags
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:39:19 +05:30
Aditya Sirish
588a31e025
gitinterface: Support verifying SSH key signatures
Also updates error chaining in signature verification to preserve error
context, making debugging easier.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-09 11:20:27 -05:00
Aditya Sirish
2fd0988424
dep: Remove vendored copy of go-git
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-29 21:04:54 +05:30
Aditya Sirish
1d724fb749
gitinterface: Fix var names
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-02 16:05:36 -04:00
Aditya Sirish
0541411fc1
*: Route GetObject requests through gitinterface
This allows us to perform additional checks in future such as whether an
object is replaced by a replace ref. It also makes it easier to switch
between go-git and another mechanism to invoke Git, such as directly
using the binary.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-10-26 11:13:32 -04:00
Billy Lynch
d57191618a
Remove module replace in favor of a package fork.
This removes the sub-go.mod in favor of updating all references to the
third_party/go-git package.

This lets users `go install` from outside of the module.

Signed-off-by: Billy Lynch <billy@chainguard.dev>
2023-10-25 19:25:56 -04:00
Pat Zielinski
d0905e7816 Add SPDX License Identifiers to code files
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2023-10-09 08:09:34 -04:00
Aditya Sirish
30f583e7e4
*: Add verify-commit
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-10-02 10:47:14 -04:00
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
b4d19ff9f8
gitinterface: Add tag specific functions
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-09-13 12:50:09 -04:00