-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEP 0122: complete build instuctions: adding taskspec to buildConfig
This PR introduces a new format in-toto-v2 which contains the complete build instructions as designed in TEP0122.
- Loading branch information
1 parent
7015e14
commit 7eeae60
Showing
25 changed files
with
1,038 additions
and
30 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
File renamed without changes.
File renamed without changes.
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
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
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,64 @@ | ||
/* | ||
Copyright 2021 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 intotoite6v2 | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/tektoncd/chains/pkg/chains/formats" | ||
intotoite6v2tr "github.com/tektoncd/chains/pkg/chains/formats/intotoite6v2/taskrun" | ||
"github.com/tektoncd/chains/pkg/chains/objects" | ||
"github.com/tektoncd/chains/pkg/config" | ||
"knative.dev/pkg/logging" | ||
) | ||
|
||
const ( | ||
PayloadTypeInTotoIte6V2 = formats.PayloadTypeInTotoIte6V2 | ||
) | ||
|
||
func init() { | ||
formats.RegisterPayloader(PayloadTypeInTotoIte6V2, NewFormatter) | ||
} | ||
|
||
type InTotoIte6V2 struct { | ||
builderID string | ||
} | ||
|
||
func NewFormatter(cfg config.Config) (formats.Payloader, error) { | ||
return &InTotoIte6V2{ | ||
builderID: cfg.Builder.ID, | ||
}, nil | ||
} | ||
|
||
func (i *InTotoIte6V2) Wrap() bool { | ||
return true | ||
} | ||
|
||
func (i *InTotoIte6V2) CreatePayload(ctx context.Context, obj interface{}) (interface{}, error) { | ||
logger := logging.FromContext(ctx) | ||
switch v := obj.(type) { | ||
case *objects.TaskRunObject: | ||
return intotoite6v2tr.GenerateAttestation(i.builderID, v, logger) | ||
default: | ||
return nil, fmt.Errorf("intoto does not support type: %s", v) | ||
} | ||
} | ||
|
||
func (i *InTotoIte6V2) Type() config.PayloadType { | ||
return formats.PayloadTypeInTotoIte6V2 | ||
} |
Oops, something went wrong.