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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue