Skip to content

Commit

Permalink
updated using afdbd38
Browse files Browse the repository at this point in the history
  • Loading branch information
george-tifrea committed Feb 8, 2019
1 parent e78e5f2 commit 71639a8
Show file tree
Hide file tree
Showing 590 changed files with 1,727 additions and 1,031 deletions.
37 changes: 0 additions & 37 deletions NLIP.iShare.Api/Controllers/CapabilitiesController.cs

This file was deleted.

1 change: 0 additions & 1 deletion NLIP.iShare.AuthorizationRegistry.Api/tempkey.rsa

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions NLIP.iShare.IdentityServer/Properties/AssemblyInfo.cs

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -27,7 +27,7 @@ The **Authorization Registry** is a role for which iSHARE Certification (iSHARE)
### Setup the development environment

1. Create environment variable 'ENVIRONMENT' with the value 'Development'
2. Navigate to NLIP.iShare.AuthorizationRegistry.Api and create a new file named 'appsettings.Development.json'
2. Navigate to iSHARE.AuthorizationRegistry.Api and create a new file named 'appsettings.Development.json'
3. Copy the content of 'appsettings.Development.json.template' into 'appsettings.Development.json' and complete all fields with the necessary information and save the changes

## Build API
Expand All @@ -39,13 +39,13 @@ Navigate to the local Authorization Registry repository and run `dotnet build`
Authorization Registry is using a SQL database that is created at runtime.
Various test records are inserted from JSON files present here

- `NLIP.iShare.AuthorizationRegistry.Api\Seed\Identity\Development`
- `NLIP.iShare.AuthorizationRegistry.Api\Seed\IdentityServer\Development`
- `NLIP.iShare.AuthorizationRegistry.Data\Migrations\Seed\Development`
- `iSHARE.AuthorizationRegistry.Api\Seed\Identity\Development`
- `iSHARE.AuthorizationRegistry.Api\Seed\IdentityServer\Development`
- `iSHARE.AuthorizationRegistry.Data\Migrations\Seed\Development`

## Run process

1. Navigate to the local Authorization Registry repository, into NLIP.iShare.AuthorizationRegistry.Api folder and run `dotnet run`
1. Navigate to the local Authorization Registry repository, into iSHARE.AuthorizationRegistry.Api folder and run `dotnet run`
2. Open a browser tab and navigate to `localhost:61433/swagger`

## Installation for SPA
Expand All @@ -59,7 +59,7 @@ The software you'll need before installing Authorization Registry SPA:

### Install dependencies

Run `npm install` inside NLIP.iShare.AuthorizationRegistry.SPA folder to get all dependencies downloaded locally.
Run `npm install` inside iSHARE.AuthorizationRegistry.SPA folder to get all dependencies downloaded locally.

### Run process

