Skip to content

Fixed matching URL path to service type in Extensibility.AuthorizeOperationMessageProcessor - #1140

Merged
andersjonsson merged 6 commits into
DigDes:developfrom
SerbanApostol:develop
Aug 20, 2025
Merged

andersjonsson merged 6 commits into
DigDes:developfrom
SerbanApostol:develop

Conversation

@SerbanApostol

Copy link
Copy Markdown

Previously, the caller of the constructor had the responsibility to make the path for the service to be lowercase. I modified the constructor to make the path lowercase as it is not obvious to the caller that this is necessary.

Serban Apostol added 3 commits May 12, 2025 13:02
When the dictionary on the constructor of Extensibility.AuthorizeOperationMessageProcessor had its keys not all lowercase, it couldn't find the service type and, consequently, the operation
When the dictionary on the constructor of Extensibility.AuthorizeOperationMessageProcessor had its keys not all lowercase, it couldn't find the service type and, consequently, the operation
@andersjonsson

Copy link
Copy Markdown
Collaborator

There is an option to make path insensitive (SoapCoreOption.CaseInsensitivePath). Would it be a good idea to use that to decide if comparison should be case-insensitive?

Dictionary accepts a comparer in the constructor new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase) that makes it easy to vary behavior depending on the option

@SerbanApostol

Copy link
Copy Markdown
Author

Thank you for pointing me to the option of supplying a comparer to Dictionary<,>. I removed the foreach that made each key lowercase and instead used the comparer.

@andersjonsson

Copy link
Copy Markdown
Collaborator

Sorry for not getting back to you. I haven't had time to work on open source for a while.

I think that you should check the setting SoapCoreOption.CaseInsensitivePath and use that to decide whether to use StringComparer.Ordinal or StringComparer.OrdinalIgnoreCase

Other than that I think it looks good!

Serban Apostol added 2 commits June 23, 2025 11:03
… that gets SoapCoreOptions

Added separate constructor to maintain possible backwards compatibility; used options to decide whether to perform case insensitive comparison of paths
@SerbanApostol

Copy link
Copy Markdown
Author

I now notice you mentioned deciding whether to do case insensitive comparison based on the value of SoapCoreOption.CaseInsensitivePath in the first comment as well, sorry about that. I added a constructor that takes an options configuring Action, what I probably should have done the first time around.
I kept the old constructor as well for backwards compatibility, in case anyone else used this in the first place.

@andersjonsson
andersjonsson merged commit 60625f2 into DigDes:develop Aug 20, 2025
@andersjonsson

Copy link
Copy Markdown
Collaborator

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants