#913 Support RFC 8693 (OAuth 2.0 Token Exchange) for the "scope" claim in ScopesAuthorizer#1478
#913 Support RFC 8693 (OAuth 2.0 Token Exchange) for the "scope" claim in ScopesAuthorizer#1478raman-m merged 28 commits intoThreeMammals:developfrom
Conversation
|
The build is broken, it fails on irrelevant part from this PR. #1436 fixes is I think. |
|
This is still an issue. Adding my 👍 to get this small and valuable PR merged. |
|
Mehmet, Unfortunately the last build is failed: 5 acceptance tests have failed! Why is your PR code so unstable? |
|
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. |
|
@mehyaa 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 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 |
|
@raman-m I've added you as collaborator on my fork, you can fix the diff or guide me to how-to. |
|
Interestingly some irrelevant tests fail irregularly. |
Thanks for fixing of failed tests!
No, at least one new test should cover claims logic having them multiple in the related config property. 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? |
|
Don't worry! This is unstable scenario: Ocelot.AcceptanceTests.ConfigurationReloadTests.should_reload_config_on_change |
|
@mehyaa |
Mehmet, What are you doing in our repo? If this is meant as a contribution to the product, I would prefer not to have it, as it feels like a waste of time. 🟥 Red card penalty❗You have received a red card for using AI tools. It appears that you and/or the engineers at your company, where you serve as CTO or Lead Engineer, are utilizing AI tools for JavaScript website development. AI vibe-coding approach does not work well with the Ocelot .NET product, as every small detail is crucial. P.S. A red card means that if you continue using AI tools to push commits or open new PRs with a help of AI in our repo, your account will be banned. This is the official notice! |
|
Why are there 18 commits for a single file 10-lines change along with 2 test files? |
I give up. I just wanted to fix a bug in the product that I've already fixed in my own implementation. I don't strictly need the fix to be merged, thanks to the flexibility of the project (being able to register your own implementation). I added the tests manually at first, but the codebase changed dramatically over time. My merge attempts failed, and you had to take over the branch, after which the PR went stale. When I recently returned to finish this work, I implemented the tests with Copilot, verified them, and pushed. However, in the meantime, the acceptance test structure was refactored again, making the PR unmergeable. I tried fixing the tests manually to match the existing ones so I could build, but I couldn't make them pass (the token endpoint returns 404). I suspected my environment, so I wanted to see the results in the actions; that is why I pushed it. I know I may not have followed your exact workflow, so you have every right to criticize. I have no intention of bloating or breaking your product; I like and use Ocelot. My sole intention was to fix a minor bug. If my work isn't suitable, I'm stepping away from it plain and simple, with no hard feelings. Sorry for taking up your time. Thank you and all the contributors for this great product. |
|
Don't give up! As a CTO and IT manager, you know that software development is an iterative process.
This is the goal! If you really want to enhance Ocelot, please address my code review issues, fix the tests, and then the PR will reach over 75% Dev Complete readiness. The remaining work, such as code polishing and updating documentation, is my responsibility. |
ggnaegi
left a comment
There was a problem hiding this comment.
Why userScopes.Count == 1 ?
That will be a error if a provider supplied |
|
I like this, guys! Let's close the PR and open once again 🤣 |
|
Oops, I've changed my mind. I forgot that PR is now part of the .NET 10 milestone. |
|
@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 The tests are passing now. |
@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. |
raman-m
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Ready for delivery ✅
- Code review ✔️ ✔️
- Unit testing ✔️ ✔️
- Acceptance testing ✔️
- Updated docs ✔️
|
@mehyaa Congrats, Mehmet! 🥳 |


Fixes #913
Scopes can be a space separated list in a single claim. Include this possibility on allowed scopes check.
Proposed Changes