Expand Down
@@ -1,4 +1,4 @@
namespace NLIP.iShare.Abstractions.Email
namespace iSHARE.Abstractions.Email
{
public class EmailAddress
{
Expand Down
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace NLIP.iShare.Abstractions.Email
namespace iSHARE.Abstractions.Email
{
public class EmailTemplatesData
{
Expand Down
@@ -1,6 +1,6 @@
using System.Threading.Tasks;

namespace NLIP.iShare.Abstractions.Email
namespace iSHARE.Abstractions.Email
{
/// <summary>
/// Send an email to a recipient
Expand Down
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace NLIP.iShare.Abstractions.Email
namespace iSHARE.Abstractions.Email
{
public interface ITemplateService
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
public static class Extensions
{
Expand Down
@@ -1,6 +1,6 @@
using Newtonsoft.Json.Serialization;

namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
/// <summary>
/// Builds a JWT from the given delegation evidence
Expand Down
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Linq.Expressions;

namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
public static class LinqExtensions
{
Expand Down
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
public class PagedResult<T>
{
Expand Down
@@ -1,4 +1,4 @@
namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
public class Query
{
Expand Down
@@ -1,4 +1,4 @@
namespace NLIP.iShare.Abstractions
namespace iSHARE.Abstractions
{
public enum SortOrder
{
Expand Down
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet>NLIP.iShare.Abstractions.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>iSHARE.Abstractions.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet>NLIP.iShare.Abstractions.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>iSHARE.Abstractions.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
Expand Down
Expand Up @@ -2,7 +2,7 @@
using Microsoft.ApplicationInsights.Extensibility;
using System.Diagnostics;

namespace NLIP.iShare.Api.ApplicationInsights
namespace iSHARE.Api.ApplicationInsights
{
internal class CloudRoleNameInitializer : ITelemetryInitializer
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;

namespace NLIP.iShare.Api.ApplicationInsights
namespace iSHARE.Api.ApplicationInsights
{
public static class ConfigurationExtensions
{
Expand Down
Expand Up @@ -4,9 +4,9 @@
using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
using System.Diagnostics;
using NLIP.iShare.Models;
using iSHARE.Models;

namespace NLIP.iShare.Api.ApplicationInsights
namespace iSHARE.Api.ApplicationInsights
{
internal class EoriInitializer : ITelemetryInitializer
{
Expand Down
@@ -1,11 +1,11 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NLIP.iShare.Api.Validation;
using NLIP.iShare.IdentityServer.Validation.Interfaces;
using NLIP.iShare.SchemeOwner.Client;
using iSHARE.Api.Validation;
using iSHARE.IdentityServer.Validation.Interfaces;
using iSHARE.SchemeOwner.Client;

namespace NLIP.iShare.Api
namespace iSHARE.Api
{
public static class Configuration
{
Expand Down
Expand Up @@ -11,7 +11,7 @@
using System.Net;
using System.Text;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class ExceptionHandler
{
Expand Down
@@ -1,17 +1,23 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using System;
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using iSHARE.Api.Interfaces;
using iSHARE.Api.Services;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class FileProvider
{
public static IServiceCollection AddFileProvider(this IServiceCollection services)
public static IServiceCollection AddFileProvider(this IServiceCollection services, IHostingEnvironment environment)
{
services.AddSingleton<Func<string, IFileInfo>>(srv => filename =>
{
IFileProvider fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "Resources"));
IFileProvider fileProvider = new PhysicalFileProvider(Path.Combine(
Directory.GetCurrentDirectory(),
"Resources",
environment.EnvironmentName ?? "Development"));
var file = fileProvider.GetFileInfo(filename);
if (!file.Exists)
Expand All @@ -21,6 +27,8 @@ public static IServiceCollection AddFileProvider(this IServiceCollection service
return file;
});
services.AddSingleton<ICapabilitiesService, CapabilitiesService>();

return services;
}
}
Expand Down
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Hosting;
using System;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class HostingEnvironment
{
Expand Down
Expand Up @@ -4,7 +4,7 @@
using System;
using System.IO;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class JsonSchema
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class JsonSettings
{
Expand Down
@@ -1,23 +1,23 @@
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using NLIP.iShare.Configuration.Configurations;
using System;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Cryptography;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using NLIP.iShare.Configuration;
using AuthenticationOptions = NLIP.iShare.Configuration.AuthenticationOptions;
using Microsoft.Extensions.DependencyInjection;
using iSHARE.Configuration;
using iSHARE.Configuration.Configurations;
using AuthenticationOptions = iSHARE.Configuration.AuthenticationOptions;

namespace NLIP.iShare.Api.Configurations
namespace iSHARE.Api.Configurations
{
public static class JwtAuthentication
{
public static IServiceCollection AddJwtAuthentication(this IServiceCollection services,
IHostingEnvironment hostingEnvironment,
string[] audiences, IConfiguration configuration)
IConfiguration configuration)
{
services.ConfigureRuntimeOptions(configuration, "Auth", new AuthenticationOptions());
services
Expand All @@ -26,12 +26,11 @@ public static class JwtAuthentication
{
var partyDetailsOptions = services.BuildServiceProvider().GetRequiredService<PartyDetailsOptions>();
options.Authority = partyDetailsOptions.BaseUri;
// name of the API resource
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
{
ValidateIssuer = true,
ValidAudiences = new List<string>(audiences)
ValidAudiences = new List<string> { partyDetailsOptions.ClientId }
};
options.RequireHttpsMetadata = !hostingEnvironment.IsDevelopment();
options.IncludeErrorDetails = !hostingEnvironment.IsDevelopment();
Expand Down

0 comments on commit 71639a8

Please sign in to comment.