diff --git a/.dockerignore b/.dockerignore
index e58ae957a..dd3d41423 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -28,9 +28,7 @@ cli-linux
**/obj/
**/node_modules/
**/bower_components/
-**/wwwroot/lib/
-!**/wwwroot/lib/signalr/*
-!**/wwwroot/lib/toastr/*
+**/wwwroot/lib/*
global.json
**/appsettings.localhost.json
src/Web/WebSPA/wwwroot/
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..e0ff17a32
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,67 @@
+# How to contribute to eShopOnContainers
+
+This repo is a reference and learning resource and everyone is invited to contribute, however not all PRs will be accepted into the main branch (**`dev`**).
+
+There's a general development strategy that's driven by @CESARDELATORRE, who chooses, or defines criteria for choosing, the issues to include in the codebase, given a bunch of constraints and other guidelines.
+
+However you can always get in touch with him, if you want to implement some general-interest feature in your repo and have it referenced from the [documentation](https://docs.microsoft.com/dotnet/standard/microservices-architecture/) or the [Microservices eBook](https://aka.ms/microservicesebook/).
+
+## Coding Standards
+
+There are no explicit coding standards so pay attention to the general coding style, that's (mostly) used everywhere.
+
+However, there's only one **REALLY** important rule: **use spaces for indenting** 😉.
+
+## Development Process
+
+In order to help manage community contributions and avoid conflicts, there's a [Development project](https://github.com/dotnet-architecture/eShopOnContainers/projects/3) in this repo, to track assignments to any significant development effort.
+
+Great but... **what's "significant"**?
+
+That's not too easy to define and there are no clear criteria right now but, probably, changing "a couple" lines of code in one file would not qualify while changing "a bunch" of files would.
+
+We'll all be learning in the process so we'll figure it out somehow.
+
+### General Steps
+
+1. Issues are managed as usual with the regular issues list, just like any other repo.
+
+2. Once an issue is marked as a bug, enhancement, new feature or whatever needs development work, it will be labeled as a **backlog-item** and included as the last item in the Backlog project column.
+
+3. Community members can propose themselves to code an issue.
+
+4. @CESARDELATORRE/collaborators will prioritize the backlog items and arrange them in the **Backlog** column, so that the items in the top of the list are implemented first.
+
+5. @CESARDELATORRE/collaborators will review the issues and select the ones approved to begin development with, and move them to the **Approved** column.
+
+6. Issues in the **Approved** column can be assigned to a **collaborator** or to a **community member** who would then begin working on the issue and submit a PR as usual.
+
+## Tests
+
+There's not a tests policy in the project at this moment, but it'll be greatly appreciated if you include them within the [updated test structure](./test/readme.md).
+
+## Forks and Branches
+
+All contributions must be submitted as a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/) so you need to [fork this repo](https://help.github.com/articles/fork-a-repo/) on your GitHub account.
+
+The main branches are **`dev`** and **`master`**:
+
+- **`dev`**: Contains the latest code **and it is the branch actively developed**.
+**All PRs must be against `dev` branch to be considered**. This branch is developed using .NET Core 2.x
+
+- **`master`**: Synced from time to time from **`dev`**. It contains "stable" code.
+(**Keep in mind "stable" does not mean PRODUCTION-READY!**)
+
+- Any other branch is considered temporary and could be deleted at any time. Do not submit any PR to them!
+
+## DISCLAIMER - This is not a PRODUCTION-READY TEMPLATE for microservices
+eShopOnContainers is a reference application to **showcase architectural patterns** for developing microservices applications on .NET Core. **IT IS NOT A PRODUCTION-READY TEMPLATE** to start real-world application. In fact, the application is in a **permanent beta state**, as it’s also used to test new potentially interesting technologies as they show up.
+
+Since this is a learning resource, some design decisions have favored simplicity to convey a pattern, over production-grade robustness.
+
+## Suggestions
+
+We hope this helps us all to work better and avoid some of the problems/frustrations of working in such a large community.
+
+We'd also appreciate any comments or ideas to improve this.
+
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle)-v2.1.01.mobi b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle)-v2.1.01.mobi
new file mode 100644
index 000000000..b41f2adab
Binary files /dev/null and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle)-v2.1.01.mobi differ
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle).mobi b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle).mobi
index b41f2adab..38ba1c9b1 100644
Binary files a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle).mobi and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-Kindle).mobi differ
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader)-v2.1.01.epub b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader)-v2.1.01.epub
new file mode 100644
index 000000000..6a0b776da
Binary files /dev/null and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader)-v2.1.01.epub differ
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader).epub b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader).epub
index 6a0b776da..15e2ca8b9 100644
Binary files a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader).epub and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-for-eReader).epub differ
diff --git a/global.json b/global.json
index 386035de8..079ebc941 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "2.1.300"
+ "version": "2.1.401"
}
-}
\ No newline at end of file
+}
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
index d49c6a18f..d13a8a159 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
index 1d24e8312..3a11975c7 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
@@ -1,4 +1,8 @@
-using Microsoft.AspNetCore.Authentication.JwtBearer;
+using System;
+using System.Collections.Generic;
+using System.IdentityModel.Tokens.Jwt;
+using System.Net.Http;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@@ -12,10 +16,6 @@ using Microsoft.Extensions.Logging;
using Polly;
using Polly.Extensions.Http;
using Swashbuckle.AspNetCore.Swagger;
-using System;
-using System.Collections.Generic;
-using System.IdentityModel.Tokens.Jwt;
-using System.Net.Http;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{
@@ -61,7 +61,11 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
app.UseSwagger().UseSwaggerUI(c =>
{
c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Purchase BFF V1");
- c.ConfigureOAuth2("Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregatorwaggerui", "", "", "Purchase BFF Swagger UI");
+
+ c.OAuthClientId("Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregatorwaggerui");
+ c.OAuthClientSecret(string.Empty);
+ c.OAuthRealm(string.Empty);
+ c.OAuthAppName("Purchase BFF Swagger UI");
});
}
}
@@ -130,11 +134,9 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{
OnAuthenticationFailed = async ctx =>
{
- int i = 0;
},
OnTokenValidated = async ctx =>
{
- int i = 0;
}
};
});
@@ -166,7 +168,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
return services;
}
- static IAsyncPolicy GetRetryPolicy()
+ private static IAsyncPolicy GetRetryPolicy()
{
return HttpPolicyExtensions
.HandleTransientHttpError()
@@ -174,7 +176,8 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
.WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
}
- static IAsyncPolicy GetCircuitBreakerPolicy()
+
+ private static IAsyncPolicy GetCircuitBreakerPolicy()
{
return HttpPolicyExtensions
.HandleTransientHttpError()
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
index 7a0f6cc01..00695556b 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
@@ -13,8 +13,7 @@
-
-
+
diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj
index 36fc95496..3ae587781 100644
--- a/src/Services/Basket/Basket.API/Basket.API.csproj
+++ b/src/Services/Basket/Basket.API/Basket.API.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj
index 90abe593a..047a0ef65 100644
--- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj
+++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj
@@ -42,7 +42,7 @@
-
+
diff --git a/src/Services/Identity/Identity.API/.bowerrc b/src/Services/Identity/Identity.API/.bowerrc
deleted file mode 100644
index 6406626ab..000000000
--- a/src/Services/Identity/Identity.API/.bowerrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "directory": "wwwroot/lib"
-}
diff --git a/src/Services/Identity/Identity.API/Configuration/Config.cs b/src/Services/Identity/Identity.API/Configuration/Config.cs
index b780d420f..e28d7f9d2 100644
--- a/src/Services/Identity/Identity.API/Configuration/Config.cs
+++ b/src/Services/Identity/Identity.API/Configuration/Config.cs
@@ -58,7 +58,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
"marketing",
"webshoppingagg",
"orders.signalrhub"
- }
+ },
},
new Client
{
@@ -124,6 +124,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
"webshoppingagg",
"orders.signalrhub"
},
+ AccessTokenLifetime = 60*60*2, // 2 hours
+ IdentityTokenLifetime= 60*60*2 // 2 hours
},
new Client
{
@@ -248,7 +250,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
"webshoppingagg"
}
}
-
};
}
}
diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile
index 3931a135b..3f3a2a773 100644
--- a/src/Services/Identity/Identity.API/Dockerfile
+++ b/src/Services/Identity/Identity.API/Dockerfile
@@ -1,4 +1,3 @@
-ARG NODE_IMAGE=node:8.11
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
@@ -6,15 +5,7 @@ EXPOSE 80
FROM microsoft/dotnet:2.1-sdk as dotnet-build
WORKDIR /src
-FROM ${NODE_IMAGE} as node-build
-WORKDIR /web
-COPY src/Services/Identity/Identity.API .
-RUN npm install -g bower@1.8.4
-RUN bower install --allow-root
-
FROM dotnet-build as build
-WORKDIR /src/src/Services/Identity/Identity.API/wwwroot
-COPY --from=node-build /web/wwwroot .
WORKDIR /src
COPY . .
WORKDIR /src/src/Services/Identity/Identity.API
diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj
index 96a45e5ef..a7d93aa2a 100644
--- a/src/Services/Identity/Identity.API/Identity.API.csproj
+++ b/src/Services/Identity/Identity.API/Identity.API.csproj
@@ -24,7 +24,8 @@
-
+
+
diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs
index 255bb82b5..789047657 100644
--- a/src/Services/Identity/Identity.API/Startup.cs
+++ b/src/Services/Identity/Identity.API/Startup.cs
@@ -80,30 +80,34 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
// Adds IdentityServer
- services.AddIdentityServer(x => x.IssuerUri = "null")
- .AddSigningCredential(Certificate.Get())
- .AddAspNetIdentity()
- .AddConfigurationStore(options =>
+ services.AddIdentityServer(x =>
+ {
+ x.IssuerUri = "null";
+ x.Authentication.CookieLifetime = TimeSpan.FromHours(2);
+ })
+ .AddSigningCredential(Certificate.Get())
+ .AddAspNetIdentity()
+ .AddConfigurationStore(options =>
+ {
+ options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(migrationsAssembly);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
+ })
+ .AddOperationalStore(options =>
{
options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(migrationsAssembly);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(migrationsAssembly);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
})
- .AddOperationalStore(options =>
- {
- options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(migrationsAssembly);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
- })
- .Services.AddTransient();
+ .Services.AddTransient();
var container = new ContainerBuilder();
container.Populate(services);
diff --git a/src/Services/Identity/Identity.API/Views/Shared/_Layout.cshtml b/src/Services/Identity/Identity.API/Views/Shared/_Layout.cshtml
index 60e420f64..4727229c7 100644
--- a/src/Services/Identity/Identity.API/Views/Shared/_Layout.cshtml
+++ b/src/Services/Identity/Identity.API/Views/Shared/_Layout.cshtml
@@ -18,7 +18,7 @@
-