Skip to content

Commit

Permalink
vendor plugin sdk
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle McCullough <[email protected]>
  • Loading branch information
kylemcc committed Oct 21, 2024
1 parent b211c9d commit d0490a4
Show file tree
Hide file tree
Showing 1,253 changed files with 31,840 additions and 3,354 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ linters-settings:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
goimports:
local-prefixes: github.com/OpsHelmInc
errcheck:
check-blank: false
ignore: fmt:.*,[rR]ead|[wW]rite|[cC]lose,io:Copy
Expand Down Expand Up @@ -81,6 +83,7 @@ linters:
- errcheck
- gocritic
- gofmt
- goimports
- gosimple
- govet
- ineffassign
Expand Down
6 changes: 4 additions & 2 deletions client/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"errors"
"strings"

"github.com/OpsHelmInc/cloudquery/v2/client/services"
"github.com/OpsHelmInc/cloudquery/v2/client/spec"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/arn"
"github.com/aws/aws-sdk-go-v2/service/ec2"
Expand All @@ -15,6 +13,9 @@ import (
"github.com/aws/smithy-go"
"github.com/rs/zerolog"
"github.com/thoas/go-funk"

"github.com/OpsHelmInc/cloudquery/v2/client/services"
"github.com/OpsHelmInc/cloudquery/v2/client/spec"
)

type svcsDetail struct {
Expand Down Expand Up @@ -198,6 +199,7 @@ func verifyRegions(regions []string) error {
}
return nil
}

func isAllRegions(regions []string) bool {
// if regions array is not valid return false
err := verifyRegions(regions)
Expand Down
3 changes: 2 additions & 1 deletion client/aws_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"context"
"time"

"github.com/OpsHelmInc/cloudquery/v2/client/spec"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
"github.com/aws/aws-sdk-go-v2/service/sts"
"github.com/rs/zerolog"

"github.com/OpsHelmInc/cloudquery/v2/client/spec"
)

func ConfigureAwsSDK(ctx context.Context, logger zerolog.Logger, awsPluginSpec *spec.Spec, account spec.Account, stsClient AssumeRoleAPIClient) (aws.Config, error) {
Expand Down
19 changes: 12 additions & 7 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (
"strings"
"sync"

"github.com/OpsHelmInc/cloudquery/v2/client/spec"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/sts"
wafv2types "github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/logging"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/cloudquery/plugin-sdk/v4/state"
"github.com/rs/zerolog"
"golang.org/x/sync/errgroup"

"github.com/OpsHelmInc/cloudquery/v2/client/spec"
"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/schema"
"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/state"
)

type Client struct {
Expand Down Expand Up @@ -51,10 +52,13 @@ const (
awsCnCloudfrontScopeRegion = "cn-north-1"
)

var errInvalidRegion = errors.New("region wildcard \"*\" is only supported as first argument")
var errUnknownRegion = func(region string) error {
return fmt.Errorf("unknown region: %q", region)
}
var (
errInvalidRegion = errors.New("region wildcard \"*\" is only supported as first argument")
errUnknownRegion = func(region string) error {
return fmt.Errorf("unknown region: %q", region)
}
)

var errRetrievingCredentials = errors.New("error retrieving AWS credentials (see logs for details). Please verify your credentials and try again")

var ErrPaidAPIsNotEnabled = errors.New("not fetching resource because `use_paid_apis` is set to false")
Expand Down Expand Up @@ -102,6 +106,7 @@ func (c *Client) updateService(service AWSServiceName) {
c.ServicesManager.ServicesByPartitionAccount(c.Partition, c.AccountID).InitService(service)
}
}

func (c *Client) Services(service_names ...AWSServiceName) *Services {
for _, service := range service_names {
c.updateService(service)
Expand Down
3 changes: 2 additions & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
"os"
"testing"

"github.com/OpsHelmInc/cloudquery/v2/client/mocks"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/smithy-go"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/rs/zerolog"

"github.com/OpsHelmInc/cloudquery/v2/client/mocks"
)

func Test_findEnabledRegions(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion client/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package client

import (
"github.com/apache/arrow/go/v16/arrow"
"github.com/cloudquery/plugin-sdk/v4/schema"

"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/schema"
)

func DefaultAccountIDColumn(pk bool) schema.Column {
Expand Down
5 changes: 3 additions & 2 deletions client/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (

"github.com/aws/aws-sdk-go-v2/aws/arn"
"github.com/aws/smithy-go"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/cloudquery/plugin-sdk/v4/transformers"

"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/schema"
"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/transformers"
)

type AWSService string
Expand Down
5 changes: 3 additions & 2 deletions client/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
ttypes "github.com/aws/aws-sdk-go-v2/service/acm/types"
"github.com/aws/aws-sdk-go-v2/service/apigateway/types"
"github.com/cloudquery/plugin-sdk/v4/scalar"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/scalar"
"github.com/OpsHelmInc/cloudquery/v2/plugin-sdk/schema"
)

func TestResolveARN(t *testing.T) {
Expand Down
60 changes: 60 additions & 0 deletions client/mocks/codepipeline.go

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

30 changes: 30 additions & 0 deletions client/mocks/ec2.go

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

60 changes: 60 additions & 0 deletions client/mocks/ecr.go

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

Loading

0 comments on commit d0490a4

Please sign in to comment.