Skip to content

Commit

Permalink
WIP: Migrating Go module to in-toto (#101)
Browse files Browse the repository at this point in the history
* changing module name and imports
* Change archivista api usage to in-toto/archivista/pkg/api

Signed-off-by: John Kjell <[email protected]>

---------

Signed-off-by: chaosinthecrd <[email protected]>
Signed-off-by: John Kjell <[email protected]>
Co-authored-by: John Kjell <[email protected]>
  • Loading branch information
ChaosInTheCRD and jkjell authored Dec 14, 2023
1 parent c555ac6 commit 5b5647c
Show file tree
Hide file tree
Showing 60 changed files with 165 additions and 162 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This library is currently pre-1.0 and therefore the API may be subject to breaki
- A selection of attestation sources to search for attestation collections

## Documentation
For more detail regarding the library itself, we recommend viewing [pkg.go.dev](https://pkg.go.dev/github.com/testifysec/go-witness). For
For more detail regarding the library itself, we recommend viewing [pkg.go.dev](https://pkg.go.dev/github.com/in-toto/go-witness). For
the documentation of the witness project, please view [the main witness repository](https://github.com/in-toto/witness/tree/main/docs).

## Requirements
Expand Down
4 changes: 2 additions & 2 deletions archivista/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package archivista
import (
"context"

archivistaapi "github.com/testifysec/archivista-api"
"github.com/testifysec/go-witness/dsse"
archivistaapi "github.com/in-toto/archivista/pkg/api"
"github.com/in-toto/go-witness/dsse"
)

func (c *Client) Download(ctx context.Context, gitoid string) (dsse.Envelope, error) {
Expand Down
2 changes: 1 addition & 1 deletion archivista/searchgitoids.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package archivista
import (
"context"

archivistaapi "github.com/testifysec/archivista-api"
archivistaapi "github.com/in-toto/archivista/pkg/api"
)

type searchGitoidResponse struct {
Expand Down
4 changes: 2 additions & 2 deletions archivista/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package archivista
import (
"context"

archivistaapi "github.com/testifysec/archivista-api"
"github.com/testifysec/go-witness/dsse"
archivistaapi "github.com/in-toto/archivista/pkg/api"
"github.com/in-toto/go-witness/dsse"
)

func (c *Client) Store(ctx context.Context, env dsse.Envelope) (string, error) {
Expand Down
10 changes: 5 additions & 5 deletions attestation/aws-iid/aws-iid.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

const (
Expand All @@ -42,8 +42,8 @@ const (
const (
docPath = "instance-identity/document"
sigPath = "instance-identity/signature"
//https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/verify-signature.html
//The following AWS public certificate is for all AWS Regions, except Hong Kong, Bahrain, China, and GovCloud.
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/verify-signature.html
// The following AWS public certificate is for all AWS Regions, except Hong Kong, Bahrain, China, and GovCloud.
awsCACertPEM = `-----BEGIN CERTIFICATE-----
MIIDIjCCAougAwIBAgIJAKnL4UEDMN/FMA0GCSqGSIb3DQEBBQUAMGoxCzAJBgNV
BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRgw
Expand Down
4 changes: 2 additions & 2 deletions attestation/aws-iid/aws-iid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
)

const iid = `{
Expand Down
2 changes: 1 addition & 1 deletion attestation/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"time"

"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/cryptoutil"
)

const CollectionType = "https://witness.testifysec.com/attestation-collection/v0.1"
Expand Down
6 changes: 3 additions & 3 deletions attestation/commandrun/commandrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"os"
"os/exec"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/environment"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/environment"
"github.com/in-toto/go-witness/cryptoutil"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions attestation/commandrun/tracing_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"strconv"
"strings"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/environment"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/environment"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion attestation/commandrun/tracing_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"os/exec"

"github.com/testifysec/go-witness/attestation"
"github.com/in-toto/go-witness/attestation"
)

func enableTracing(c *exec.Cmd) {
Expand Down
4 changes: 2 additions & 2 deletions attestation/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"os"
"time"

"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

type RunType string
Expand Down
2 changes: 1 addition & 1 deletion attestation/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"runtime"
"strings"

"github.com/testifysec/go-witness/attestation"
"github.com/in-toto/go-witness/attestation"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion attestation/environment/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"os"
"testing"

"github.com/in-toto/go-witness/attestation"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
)

func TestEnvironment(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions attestation/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package attestation
import (
"fmt"

"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/registry"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/registry"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions attestation/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"path/filepath"

"github.com/edwarnicke/gitoid"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

// recordArtifacts will walk basePath and record the digests of each file with each of the functions in hashes.
Expand Down
2 changes: 1 addition & 1 deletion attestation/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"path/filepath"
"testing"

"github.com/in-toto/go-witness/cryptoutil"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/cryptoutil"
)

func TestBrokenSymlink(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions attestation/gcp-iit/gcp-iit.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"net/url"
"strings"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/jwt"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/jwt"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
4 changes: 2 additions & 2 deletions attestation/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion attestation/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/in-toto/go-witness/attestation"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
)

func TestNew(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions attestation/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"strings"

"github.com/davecgh/go-spew/spew"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/jwt"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/jwt"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions attestation/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"os"
"strings"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/jwt"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/jwt"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion attestation/jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"net/http"

"github.com/testifysec/go-witness/attestation"
"github.com/in-toto/go-witness/attestation"
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2/jwt"
)
Expand Down
6 changes: 3 additions & 3 deletions attestation/material/material.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package material
import (
"encoding/json"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/file"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/file"
"github.com/in-toto/go-witness/cryptoutil"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions attestation/maven/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"io"
"os"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion attestation/maven/maven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"path/filepath"
"testing"

"github.com/in-toto/go-witness/attestation"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
)

func writeTempPomXml(t *testing.T) (string, error) {
Expand Down
6 changes: 3 additions & 3 deletions attestation/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"os"
"strings"

"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions attestation/oci/oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"os"
"testing"

"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
)

type testProducter struct {
Expand Down
8 changes: 4 additions & 4 deletions attestation/product/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"path/filepath"

"github.com/gobwas/glob"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/attestation/file"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/registry"
"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/attestation/file"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/registry"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions attestation/product/product_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"strings"
"testing"

"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
)

func TestFromDigestMap(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions attestation/sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"os"
"strings"

"github.com/in-toto/go-witness/attestation"
"github.com/in-toto/go-witness/cryptoutil"
"github.com/in-toto/go-witness/log"
"github.com/owenrumney/go-sarif/sarif"
"github.com/testifysec/go-witness/attestation"
"github.com/testifysec/go-witness/cryptoutil"
"github.com/testifysec/go-witness/log"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion dsse/dsse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"testing"
"time"

"github.com/in-toto/go-witness/cryptoutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/testifysec/go-witness/cryptoutil"
)

func createRsaKey() (*rsa.PrivateKey, *rsa.PublicKey, error) {
Expand Down
2 changes: 1 addition & 1 deletion dsse/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"io"

"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/cryptoutil"
)

type Timestamper interface {
Expand Down
2 changes: 1 addition & 1 deletion dsse/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"io"
"time"

"github.com/testifysec/go-witness/cryptoutil"
"github.com/in-toto/go-witness/cryptoutil"
)

type TimestampVerifier interface {
Expand Down
Loading

0 comments on commit 5b5647c

Please sign in to comment.