Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MessagingService.IntegrationTests/Email/SendEmail.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Feature: SendEmail

Background:

Given I create the following api scopes
| Name | DisplayName | Description |
| messagingService | Messaging REST Scope | A scope for Messaging REST |

Given the following api resources exist
| ResourceName | DisplayName | Secret | Scopes | UserClaims |
| messagingService | Messaging REST | Secret1 | messagingService | |
Expand Down
45 changes: 28 additions & 17 deletions MessagingService.IntegrationTests/Email/SendEmail.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="ClientProxyBase" Version="1.0.3" />
<PackageReference Include="Ductus.FluentDocker" Version="2.7.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="SecurityService.Client" Version="1.0.4" />
<PackageReference Include="SecurityService.Client" Version="1.0.4.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="1.0.3" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.14" />
Expand Down
5 changes: 5 additions & 0 deletions MessagingService.IntegrationTests/SMS/SendSMS.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Feature: SendSMS

Background:

Given I create the following api scopes
| Name | DisplayName | Description |
| messagingService | Messaging REST Scope | A scope for Messaging REST |

Given the following api resources exist
| ResourceName | DisplayName | Secret | Scopes | UserClaims |
| messagingService | Messaging REST | Secret1 | messagingService | |
Expand Down
204 changes: 3 additions & 201 deletions MessagingService.IntegrationTests/SMS/SendSMS.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions MessagingService.IntegrationTests/Shared/SharedSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ public SharedSteps(ScenarioContext scenarioContext,
this.TestingContext = testingContext;
}

[Given(@"I create the following api scopes")]
public async Task GivenICreateTheFollowingApiScopes(Table table)
{
foreach (TableRow tableRow in table.Rows)
{
CreateApiScopeRequest createApiScopeRequest = new CreateApiScopeRequest
{
Name = SpecflowTableHelper.GetStringRowValue(tableRow, "Name"),
Description = SpecflowTableHelper.GetStringRowValue(tableRow, "Description"),
DisplayName = SpecflowTableHelper.GetStringRowValue(tableRow, "DisplayName")
};
var createApiScopeResponse =
await this.CreateApiScope(createApiScopeRequest, CancellationToken.None).ConfigureAwait(false);

createApiScopeResponse.ShouldNotBeNull();
createApiScopeResponse.ApiScopeName.ShouldNotBeNullOrEmpty();
}
}

private async Task<CreateApiScopeResponse> CreateApiScope(CreateApiScopeRequest createApiScopeRequest,
CancellationToken cancellationToken)
{
CreateApiScopeResponse createApiScopeResponse = await this.TestingContext.DockerHelper.SecurityServiceClient.CreateApiScope(createApiScopeRequest, cancellationToken).ConfigureAwait(false);
return createApiScopeResponse;
}

[Given(@"the following api resources exist")]
public async Task GivenTheFollowingApiResourcesExist(Table table)
{
Expand Down
2 changes: 1 addition & 1 deletion MessagingService/MessagingService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Shared" Version="1.0.3" />
<PackageReference Include="Shared.EventStore" Version="1.0.3" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion MessagingService/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private void ConfigureMiddlewareServices(IServiceCollection services)
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters()
{
ValidateIssuer = true,
ValidateAudience = true,
ValidateAudience = false,
ValidAudience = ConfigurationReader.GetValue("SecurityConfiguration", "ApiName"),
ValidIssuer = ConfigurationReader.GetValue("SecurityConfiguration", "Authority"),
};
Expand Down