Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format go imports (flyteadmin) #4227

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions flyteadmin/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ linters:
- deadcode
- errcheck
- gas
- gci
- goconst
- goimports
- golint
Expand All @@ -25,3 +26,13 @@ linters:
- unparam
- unused
- varcheck

linters-settings:
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/flyteorg)
skip-generated: true

8 changes: 4 additions & 4 deletions flyteadmin/auth/auth_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"strings"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"

"github.com/coreos/go-oidc"
"golang.org/x/oauth2"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
"golang.org/x/oauth2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/auth/authzserver/authorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"net/http"
"time"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/ory/fosite"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flytestdlib/logger"
)
Expand Down
14 changes: 5 additions & 9 deletions flyteadmin/auth/authzserver/authorize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ import (
"net/http/httptest"
"testing"

config2 "github.com/flyteorg/flyte/flytestdlib/config"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/ory/fosite"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"

"github.com/ory/fosite"

"github.com/stretchr/testify/assert"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"
config2 "github.com/flyteorg/flyte/flytestdlib/config"
)

func TestAuthEndpoint(t *testing.T) {
Expand Down
8 changes: 3 additions & 5 deletions flyteadmin/auth/authzserver/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ package authzserver
import (
"crypto/rsa"

"github.com/ory/fosite/handler/oauth2"

"github.com/ory/fosite"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"

"github.com/ory/fosite/compose"
"github.com/ory/fosite/handler/oauth2"
"github.com/ory/fosite/token/jwt"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
)

// RegisterHandlers registers http endpoints for handling OAuth2 flow (/authorize,
Expand Down
4 changes: 1 addition & 3 deletions flyteadmin/auth/authzserver/initialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package authzserver
import (
"testing"

"github.com/ory/fosite/storage"

"github.com/ory/fosite/compose"

"github.com/ory/fosite/storage"
"github.com/stretchr/testify/mock"

"github.com/flyteorg/flyte/flyteadmin/auth"
Expand Down
8 changes: 3 additions & 5 deletions flyteadmin/auth/authzserver/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import (
"fmt"
"net/http"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"

"github.com/lestrrat-go/jwx/jwk"

"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

var (
Expand Down
2 changes: 0 additions & 2 deletions flyteadmin/auth/authzserver/metadata_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import (
"strings"

"github.com/flyteorg/flyte/flyteadmin/auth"

authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
)

Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/auth/authzserver/metadata_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"strings"
"testing"

config2 "github.com/flyteorg/flyte/flytestdlib/config"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/stretchr/testify/assert"
config2 "github.com/flyteorg/flyte/flytestdlib/config"
)

func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions flyteadmin/auth/authzserver/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"net/http/httptest"
"testing"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"
"github.com/lestrrat-go/jwx/jwk"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteadmin/auth"

"github.com/stretchr/testify/assert"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"
)

func Test_newJSONWebKeySet(t *testing.T) {
Expand Down
26 changes: 10 additions & 16 deletions flyteadmin/auth/authzserver/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,21 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flytestdlib/logger"

"k8s.io/apimachinery/pkg/util/sets"

"github.com/lestrrat-go/jwx/jwk"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"

jwtgo "github.com/golang-jwt/jwt/v4"
"github.com/lestrrat-go/jwx/jwk"
"github.com/ory/fosite"
"github.com/ory/fosite/compose"
fositeOAuth2 "github.com/ory/fosite/handler/oauth2"
"github.com/ory/fosite/storage"
"github.com/ory/fosite/token/jwt"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"

"github.com/ory/fosite"
"github.com/ory/fosite/compose"
"github.com/ory/fosite/storage"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

const (
Expand Down
4 changes: 1 addition & 3 deletions flyteadmin/auth/authzserver/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ import (
"time"

jwtgo "github.com/golang-jwt/jwt/v4"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"

"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
)

Expand Down
8 changes: 3 additions & 5 deletions flyteadmin/auth/authzserver/resource_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ import (
"net/url"
"strings"

"github.com/coreos/go-oidc"
jwtgo "github.com/golang-jwt/jwt/v4"

"golang.org/x/oauth2"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyte/flytestdlib/config"

"github.com/coreos/go-oidc"
authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"golang.org/x/oauth2"
"github.com/flyteorg/flyte/flytestdlib/config"
)

// External auth server implementation
Expand Down
6 changes: 2 additions & 4 deletions flyteadmin/auth/authzserver/resource_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import (
"testing"
"time"

"github.com/coreos/go-oidc"
"github.com/golang-jwt/jwt/v4"

"github.com/stretchr/testify/assert"

"github.com/lestrrat-go/jwx/jwk"
"github.com/stretchr/testify/assert"

"github.com/coreos/go-oidc"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
authConfig "github.com/flyteorg/flyte/flyteadmin/auth/config"
stdlibConfig "github.com/flyteorg/flyte/flytestdlib/config"
Expand Down
12 changes: 5 additions & 7 deletions flyteadmin/auth/authzserver/stateless_token_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ import (
"strings"
"time"

"github.com/flyteorg/flyte/flyteadmin/auth"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/ory/fosite"
"github.com/ory/fosite/handler/oauth2"
oauth22 "github.com/ory/fosite/handler/oauth2"
"github.com/ory/fosite/storage"
"github.com/ory/fosite/token/jwt"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/ory/fosite"
"github.com/ory/fosite/storage"
"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions flyteadmin/auth/authzserver/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (

"github.com/ory/fosite"

"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

var (
Expand Down
4 changes: 1 addition & 3 deletions flyteadmin/auth/authzserver/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import (
"time"

jwtgo "github.com/golang-jwt/jwt/v4"

"github.com/flyteorg/flyte/flyteadmin/auth/config"

"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"
)

Expand Down
5 changes: 3 additions & 2 deletions flyteadmin/auth/authzserver/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"encoding/base64"
"net/http"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/gtank/cryptopasta"
"github.com/ory/fosite"

"github.com/flyteorg/flyte/flyteadmin/auth"
"github.com/flyteorg/flyte/flyteadmin/auth/config"
)

func interfaceSliceToStringSlice(raw []interface{}) []string {
Expand Down
10 changes: 4 additions & 6 deletions flyteadmin/auth/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import (
"path/filepath"
"testing"

"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"

"github.com/ghodss/yaml"
"github.com/ory/fosite"
"github.com/stretchr/testify/assert"

"github.com/ory/fosite"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

func TestHashFlyteClientSecret(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/auth/cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"net/url"
"time"

"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/gorilla/securecookie"

"github.com/flyteorg/flyte/flyteadmin/auth/interfaces"
"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions flyteadmin/auth/cookie_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"net/http"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
"golang.org/x/oauth2"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

type CookieManager struct {
Expand Down
3 changes: 1 addition & 2 deletions flyteadmin/auth/cookie_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import (
"testing"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/oauth2"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
)

func TestCookieManager(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions flyteadmin/auth/cookie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"net/url"
"testing"

"github.com/gorilla/securecookie"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteadmin/auth/config"
"github.com/flyteorg/flyte/flyteadmin/auth/interfaces/mocks"
stdConfig "github.com/flyteorg/flyte/flytestdlib/config"
"github.com/gorilla/securecookie"
"github.com/stretchr/testify/assert"
)

func mustParseURL(t testing.TB, u string) url.URL {
Expand Down
Loading
Loading