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

Adding function for adding a single attestor #104

Closed
wants to merge 21 commits into from
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
90292ed
adding function to add a single attestor
ChaosInTheCRD Dec 15, 2023
2a9cd8d
Fixing bug introduced in logs - warning and debug logs not printing (…
ChaosInTheCRD Dec 15, 2023
7e5dc35
Point to v0.2.0 of archivista (#105)
jkjell Dec 15, 2023
9fa0a5a
Create SECURITY.md (#107)
jkjell Dec 17, 2023
210da2a
chore: bump github/codeql-action from 2.22.9 to 3.22.11 (#110)
dependabot[bot] Dec 19, 2023
a2db58c
chore: bump actions/download-artifact from 3.0.2 to 4.0.0 (#112)
dependabot[bot] Dec 19, 2023
af8e161
chore: bump actions/upload-artifact from 3.1.3 to 4.0.0 (#111)
dependabot[bot] Dec 19, 2023
efa0140
chore: bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#115)
dependabot[bot] Dec 19, 2023
736674d
chore: bump github.com/go-git/go-git/v5 from 5.5.2 to 5.11.0 (#119)
dependabot[bot] Dec 29, 2023
ab18e20
chore: bump github/codeql-action from 3.22.11 to 3.22.12 (#118)
dependabot[bot] Jan 2, 2024
a106144
chore: bump actions/download-artifact from 4.0.0 to 4.1.0 (#117)
dependabot[bot] Jan 2, 2024
1dd0166
chore: bump k8s.io/apimachinery from 0.26.11 to 0.26.12 (#116)
dependabot[bot] Jan 2, 2024
a037e9f
Update SECURITY-INSIGHTS.yml with additional information (#108)
jkjell Jan 2, 2024
0185ffa
chore: bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 (#121)
dependabot[bot] Jan 8, 2024
44c86b2
chore: bump actions/dependency-review-action from 3.1.4 to 3.1.5 (#123)
dependabot[bot] Jan 8, 2024
0824d9c
chore: bump github/codeql-action from 3.22.12 to 3.23.0 (#122)
dependabot[bot] Jan 9, 2024
9684b66
fix: added oidc redirect url option for fulcio (#76)
pkwiatkowski1 Jan 12, 2024
08bf768
chore: bump actions/upload-artifact from 4.0.0 to 4.1.0 (#126)
dependabot[bot] Jan 16, 2024
0adde0e
chore: bump actions/download-artifact from 4.1.0 to 4.1.1 (#127)
dependabot[bot] Jan 16, 2024
4ebd16e
added old function with deprecation warning
ChaosInTheCRD Jan 16, 2024
144e8c6
Merge branch 'main' into adding-add-attestor
ChaosInTheCRD Jan 16, 2024
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
13 changes: 13 additions & 0 deletions attestation/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,20 @@ func FactoryByName(name string) (registry.FactoryFunc[Attestor], bool) {
return registrationEntry.Factory, ok
}

func AddAttestor(nameOrType string) (Attestor, error) {
attestors, err := AddAttestors([]string{nameOrType})
if err != nil {
return nil, err
}
return attestors[0], nil
}

// Deprecated: use AddAttestors instead
func Attestors(nameOrTypes []string) ([]Attestor, error) {
return AddAttestors(nameOrTypes)
}

func AddAttestors(nameOrTypes []string) ([]Attestor, error) {
Copy link
Collaborator

@kairoaraujo kairoaraujo Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it breaks compatibility with previous versions. (I see you fix it in in-toto/witness#332)
How will we document for other users of go-witness?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we would need to keep a func Attestors with a deprecation notice that just calls AddAttestors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One quick thing -- The Attestors function currently would be more equivalent to a GetAttestors function -- it's returning a slice of instantiated Attestors from the factory.

AddAttestor, to me, seems to imply we're adding more attestors to the factory.

attestors := make([]Attestor, 0)
for _, nameOrType := range nameOrTypes {
factory, ok := FactoryByName(nameOrType)
Expand Down
Loading