chore(next): v4 module for development
This commit is contained in:
parent
5cdb65c30b
commit
14e8529b68
98 changed files with 217 additions and 217 deletions
|
@ -12,9 +12,9 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
"github.com/zitadel/logging"
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"go.opentelemetry.io/otel"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
|
|
@ -23,14 +23,14 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/zitadel/oidc/v3/example/server/exampleop"
|
||||
"github.com/zitadel/oidc/v3/example/server/storage"
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rs"
|
||||
"github.com/zitadel/oidc/v3/pkg/client/tokenexchange"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/example/server/exampleop"
|
||||
"github.com/zitadel/oidc/v4/example/server/storage"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rs"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/tokenexchange"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
var Logger = slog.New(
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// JWTProfileExchange handles the oauth2 jwt profile exchange
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
jose "github.com/go-jose/go-jose/v3"
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type TokenSource interface {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rp"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package rp
|
||||
|
||||
import (
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc/grants/tokenexchange"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc/grants/tokenexchange"
|
||||
)
|
||||
|
||||
// DelegationTokenRequest is an implementation of TokenExchangeRequest
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func newDeviceClientCredentialsRequest(scopes []string, rp RelyingParty) (*oidc.ClientCredentialsRequest, error) {
|
||||
|
|
|
@ -9,9 +9,9 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func NewRemoteKeySet(client *http.Client, jwksURL string, opts ...func(*remoteKeySet)) oidc.KeySet {
|
||||
|
|
|
@ -15,9 +15,9 @@ import (
|
|||
"golang.org/x/oauth2/clientcredentials"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc/grants/tokenexchange"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc/grants/tokenexchange"
|
||||
)
|
||||
|
||||
// TokenExchangeRP extends the `RelyingParty` interface for the *draft* oauth2 `Token Exchange`
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type UserInfo struct {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// VerifyTokens implement the Token Response Validation as defined in OIDC specification
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
jose "github.com/go-jose/go-jose/v3"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func TestVerifyTokens(t *testing.T) {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// MyCustomClaims extends the TokenClaims base,
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rs"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client/rs"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type IntrospectionResponse struct {
|
||||
|
|
|
@ -6,9 +6,9 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type ResourceServer interface {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func TestNewResourceServer(t *testing.T) {
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-jose/go-jose/v3"
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type TokenExchanger interface {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
)
|
||||
|
||||
func TestBytesToPrivateKey(tt *testing.T) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
var DefaultHTTPClient = &http.Client{
|
||||
|
|
|
@ -3,7 +3,7 @@ package oidc
|
|||
import (
|
||||
"crypto/sha256"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/muhlemmer/gu"
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
str "github.com/zitadel/oidc/v3/pkg/strings"
|
||||
str "github.com/zitadel/oidc/v4/pkg/strings"
|
||||
)
|
||||
|
||||
type Claims interface {
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func TestParseToken(t *testing.T) {
|
||||
|
|
|
@ -15,9 +15,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/bmatcuk/doublestar/v4"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
str "github.com/zitadel/oidc/v3/pkg/strings"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
str "github.com/zitadel/oidc/v4/pkg/strings"
|
||||
)
|
||||
|
||||
type AuthRequest interface {
|
||||
|
|
|
@ -14,12 +14,12 @@ import (
|
|||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/example/server/storage"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v3/pkg/op/mock"
|
||||
"github.com/zitadel/oidc/v4/example/server/storage"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/op/mock"
|
||||
"github.com/zitadel/schema"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"net/url"
|
||||
"time"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
//go:generate go get github.com/dmarkham/enumer
|
||||
|
|
|
@ -13,10 +13,10 @@ import (
|
|||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v3/pkg/op/mock"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/op/mock"
|
||||
"github.com/zitadel/schema"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package op
|
||||
|
||||
import (
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
)
|
||||
|
||||
type Crypto interface {
|
||||
|
|
|
@ -12,9 +12,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
strs "github.com/zitadel/oidc/v3/pkg/strings"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
strs "github.com/zitadel/oidc/v4/pkg/strings"
|
||||
)
|
||||
|
||||
type DeviceAuthorizationConfig struct {
|
||||
|
|
|
@ -16,9 +16,9 @@ import (
|
|||
"github.com/muhlemmer/gu"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/example/server/storage"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/example/server/storage"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func Test_deviceAuthorizationHandler(t *testing.T) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type DiscoverStorage interface {
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v3/pkg/op/mock"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/op/mock"
|
||||
)
|
||||
|
||||
func TestDiscover(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func TestEndpoint_Path(t *testing.T) {
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"log/slog"
|
||||
"net/http"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type ErrAuthRequest interface {
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/schema"
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
)
|
||||
|
||||
type KeyProvider interface {
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v3/pkg/op/mock"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/op/mock"
|
||||
)
|
||||
|
||||
func TestKeys(t *testing.T) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: Authorizer)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: Authorizer)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -10,8 +10,8 @@ import (
|
|||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
http "github.com/zitadel/oidc/v3/pkg/http"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
http "github.com/zitadel/oidc/v4/pkg/http"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MockAuthorizer is a mock of Authorizer interface.
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"github.com/golang/mock/gomock"
|
||||
"github.com/zitadel/schema"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func NewAuthorizer(t *testing.T) op.Authorizer {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func NewClient(t *testing.T) op.Client {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: Client)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: Client)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -9,8 +9,8 @@ import (
|
|||
time "time"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
oidc "github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
oidc "github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MockClient is a mock of Client interface.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: Configuration)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: Configuration)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -9,7 +9,7 @@ import (
|
|||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
language "golang.org/x/text/language"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: DiscoverStorage)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: DiscoverStorage)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package mock
|
||||
|
||||
//go:generate go install github.com/golang/mock/mockgen@v1.6.0
|
||||
//go:generate mockgen -package mock -destination ./storage.mock.go github.com/zitadel/oidc/v3/pkg/op Storage
|
||||
//go:generate mockgen -package mock -destination ./authorizer.mock.go github.com/zitadel/oidc/v3/pkg/op Authorizer
|
||||
//go:generate mockgen -package mock -destination ./client.mock.go github.com/zitadel/oidc/v3/pkg/op Client
|
||||
//go:generate mockgen -package mock -destination ./glob.mock.go github.com/zitadel/oidc/v3/pkg/op HasRedirectGlobs
|
||||
//go:generate mockgen -package mock -destination ./configuration.mock.go github.com/zitadel/oidc/v3/pkg/op Configuration
|
||||
//go:generate mockgen -package mock -destination ./discovery.mock.go github.com/zitadel/oidc/v3/pkg/op DiscoverStorage
|
||||
//go:generate mockgen -package mock -destination ./signer.mock.go github.com/zitadel/oidc/v3/pkg/op SigningKey,Key
|
||||
//go:generate mockgen -package mock -destination ./key.mock.go github.com/zitadel/oidc/v3/pkg/op KeyProvider
|
||||
//go:generate mockgen -package mock -destination ./storage.mock.go github.com/zitadel/oidc/v4/pkg/op Storage
|
||||
//go:generate mockgen -package mock -destination ./authorizer.mock.go github.com/zitadel/oidc/v4/pkg/op Authorizer
|
||||
//go:generate mockgen -package mock -destination ./client.mock.go github.com/zitadel/oidc/v4/pkg/op Client
|
||||
//go:generate mockgen -package mock -destination ./glob.mock.go github.com/zitadel/oidc/v4/pkg/op HasRedirectGlobs
|
||||
//go:generate mockgen -package mock -destination ./configuration.mock.go github.com/zitadel/oidc/v4/pkg/op Configuration
|
||||
//go:generate mockgen -package mock -destination ./discovery.mock.go github.com/zitadel/oidc/v4/pkg/op DiscoverStorage
|
||||
//go:generate mockgen -package mock -destination ./signer.mock.go github.com/zitadel/oidc/v4/pkg/op SigningKey,Key
|
||||
//go:generate mockgen -package mock -destination ./key.mock.go github.com/zitadel/oidc/v4/pkg/op KeyProvider
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"testing"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func NewHasRedirectGlobs(t *testing.T) op.HasRedirectGlobs {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: HasRedirectGlobs)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: HasRedirectGlobs)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -9,8 +9,8 @@ import (
|
|||
time "time"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
oidc "github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
oidc "github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MockHasRedirectGlobs is a mock of HasRedirectGlobs interface.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: KeyProvider)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: KeyProvider)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -9,7 +9,7 @@ import (
|
|||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MockKeyProvider is a mock of KeyProvider interface.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: SigningKey,Key)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: SigningKey,Key)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: Storage)
|
||||
// Source: github.com/zitadel/oidc/v4/pkg/op (interfaces: Storage)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
oidc "github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
oidc "github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
op "github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MockStorage is a mock of Storage interface.
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func NewStorage(t *testing.T) op.Storage {
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
"go.opentelemetry.io/otel"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -14,9 +14,9 @@ import (
|
|||
"github.com/muhlemmer/gu"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/zitadel/oidc/v3/example/server/storage"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/example/server/storage"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
)
|
||||
|
||||
type ProbesFn func(context.Context) error
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"net/url"
|
||||
|
||||
"github.com/muhlemmer/gu"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// Server describes the interface that needs to be implemented to serve
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
"github.com/go-chi/chi/v5"
|
||||
"github.com/rs/cors"
|
||||
"github.com/zitadel/logging"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/schema"
|
||||
)
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
"github.com/zitadel/oidc/v4/pkg/client"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func jwtProfile() (string, error) {
|
||||
|
|
|
@ -17,8 +17,8 @@ import (
|
|||
"github.com/muhlemmer/gu"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/schema"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// ExtendedLegacyServer allows embedding [LegacyServer] in a struct,
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"net/url"
|
||||
"path"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type SessionEnder interface {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type AuthStorage interface {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/strings"
|
||||
"github.com/zitadel/oidc/v4/pkg/crypto"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/strings"
|
||||
)
|
||||
|
||||
type TokenCreator interface {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"net/http"
|
||||
"net/url"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// ClientCredentialsExchange handles the OAuth 2.0 client_credentials grant, including
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"net/http"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// CodeExchange handles the OAuth 2.0 authorization_code grant, including
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type TokenExchangeRequest interface {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type Introspector interface {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type JWTAuthorizationGrantExchanger interface {
|
||||
|
|
|
@ -6,9 +6,9 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/strings"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/strings"
|
||||
)
|
||||
|
||||
type RefreshTokenRequest interface {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"net/http"
|
||||
"net/url"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type Exchanger interface {
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"net/url"
|
||||
"strings"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type Revoker interface {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
httphelper "github.com/zitadel/oidc/v4/pkg/http"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type UserinfoProvider interface {
|
||||
|
|
|
@ -3,7 +3,7 @@ package op
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type AccessTokenVerifier oidc.Verifier
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
// MyCustomClaims extends the TokenClaims base,
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func TestNewAccessTokenVerifier(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
type IDTokenHintVerifier oidc.Verifier
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
func TestNewIDTokenHintVerifier(t *testing.T) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
jose "github.com/go-jose/go-jose/v3"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
)
|
||||
|
||||
// JWTProfileVerfiier extends oidc.Verifier with
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
tu "github.com/zitadel/oidc/v3/internal/testutil"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v3/pkg/op"
|
||||
tu "github.com/zitadel/oidc/v4/internal/testutil"
|
||||
"github.com/zitadel/oidc/v4/pkg/oidc"
|
||||
"github.com/zitadel/oidc/v4/pkg/op"
|
||||
)
|
||||
|
||||
func TestNewJWTProfileVerifier(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue