-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Generalize format loading. This refactors how formatters are initialized and configured to be more uniform. This allows for formatter providers to be more easily slotted in / configured without needing to make modifications for downstream signers. The ultimate goal for this change is to allow for "type aliasing" of formatters, where the same formatter may be referenced by different names to allow for supporting new formats in a backwards compatible way (i.e. letting slsa be an alias for intoto or slsa0.2, etc.) This follows a similar pattern to sigstore KMS providers - https://github.com/sigstore/sigstore/tree/main/pkg/signature/kms As part of this change, the way to initialize a formatter is standardized. To support this, the intoto logger that was previously configured during initialization is now taken from the context. BREAKING CHANGES: - formats.PayloadType is now defined in config rather than formats. The semantics behind this value are still the same. - CreatePayload now takes in a context. - InTotoIte6.NewFormatter no longer takes in a logger. - formats.AllFormatters is removed. Use formats.GetPayloader instead. Signed-off-by: Billy Lynch <billy@chainguard.dev> * Add formatter loaders to controllers. Signed-off-by: Billy Lynch <billy@chainguard.dev>
- Loading branch information
Showing
14 changed files
with
146 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2022 The Tekton Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package all | ||
|
||
import ( | ||
_ "github.com/tektoncd/chains/pkg/chains/formats/intotoite6" | ||
_ "github.com/tektoncd/chains/pkg/chains/formats/simple" | ||
_ "github.com/tektoncd/chains/pkg/chains/formats/tekton" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.