Skip to content

Commit

Permalink
chore(attestation): Move attestation to pkg (chainloop-dev#1195)
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
  • Loading branch information
javirln authored Aug 7, 2024
1 parent dd42b5d commit 902fc7f
Show file tree
Hide file tree
Showing 145 changed files with 116 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ API_PROTO_FILES=$(shell find api -name *.proto)
.PHONY: api
# generate api proto
api:
cd ./internal/attestation/crafter/api && buf generate
cd ./pkg/attestation/crafter/api && buf generate
make -C ./app/controlplane api
make -C ./app/artifact-cas api

Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/workflow_workflow_run_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"time"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
"github.com/muesli/reflow/wrap"
Expand Down
6 changes: 3 additions & 3 deletions app/cli/internal/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"time"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/statemanager/filesystem"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/statemanager/remote"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/statemanager/filesystem"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/statemanager/remote"
"github.com/rs/zerolog"
"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/attestation_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/internal/casclient"
"github.com/chainloop-dev/chainloop/internal/grpcconn"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
"google.golang.org/grpc"
)

Expand Down
4 changes: 2 additions & 2 deletions app/cli/internal/action/attestation_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"strconv"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
clientAPI "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
clientAPI "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
)

type AttestationInitOpts struct {
Expand Down
6 changes: 3 additions & 3 deletions app/cli/internal/action/attestation_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"time"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer"
"github.com/chainloop-dev/chainloop/internal/attestation/signer"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer"
"github.com/chainloop-dev/chainloop/pkg/attestation/signer"
"github.com/secure-systems-lab/go-securesystemslib/dsse"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/attestation_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
"github.com/go-kratos/kratos/v2/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions app/cli/internal/action/attestation_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"time"

pbc "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
)

type AttestationStatusOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/attestation_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

craftingpb "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/workflow_contract_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"context"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
)

type WorkflowContractCreate struct {
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/workflow_contract_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"context"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
)

type WorkflowContractUpdate struct {
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/workflow_run_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sort"

pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/sigstore/cosign/v2/pkg/blob"
"github.com/sigstore/cosign/v2/pkg/cosign"
sigs "github.com/sigstore/cosign/v2/pkg/signature"
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"runtime"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
"github.com/denisbrodbeck/machineid"
"github.com/rs/zerolog"
)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/controlplane/internal/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/credentials"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"
Expand Down
4 changes: 2 additions & 2 deletions app/controlplane/internal/service/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"github.com/chainloop-dev/chainloop/app/controlplane/internal/usercontext"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/usercontext/attjwtmiddleware"
"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
casJWT "github.com/chainloop-dev/chainloop/internal/robotaccount/cas"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/credentials"

errors "github.com/go-kratos/kratos/v2/errors"
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/internal/service/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

cpAPI "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
crv1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/pkg/biz/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"io"

"github.com/chainloop-dev/chainloop/internal/attestation"
"github.com/chainloop-dev/chainloop/pkg/attestation"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"

Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/pkg/biz/attestationstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"fmt"
"io"

v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/google/uuid"
"golang.org/x/crypto/pbkdf2"
"google.golang.org/protobuf/proto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"
"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz/testhelpers"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/credentials"
creds "github.com/chainloop-dev/chainloop/pkg/credentials/mocks"
"github.com/google/uuid"
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/pkg/biz/casmapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"time"

"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"
cr_v1 "github.com/google/go-containerregistry/pkg/v1"
Expand Down
4 changes: 2 additions & 2 deletions app/controlplane/pkg/biz/referrer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"time"

conf "github.com/chainloop-dev/chainloop/app/controlplane/internal/conf/controlplane/config/v1"
"github.com/chainloop-dev/chainloop/internal/attestation"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"
"github.com/google/uuid"
Expand Down
4 changes: 2 additions & 2 deletions app/controlplane/pkg/biz/workflowrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"time"

"github.com/chainloop-dev/chainloop/app/controlplane/internal/pagination"
"github.com/chainloop-dev/chainloop/internal/attestation"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/secure-systems-lab/go-securesystemslib/dsse"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/plugins/sdk/v1/fanout.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
crv1 "github.com/google/go-containerregistry/pkg/v1"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"
intoto "github.com/in-toto/attestation/go/v1"
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/plugins/sdk/v1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sort"
"time"

"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/muesli/reflow/wrap"
)
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/plugins/sdk/v1/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"
"time"

"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/secure-systems-lab/go-securesystemslib/dsse"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/plugins/sdk/v1/plugin/api/translation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
cr_v1 "github.com/google/go-containerregistry/pkg/v1"
status "google.golang.org/grpc/status"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/plugins/sdk/v1/plugin/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1"
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1/plugin/api"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/secure-systems-lab/go-securesystemslib/dsse"
)

Expand Down
2 changes: 1 addition & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ directories:
- app/artifact-cas/internal/conf
- app/artifact-cas/api
- pkg/credentials/api
- internal/attestation/crafter/api
- pkg/attestation/crafter/api
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
import "workflowcontract/v1/crafting_schema.proto";

option go_package = "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1";
option go_package = "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1";

message Attestation {
google.protobuf.Timestamp initialized_at = 1 [(buf.validate.field).required = true];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"github.com/bufbuild/protovalidate-go"
v1 "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
api "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/materials"
"github.com/chainloop-dev/chainloop/internal/casclient"
"github.com/chainloop-dev/chainloop/internal/ociauth"
api "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/materials"
"github.com/chainloop-dev/chainloop/pkg/policies"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"time"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter"
v1 "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/materials"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/runners"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/statemanager/filesystem"
"github.com/chainloop-dev/chainloop/internal/casclient"
mUploader "github.com/chainloop-dev/chainloop/internal/casclient/mocks"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter"
v1 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/materials"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/runners"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/statemanager/filesystem"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"fmt"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
api "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/casclient"
api "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/rs/zerolog"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (

"code.cloudfoundry.org/bytefmt"
contractAPI "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
attestationApi "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/crafter/materials"
"github.com/chainloop-dev/chainloop/internal/casclient"
mUploader "github.com/chainloop-dev/chainloop/internal/casclient/mocks"
attestationApi "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/crafter/materials"
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"path"

schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/internal/attestation"
api "github.com/chainloop-dev/chainloop/internal/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/internal/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/internal/casclient"
"github.com/chainloop-dev/chainloop/pkg/attestation"
api "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/rs/zerolog"
"github.com/secure-systems-lab/go-securesystemslib/dsse"
)
Expand Down
Loading

0 comments on commit 902fc7f

Please sign in to comment.