Skip to content

Commit

Permalink
fix: license and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wood-push-melon committed Mar 7, 2024
1 parent 44b4274 commit bd62680
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func ComposeAllEnabled(config *fosite.Config, storage interface{}, key interface
OpenIDConnectTokenStrategy: NewOpenIDConnectStrategy(keyGetter, config),
Signer: &jwt.DefaultSigner{GetPrivateKey: keyGetter},
},
OAuth2AuthorizeExplicitFactory,
OAuth2AuthorizeExplicitAuthFactory,
Oauth2AuthorizeExplicitTokenFactory,
OAuth2AuthorizeImplicitFactory,
OAuth2ClientCredentialsGrantFactory,
Expand Down
4 changes: 2 additions & 2 deletions compose/compose_oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/ory/fosite/token/jwt"
)

// OAuth2AuthorizeExplicitFactory creates an OAuth2 authorize code grant ("authorize explicit flow") handler and registers
// OAuth2AuthorizeExplicitAuthFactory creates an OAuth2 authorize code grant ("authorize explicit flow") handler and registers
// an access token, refresh token and authorize code validator.
func OAuth2AuthorizeExplicitFactory(config fosite.Configurator, storage interface{}, strategy interface{}) interface{} {
func OAuth2AuthorizeExplicitAuthFactory(config fosite.Configurator, storage interface{}, strategy interface{}) interface{} {
return &oauth2.AuthorizeExplicitGrantAuthHandler{
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
AuthorizeCodeStorage: storage.(oauth2.AuthorizeCodeStorage),
Expand Down
3 changes: 3 additions & 0 deletions handler/rfc8628/token_handler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package rfc8628

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func runAuthorizeCodeGrantWithPublicClientAndPKCETest(t *testing.T, strategy int
c := new(fosite.Config)
c.EnforcePKCE = true
c.EnablePKCEPlainChallengeMethod = true
f := compose.Compose(c, fositeStore, strategy, compose.OAuth2AuthorizeExplicitFactory, compose.OAuth2PKCEFactory, compose.OAuth2TokenIntrospectionFactory)
f := compose.Compose(c, fositeStore, strategy, compose.OAuth2AuthorizeExplicitAuthFactory, compose.Oauth2AuthorizeExplicitTokenFactory, compose.OAuth2PKCEFactory, compose.OAuth2TokenIntrospectionFactory)
ts := mockServer(t, f, &fosite.DefaultSession{})
defer ts.Close()

Expand Down
2 changes: 1 addition & 1 deletion integration/authorize_code_grant_public_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestAuthorizeCodeFlowWithPublicClient(t *testing.T) {
}

func runAuthorizeCodeGrantWithPublicClientTest(t *testing.T, strategy interface{}) {
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitFactory, compose.OAuth2TokenIntrospectionFactory)
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitAuthFactory, compose.Oauth2AuthorizeExplicitTokenFactory, compose.OAuth2TokenIntrospectionFactory)
ts := mockServer(t, f, &fosite.DefaultSession{Subject: "foo-sub"})
defer ts.Close()

Expand Down
4 changes: 2 additions & 2 deletions integration/authorize_code_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestAuthorizeCodeFlowDupeCode(t *testing.T) {
}

func runAuthorizeCodeGrantTest(t *testing.T, strategy interface{}) {
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitFactory, compose.OAuth2TokenIntrospectionFactory)
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitAuthFactory, compose.Oauth2AuthorizeExplicitTokenFactory, compose.OAuth2TokenIntrospectionFactory)
ts := mockServer(t, f, &openid.DefaultSession{Subject: "foo-sub"})
defer ts.Close()

Expand Down Expand Up @@ -148,7 +148,7 @@ func runAuthorizeCodeGrantTest(t *testing.T, strategy interface{}) {
}

func runAuthorizeCodeGrantDupeCodeTest(t *testing.T, strategy interface{}) {
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitFactory, compose.OAuth2TokenIntrospectionFactory)
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitAuthFactory, compose.Oauth2AuthorizeExplicitTokenFactory, compose.OAuth2TokenIntrospectionFactory)
ts := mockServer(t, f, &fosite.DefaultSession{})
defer ts.Close()

Expand Down
2 changes: 1 addition & 1 deletion integration/pushed_authorize_code_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestPushedAuthorizeCodeFlow(t *testing.T) {
}

func runPushedAuthorizeCodeGrantTest(t *testing.T, strategy interface{}) {
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitFactory, compose.OAuth2TokenIntrospectionFactory, compose.PushedAuthorizeHandlerFactory)
f := compose.Compose(new(fosite.Config), fositeStore, strategy, compose.OAuth2AuthorizeExplicitAuthFactory, compose.Oauth2AuthorizeExplicitTokenFactory, compose.OAuth2TokenIntrospectionFactory, compose.PushedAuthorizeHandlerFactory)
ts := mockServer(t, f, &fosite.DefaultSession{Subject: "foo-sub"})
defer ts.Close()

Expand Down
3 changes: 3 additions & 0 deletions internal/device_code_rate_limit_strategy.go

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

3 changes: 3 additions & 0 deletions internal/device_code_storage.go

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

0 comments on commit bd62680

Please sign in to comment.