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

#1739 #2177 OpenIddict authentication: role section, override scope and role key #1431

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Fixed test
Fixed test configuration_is_invalid_with_invalid_authentication_provider()
  • Loading branch information
Eits-Ian authored and raman-m committed Nov 5, 2024
commit f1f8fe5d48c2481a44212d67f616d8751f22fd5f
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ public void Configuration_is_invalid_with_invalid_authentication_provider()
.When(x => x.WhenIValidateTheConfiguration())
.Then(x => x.ThenTheResultIsNotValid())
.And(x => x.ThenTheErrorMessageAtPositionIs(0, "Authentication Options AuthenticationProviderKey:'Test',AuthenticationProviderKeys:['Test #1','Test #2'],AllowedScopes:[] is unsupported authentication provider"))
.And(x => x.ThenTheErrorMessageAtPositionIs(0, "Authentication Options AuthenticationProviderKey:Test,AllowedScopes:[],RequiredRole:[],ScopeKey:[],RoleKey:[],PolicyName:[] is unsupported authentication provider"))
.BDDfy();
}

Expand Down Expand Up @@ -536,7 +537,7 @@ public void Configuration_is_valid_with_duplicate_routes_but_one_upstreamhost_is
.When(x => x.WhenIValidateTheConfiguration())
.Then(x => x.ThenTheResultIsValid())
.BDDfy();
}
}

[Fact]
public void Configuration_is_invalid_with_invalid_rate_limit_configuration()
Expand Down Expand Up @@ -718,7 +719,7 @@ public void Configuration_is_not_valid_when_host_and_port_is_empty()
.Then(x => x.ThenTheResultIsNotValid())
.And(x => x.ThenTheErrorMessageAtPositionIs(0, "When not using service discovery Host must be set on DownstreamHostAndPorts if you are not using Route.Host or Ocelot cannot find your service!"))
.BDDfy();
}
}

[Fact]
[Trait("PR", "1312")]
Expand Down Expand Up @@ -900,8 +901,8 @@ public async Task Configuration_is_invalid_when_placeholder_is_used_twice_in_dow
DownstreamPathTemplate = "/",
DownstreamScheme = Uri.UriSchemeHttp,
ServiceName = "test",
};

};
private static FileRoute GivenRouteWithUpstreamHeaderTemplates(string upstream, string downstream, Dictionary<string, string> templates) => new()
{
UpstreamPathTemplate = upstream,
Expand Down