Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(op): Server interface #447

Merged
merged 30 commits into from
Sep 28, 2023
Merged

feat(op): Server interface #447

merged 30 commits into from
Sep 28, 2023

Conversation

muhlemmer
Copy link
Collaborator

@muhlemmer muhlemmer commented Sep 21, 2023

This PR bring the new Server interface as described in #440 and adds:

  • op.Server interface;
  • op.webServer: a HTTP handler taking care of routing and request parsing and validating required request fields.
  • op.LegacyServer: a wrapper around the current OpenIDProvider and Storage interfaces.

The interface should be considered experimental.

The following tests have been provided:

  • Unit tests for op.webServer (near 100%)
  • The op router test has been duplicated and runs against the LegacyServer. Some test error outcomes are different, due to the different order of things being validated. (For example client verification is done in a more centralized manner as the old implementation).
  • The integration tests run two times, unmodified, against the op.Provider and op.LegacyServer

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #447 (a1a6c19) into next (daf82a5) will increase coverage by 4.23%.
The diff coverage is 76.13%.

@@            Coverage Diff             @@
##             next     #447      +/-   ##
==========================================
+ Coverage   54.15%   58.39%   +4.23%     
==========================================
  Files          75       78       +3     
  Lines        5724     6542     +818     
==========================================
+ Hits         3100     3820     +720     
- Misses       2369     2426      +57     
- Partials      255      296      +41     
Files Coverage Δ
pkg/op/client.go 79.03% <ø> (ø)
pkg/op/config.go 94.54% <ø> (ø)
pkg/op/discovery.go 98.42% <100.00%> (+0.28%) ⬆️
pkg/op/endpoint.go 100.00% <100.00%> (ø)
pkg/op/probes.go 68.18% <100.00%> (ø)
pkg/op/server_http.go 99.73% <99.73%> (ø)
pkg/op/token_code.go 39.75% <0.00%> (+3.61%) ⬆️
pkg/op/error.go 93.47% <94.44%> (+1.37%) ⬆️
pkg/op/token_request.go 60.60% <0.00%> (+1.01%) ⬆️
pkg/op/token_revocation.go 31.93% <0.00%> (-0.83%) ⬇️
... and 7 more

... and 6 files with indirect coverage changes

@muhlemmer muhlemmer added this to the v3 milestone Sep 25, 2023
@muhlemmer muhlemmer mentioned this pull request Sep 25, 2023
5 tasks
@muhlemmer muhlemmer marked this pull request as ready for review September 25, 2023 17:02
@muhlemmer muhlemmer requested a review from livio-a September 25, 2023 17:02
pkg/op/server_http_test.go Outdated Show resolved Hide resolved
pkg/op/server.go Outdated Show resolved Hide resolved
pkg/op/server.go Outdated Show resolved Hide resolved
pkg/op/server_http.go Outdated Show resolved Hide resolved
example/server/storage/client.go Show resolved Hide resolved
pkg/op/server.go Show resolved Hide resolved
Copy link
Member

@livio-a livio-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also found some flakiness in the tests

@muhlemmer muhlemmer merged commit 0f8a058 into next Sep 28, 2023
8 checks passed
@muhlemmer muhlemmer deleted the next-server-interface branch September 28, 2023 14:30
@github-actions
Copy link

🎉 This PR is included in version 3.0.0-next.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants