Skip to content

Instantly share code, notes, and snippets.

View CESARDELATORRE's full-sized avatar

Cesar De la Torre CESARDELATORRE

  • Microsoft Corp
  • Redmond, WA, U.S.
View GitHub Profile
@CESARDELATORRE
CESARDELATORRE / AddJwtBearer-ConfigureServices.cs
Created May 15, 2018 19:01
AddJwtBearer-ConfigureServices.cs
// prevent from mapping "sub" claim to nameidentifier.
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
var identityUrl = Configuration.GetValue<string>("IdentityUrl");
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
@CESARDELATORRE
CESARDELATORRE / Sample-Authorize-Controller-Class.cs
Created May 15, 2018 18:58
Sample-Authorize-Controller-Class.cs
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
{
[Route("api/v1/[controller]")]
[Authorize]
public class BasketController : Controller
{ //...
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
@CESARDELATORRE
CESARDELATORRE / Partial-eShopOnContainers-docker-compose.override.yml
Created May 15, 2018 18:54
Partial-eShopOnContainers-docker-compose.override.yml
mobileshoppingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api
ports:
- "5200:80"
volumes:
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:/app/configuration
mobilemarketingapigw:
@CESARDELATORRE
CESARDELATORRE / Partial-eShopOnContainers-docker-compose.yml
Created May 15, 2018 18:52
Partial-eShopOnContainers-docker-compose.yml
mobileshoppingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
mobilemarketingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
build:
context: .
@CESARDELATORRE
CESARDELATORRE / ApiGateways-Web.Bff.Shopping-apigw-configuration-basket-specific.json
Created May 15, 2018 18:49
ApiGateways-Web.Bff.Shopping-apigw-configuration-basket-specific.json
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog.api",
"Port": 80
}
@CESARDELATORRE
CESARDELATORRE / BoxStarter_CESARDL_Script.txt
Last active March 3, 2017 04:52
My Boxstarter Script (For CESARDL new boxes' setup)
Set-WindowsExplorerOptions -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst Microsoft-Hyper-V-All -source windowsFeatures
cisnt markdownmonster
cinst zoomit
cinst f.lux
cinst google-chrome-x64
cinst 7zip
cinst 7zip.install
cinst 1Password
@CESARDELATORRE
CESARDELATORRE / project.json
Created June 29, 2016 17:20
Sample project.json of ASP.NET Core 1.0 RTM supporting multiple frameworks
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
@CESARDELATORRE
CESARDELATORRE / ServiceFabricPartitionRangeKeys.cs
Last active July 1, 2016 01:50
This code tells you the Partition's Range Keys (High and Low) of your current partition in a Service Fabric Stateful Reliable Service
// This code can run in any Azure Service Fabric Stateful Reliable Service
// within the method protected override async Task RunAsync(CancellationToken cancellationToken)
//Aditional or similar code in: https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/blob/master/Services/WordCount/WordCount.WebService/Controllers/DefaultController.cs
var fabricClient = new FabricClient();
string serviceUri = "fabric:/MySFApp/MyStatefulService";
Uri serviceUriInstance = new Uri(serviceUri);
System.Fabric.Query.ServicePartitionList partitionList =