Skip to content

Conversation

@mehyaa
Copy link
Contributor

@mehyaa mehyaa commented May 31, 2021

Fixes #913

Scopes can be a space separated list in a single claim. Include this possibility on allowed scopes check.

Proposed Changes

  • Split user scopes if scope claim value is a single space-separated claim

@mehyaa
Copy link
Contributor Author

mehyaa commented Jun 1, 2021

The build is broken, it fails on irrelevant part from this PR. #1436 fixes is I think.

@PatrickDelancy
Copy link

This is still an issue. Adding my 👍 to get this small and valuable PR merged.

@raman-m
Copy link
Member

raman-m commented Aug 18, 2023

Mehmet,
Thanks for resolving of merge conflicts!

Unfortunately the last build is failed: 5 acceptance tests have failed!

Why is your PR code so unstable?

@mehyaa
Copy link
Contributor Author

mehyaa commented Aug 18, 2023

I haven't found out the reason why the tests failed with a quick look. I couldn't figure out the tests structure. When I have time I'll look into it.

@raman-m
Copy link
Member

raman-m commented Aug 24, 2023

@mehyaa
The feature branch has been rebased onto ThreeMammals:develop successfully!
The build has failed with 5 tests!
Code review will start after fixing of these failed tests.
Also, some new tests should cover your proposed changes in the ScopesAuthorizer class.

Could you add me as collaborator to your forked repo please? I will fix develop branch because now it has the diff, but both develop branches should be identical.

@raman-m raman-m added bug Identified as a potential bug proposal Proposal for a new functionality in Ocelot needs feedback Issue is waiting on feedback before acceptance labels Aug 24, 2023
@raman-m raman-m linked an issue Aug 24, 2023 that may be closed by this pull request
@raman-m raman-m added help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort labels Aug 24, 2023
@mehyaa
Copy link
Contributor Author

mehyaa commented Sep 14, 2023

@raman-m I've fixed the tests. Failing tests were written for the bug that requires one of allowed scopes. I've changed the claims and allowed scopes on tests so they can test the correct conditions.

For adding new tests to test ScopesAuthorizer, the current tests seem pretty sufficient.

@mehyaa
Copy link
Contributor Author

mehyaa commented Sep 14, 2023

@raman-m I've added you as collaborator on my fork, you can fix the diff or guide me to how-to.

@mehyaa
Copy link
Contributor Author

mehyaa commented Sep 15, 2023

Interestingly some irrelevant tests fail irregularly.

@raman-m
Copy link
Member

raman-m commented Sep 15, 2023

@mehyaa commented on Sep 14, 11:38 AM

Thanks for fixing of failed tests!


For adding new tests to test ScopesAuthorizer, the current tests seem pretty sufficient.

No, at least one new test should cover claims logic having them multiple in the related config property.
Simultaneously, we should update current tests to be green. Because each test covers specific atomic feature.

Come on! We've changed the logic from single Scope to multiple ones! And it is definitely right time to cover these changes.

I have idea: let's write tests for each linked issue:

Sounds good?

@raman-m
Copy link
Member

raman-m commented Sep 15, 2023

@mehyaa commented on Sep 15

Don't worry! This is unstable scenario: Ocelot.AcceptanceTests.ConfigurationReloadTests.should_reload_config_on_change
The next run fixes the build usually.
Truly speaking, I am tired of this test too. I will create bug issue soon for this test.

@raman-m raman-m changed the title ScopesAuthorizer refactoring #913 #1066 ScopesAuthorizer refactoring Sep 15, 2023
@raman-m
Copy link
Member

raman-m commented Jan 21, 2024

@mehyaa
Why not to continue working? Firstly resolving all merge conflicts and merging from develop...

@raman-m raman-m added 2023 Annual 2023 release Authorization Ocelot feature: Authorization and removed help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort needs feedback Issue is waiting on feedback before acceptance labels Jan 21, 2024
@raman-m raman-m added this to the Annual 2023 milestone Mar 5, 2024
@raman-m raman-m changed the base branch from develop to release/24.0 March 5, 2024 10:03
@raman-m
Copy link
Member

raman-m commented Dec 6, 2025

I like this, guys! Let's close the PR and open once again 🤣

@raman-m raman-m closed this Dec 6, 2025
@raman-m
Copy link
Member

raman-m commented Dec 6, 2025

Oops, I've changed my mind. I forgot that PR is now part of the .NET 10 milestone.

@raman-m raman-m reopened this Dec 6, 2025
@mehyaa
Copy link
Contributor Author

mehyaa commented Dec 6, 2025

@raman-m the last close/open was by mistake, my bad.

I've figured out the acceptance tests' problem, the token server was misconfigured. I've added a fix there too. You need to review.

On my machine Http20CLient_DirectConnection_ShouldConnect test keeps failing but it seem nothing to do with my changes and I didn't see the test in recent actions as well. Can you look into it?

The tests are passing now.

@mehyaa mehyaa requested review from ggnaegi and raman-m December 6, 2025 16:38
@ggnaegi
Copy link
Member

ggnaegi commented Dec 6, 2025

Why userScopes.Count == 1 ?

That will be a error if a provider supplied scope claim as an array that some of the values are space-separated.

@mehyaa could you just comment this in code please. It's fine for me and i will approve your PR.

@mehyaa
Copy link
Contributor Author

mehyaa commented Dec 6, 2025

Why userScopes.Count == 1 ?

That will be a error if a provider supplied scope claim as an array that some of the values are space-separated.

@mehyaa could you just comment this in code please. It's fine for me and i will approve your PR.

Added a comment to the code.

Copy link
Member

@raman-m raman-m left a comment

Choose a reason for hiding this comment

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

The code looks much better now, with some minor but valuable suggestions noted below.

It seems acceptance testing is complete, and I will review unit testing and code coverage later.

@raman-m raman-m changed the title #913 ScopesAuthorizer refactoring #913 Support RFC 8693 (OAuth 2.0 Token Exchange) for the "scope" claim in ScopesAuthorizer Dec 7, 2025
@raman-m raman-m added Summer'25 Summer 2025 release and removed NET10 .NET 10 release labels Dec 7, 2025
@raman-m raman-m modified the milestones: .NET 10, Summer'25 Dec 7, 2025
Copy link
Member

@raman-m raman-m left a comment

Choose a reason for hiding this comment

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

Ready for delivery ✅

  • Code review ✔️ ✔️
  • Unit testing ✔️ ✔️
  • Acceptance testing ✔️
  • Updated docs ✔️

@raman-m raman-m merged commit adc34ec into ThreeMammals:develop Dec 7, 2025
7 of 11 checks passed
@raman-m raman-m deleted the patch-1 branch December 7, 2025 18:16
@raman-m
Copy link
Member

raman-m commented Dec 7, 2025

@mehyaa Congrats, Mehmet! 🥳
After more than 4 years, we finally made it!
This is your first contribution to the project, and we truly appreciate it 👍
Thanks for being available online this weekend.

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

Labels

Authorization Ocelot feature: Authorization bug Identified as a potential bug proposal Proposal for a new functionality in Ocelot Summer'25 Summer 2025 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AllowedScopes does not match string array in JWT scope claim

7 participants