Skip to content

Commit 2b393b6

Browse files
Implement RFC 8628 (#826)
``` BREAKING CHANGES: This patch breaks up `OAuth2AuthorizeExplicitFactory` into `OAuth2AuthorizeExplicitAuthFactory` and `Oauth2AuthorizeExplicitTokenFactory` ``` This PR is based on the work done on #701, by @supercairos and @BuzzBumbleBee. That PR was based on an older version of fosite and was missing some features/tests. Co-authored-by: Shu <[email protected]>
1 parent 049ed19 commit 2b393b6

File tree

267 files changed

+4893
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+4893
-844
lines changed

.github/workflows/oidc-conformity.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
uses: actions/checkout@v2
1414
with:
1515
fetch-depth: 2
16-
repository: ory/hydra
17-
ref: a35e78e364a26c4f87f37d9f545ef10b3ffa468a
16+
repository: nsklikas/hydra
17+
ref: canonical-master
1818
- uses: actions/setup-go@v2
1919
with:
2020
go-version: "1.21"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test: # runs all tests
2121
curl https://raw.githubusercontent.com/ory/ci/master/licenses/install | sh
2222

2323
.bin/mockgen:
24-
go build -o .bin/mockgen github.com/golang/mock/mockgen
24+
go build -o .bin/mockgen go.uber.org/mock/mockgen
2525

2626
.bin/ory: Makefile
2727
curl https://raw.githubusercontent.com/ory/meta/master/install.sh | bash -s -- -b .bin ory v0.1.48

access_error.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite
@@ -10,11 +10,12 @@ import (
1010
"net/http"
1111
)
1212

13-
func (f *Fosite) WriteAccessError(ctx context.Context, rw http.ResponseWriter, req AccessRequester, err error) {
13+
// Convert an error to an http response as per RFC6749
14+
func (f *Fosite) WriteAccessError(ctx context.Context, rw http.ResponseWriter, req Requester, err error) {
1415
f.writeJsonError(ctx, rw, req, err)
1516
}
1617

17-
func (f *Fosite) writeJsonError(ctx context.Context, rw http.ResponseWriter, requester AccessRequester, err error) {
18+
func (f *Fosite) writeJsonError(ctx context.Context, rw http.ResponseWriter, requester Requester, err error) {
1819
rw.Header().Set("Content-Type", "application/json;charset=UTF-8")
1920
rw.Header().Set("Cache-Control", "no-store")
2021
rw.Header().Set("Pragma", "no-cache")

access_error_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite_test
@@ -11,9 +11,9 @@ import (
1111
"net/http/httptest"
1212
"testing"
1313

14-
"github.com/golang/mock/gomock"
1514
"github.com/stretchr/testify/assert"
1615
"github.com/stretchr/testify/require"
16+
gomock "go.uber.org/mock/gomock"
1717

1818
. "github.com/ory/fosite"
1919
. "github.com/ory/fosite/internal"

access_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite

access_request_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite

access_request_handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite_test
@@ -10,10 +10,10 @@ import (
1010
"net/url"
1111
"testing"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/pkg/errors"
1514
"github.com/stretchr/testify/assert"
1615
"github.com/stretchr/testify/require"
16+
gomock "go.uber.org/mock/gomock"
1717

1818
. "github.com/ory/fosite"
1919
"github.com/ory/fosite/internal"

access_request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite

access_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite

access_response_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2024 Ory Corp
1+
// Copyright © 2025 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

44
package fosite_test

0 commit comments

Comments
 (0)