Move ./internal/oidcclient to ./pkg/oidcclient.

This will allow it to be imported by Go code outside of our repository, which was something we have planned for since this code was written.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2020-11-17 12:46:54 -06:00
parent 428b9f2758
commit e0a9bef6ce
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D
24 changed files with 25 additions and 24 deletions

View File

@ -13,6 +13,7 @@ RUN go mod download
# Copy only the production source code to avoid cache misses when editing other files # Copy only the production source code to avoid cache misses when editing other files
COPY generated ./generated COPY generated ./generated
COPY cmd ./cmd COPY cmd ./cmd
COPY pkg ./pkg
COPY internal ./internal COPY internal ./internal
COPY tools ./tools COPY tools ./tools
COPY hack ./hack COPY hack ./hack

View File

@ -18,8 +18,8 @@ import (
clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
"k8s.io/klog/v2/klogr" "k8s.io/klog/v2/klogr"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
"go.pinniped.dev/internal/oidcclient/filesession" "go.pinniped.dev/pkg/oidcclient/filesession"
) )
//nolint: gochecknoinits //nolint: gochecknoinits

View File

@ -12,7 +12,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"go.pinniped.dev/internal/here" "go.pinniped.dev/internal/here"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
) )
func TestLoginOIDCCommand(t *testing.T) { func TestLoginOIDCCommand(t *testing.T) {

View File

@ -19,9 +19,9 @@ import (
"go.pinniped.dev/internal/httputil/httperr" "go.pinniped.dev/internal/httputil/httperr"
"go.pinniped.dev/internal/oidc/csrftoken" "go.pinniped.dev/internal/oidc/csrftoken"
"go.pinniped.dev/internal/oidc/provider" "go.pinniped.dev/internal/oidc/provider"
"go.pinniped.dev/internal/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce"
"go.pinniped.dev/internal/plog" "go.pinniped.dev/internal/plog"
"go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/pkg/oidcclient/pkce"
) )
const ( const (

View File

@ -21,8 +21,8 @@ import (
"go.pinniped.dev/internal/oidc" "go.pinniped.dev/internal/oidc"
"go.pinniped.dev/internal/oidc/csrftoken" "go.pinniped.dev/internal/oidc/csrftoken"
"go.pinniped.dev/internal/oidc/provider" "go.pinniped.dev/internal/oidc/provider"
"go.pinniped.dev/internal/oidcclient/nonce" "go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce" "go.pinniped.dev/pkg/oidcclient/pkce"
) )
func TestAuthorizationEndpoint(t *testing.T) { func TestAuthorizationEndpoint(t *testing.T) {

View File

@ -16,9 +16,9 @@ import (
"go.pinniped.dev/internal/oidc/discovery" "go.pinniped.dev/internal/oidc/discovery"
"go.pinniped.dev/internal/oidc/jwks" "go.pinniped.dev/internal/oidc/jwks"
"go.pinniped.dev/internal/oidc/provider" "go.pinniped.dev/internal/oidc/provider"
"go.pinniped.dev/internal/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce"
"go.pinniped.dev/internal/plog" "go.pinniped.dev/internal/plog"
"go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/pkg/oidcclient/pkce"
) )
// Manager can manage multiple active OIDC providers. It acts as a request router for them. // Manager can manage multiple active OIDC providers. It acts as a request router for them.

View File

@ -16,7 +16,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
) )
var ( var (

View File

@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
) )
// validSession should be the same data as `testdata/valid.yaml`. // validSession should be the same data as `testdata/valid.yaml`.

View File

@ -15,7 +15,7 @@ import (
"github.com/gofrs/flock" "github.com/gofrs/flock"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
) )
const ( const (

View File

@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
) )
func TestNew(t *testing.T) { func TestNew(t *testing.T) {

View File

@ -20,9 +20,9 @@ import (
"go.pinniped.dev/internal/httputil/httperr" "go.pinniped.dev/internal/httputil/httperr"
"go.pinniped.dev/internal/httputil/securityheader" "go.pinniped.dev/internal/httputil/securityheader"
"go.pinniped.dev/internal/oidcclient/nonce" "go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce" "go.pinniped.dev/pkg/oidcclient/pkce"
"go.pinniped.dev/internal/oidcclient/state" "go.pinniped.dev/pkg/oidcclient/state"
) )
const ( const (

View File

@ -23,9 +23,9 @@ import (
"go.pinniped.dev/internal/httputil/httperr" "go.pinniped.dev/internal/httputil/httperr"
"go.pinniped.dev/internal/mocks/mockkeyset" "go.pinniped.dev/internal/mocks/mockkeyset"
"go.pinniped.dev/internal/oidcclient/nonce" "go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce" "go.pinniped.dev/pkg/oidcclient/pkce"
"go.pinniped.dev/internal/oidcclient/state" "go.pinniped.dev/pkg/oidcclient/state"
) )
// mockSessionCache exists to avoid an import cycle if we generate mocks into another package. // mockSessionCache exists to avoid an import cycle if we generate mocks into another package.

View File

@ -26,8 +26,8 @@ import (
"gopkg.in/square/go-jose.v2" "gopkg.in/square/go-jose.v2"
clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
"go.pinniped.dev/internal/oidcclient" "go.pinniped.dev/pkg/oidcclient"
"go.pinniped.dev/internal/oidcclient/filesession" "go.pinniped.dev/pkg/oidcclient/filesession"
"go.pinniped.dev/test/library" "go.pinniped.dev/test/library"
) )

View File

@ -19,9 +19,9 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1" idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
"go.pinniped.dev/internal/oidcclient/nonce" "go.pinniped.dev/pkg/oidcclient/nonce"
"go.pinniped.dev/internal/oidcclient/pkce" "go.pinniped.dev/pkg/oidcclient/pkce"
"go.pinniped.dev/internal/oidcclient/state" "go.pinniped.dev/pkg/oidcclient/state"
"go.pinniped.dev/test/library" "go.pinniped.dev/test/library"
) )