Skip to content

Commit

Permalink
Re-apply original changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raman-m committed Nov 7, 2024
1 parent b513ba8 commit 094b448
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/Ocelot/Authorization/ClaimsAuthorizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

namespace Ocelot.Authorization
{
/// <summary>
/// Authorizer which is implemented using Claims-based authorization.
/// <para>
/// Microsoft Learn: <see href="https://learn.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-7.0">Claims-based authorization in ASP.NET Core</see>.
/// </para>
/// </summary>
public partial class ClaimsAuthorizer : IClaimsAuthorizer
/// <summary>Authorizer which is implemented using Claims-based authorization.</summary>
/// <remarks>Microsoft Learn: <see href="https://learn.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-7.0">Claims-based authorization in ASP.NET Core</see>.</remarks>
public class ClaimsAuthorizer : IClaimsAuthorizer
{
private readonly IClaimsParser _claimsParser;

Expand All @@ -38,7 +34,7 @@ List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues
if (values.Data != null)
{
// dynamic claim
var match = VariableRegex().Match(required.Value);
var match = Regex.Match(required.Value, @"^{(?<variable>.+)}$");
if (match.Success)
{
var variableName = match.Captures[0].Value;
Expand Down Expand Up @@ -95,8 +91,5 @@ List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues

return new OkResponse<bool>(true);
}

[GeneratedRegex("^{(?<variable>.+)}$")]
private static partial Regex VariableRegex();
}
}

0 comments on commit 094b448

Please sign in to comment.