diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2a586dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,156 @@ +# EditorConfig is awesome:http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Don't use tabs for indentation. +[*] +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +charset = utf-8-bom + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:error +dotnet_style_qualification_for_property = false:error +dotnet_style_qualification_for_method = false:error +dotnet_style_qualification_for_event = false:error + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:error +dotnet_style_predefined_type_for_member_access = true:error + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion + +# Non-private static fields are PascalCase +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style + +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static + +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case + +# Constants are PascalCase +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style + +dotnet_naming_symbols.constants.applicable_kinds = field, local +dotnet_naming_symbols.constants.required_modifiers = const + +dotnet_naming_style.constant_style.capitalization = pascal_case + +# Static fields are camelCase and start with _ +dotnet_naming_rule.static_fields_should_be_camel_case.severity = warning +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style + +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static + +dotnet_naming_style.static_field_style.capitalization = camel_case +dotnet_naming_style.static_field_style.required_prefix = _ + +# Instance fields are camelCase and start with _ +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = error +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style + +dotnet_naming_symbols.instance_fields.applicable_kinds = field + +dotnet_naming_style.instance_field_style.capitalization = camel_case +dotnet_naming_style.instance_field_style.required_prefix = _ + +# Locals and parameters are camelCase +dotnet_naming_rule.locals_should_be_camel_case.severity = error +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style + +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +# Local functions are PascalCase +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = error +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function + +dotnet_naming_style.local_function_style.capitalization = pascal_case + +# By default, name items with PascalCase +dotnet_naming_rule.members_should_be_pascal_case.severity = error +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.all_members.applicable_kinds = * + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# CSharp code style settings: +[*.cs] +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left + +# Prefer "var" everywhere +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +# Prefer method-like constructs to have a block body +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none + +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = false +csharp_style_conditional_delegate_call = true:warning + +# Newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true \ No newline at end of file diff --git a/SIO-Identity.sln b/SIO-Identity.sln new file mode 100644 index 0000000..6c07fde --- /dev/null +++ b/SIO-Identity.sln @@ -0,0 +1,76 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.352 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{93241E08-D16C-4DA4-8FE1-EB557F1C0456}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{78E3B737-3545-4C8C-877F-2C2A1B1E433E}" + ProjectSection(SolutionItems) = preProject + docs\migrations.md = docs\migrations.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{79658CA3-C775-4A25-92AB-213294FF895F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{769F01C5-CD06-4D39-94A1-9842AAB78966}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + LICENSE = LICENSE + README.md = README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIO.Identity", "src\SIO.Identity\SIO.Identity.csproj", "{A362A39B-E7E0-45B0-BA93-5EF81CF536A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIO.Abstraction", "src\SIO.Abstraction\SIO.Abstraction.csproj", "{CB4D700D-52A9-4D57-9A40-E2F63E6866E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIO.Domain", "src\SIO.Domain\SIO.Domain.csproj", "{86E78C2E-256C-4DB1-9743-1EB1693B5046}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIO.Migrations", "src\SIO.Migrations\SIO.Migrations.csproj", "{511423FB-C919-4B86-8E05-0488142E05DB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration", "Integration", "{6E035936-675B-4F6B-8E7A-3590FDF21978}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIO.Integration.Identity", "tests\Integration\SIO.Integration.Identity\SIO.Integration.Identity.csproj", "{6CD0D99F-D88D-44F9-96EA-80D6960761B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A362A39B-E7E0-45B0-BA93-5EF81CF536A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A362A39B-E7E0-45B0-BA93-5EF81CF536A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A362A39B-E7E0-45B0-BA93-5EF81CF536A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A362A39B-E7E0-45B0-BA93-5EF81CF536A8}.Release|Any CPU.Build.0 = Release|Any CPU + {CB4D700D-52A9-4D57-9A40-E2F63E6866E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB4D700D-52A9-4D57-9A40-E2F63E6866E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB4D700D-52A9-4D57-9A40-E2F63E6866E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB4D700D-52A9-4D57-9A40-E2F63E6866E9}.Release|Any CPU.Build.0 = Release|Any CPU + {86E78C2E-256C-4DB1-9743-1EB1693B5046}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86E78C2E-256C-4DB1-9743-1EB1693B5046}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86E78C2E-256C-4DB1-9743-1EB1693B5046}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86E78C2E-256C-4DB1-9743-1EB1693B5046}.Release|Any CPU.Build.0 = Release|Any CPU + {511423FB-C919-4B86-8E05-0488142E05DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {511423FB-C919-4B86-8E05-0488142E05DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {511423FB-C919-4B86-8E05-0488142E05DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {511423FB-C919-4B86-8E05-0488142E05DB}.Release|Any CPU.Build.0 = Release|Any CPU + {6CD0D99F-D88D-44F9-96EA-80D6960761B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CD0D99F-D88D-44F9-96EA-80D6960761B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CD0D99F-D88D-44F9-96EA-80D6960761B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CD0D99F-D88D-44F9-96EA-80D6960761B1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A362A39B-E7E0-45B0-BA93-5EF81CF536A8} = {93241E08-D16C-4DA4-8FE1-EB557F1C0456} + {CB4D700D-52A9-4D57-9A40-E2F63E6866E9} = {93241E08-D16C-4DA4-8FE1-EB557F1C0456} + {86E78C2E-256C-4DB1-9743-1EB1693B5046} = {93241E08-D16C-4DA4-8FE1-EB557F1C0456} + {511423FB-C919-4B86-8E05-0488142E05DB} = {93241E08-D16C-4DA4-8FE1-EB557F1C0456} + {6E035936-675B-4F6B-8E7A-3590FDF21978} = {79658CA3-C775-4A25-92AB-213294FF895F} + {6CD0D99F-D88D-44F9-96EA-80D6960761B1} = {6E035936-675B-4F6B-8E7A-3590FDF21978} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F6AEAE19-668A-4D7C-9EC0-F5623B5D21A2} + EndGlobalSection +EndGlobal diff --git a/docs/migrations.md b/docs/migrations.md new file mode 100644 index 0000000..e69de29 diff --git a/src/SIO.Abstraction/SIO.Abstraction.csproj b/src/SIO.Abstraction/SIO.Abstraction.csproj new file mode 100644 index 0000000..9f5c4f4 --- /dev/null +++ b/src/SIO.Abstraction/SIO.Abstraction.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/src/SIO.Domain/SIO.Domain.csproj b/src/SIO.Domain/SIO.Domain.csproj new file mode 100644 index 0000000..9f5c4f4 --- /dev/null +++ b/src/SIO.Domain/SIO.Domain.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/src/SIO.Identity/Controllers/ValuesController.cs b/src/SIO.Identity/Controllers/ValuesController.cs new file mode 100644 index 0000000..fd95736 --- /dev/null +++ b/src/SIO.Identity/Controllers/ValuesController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace SIO.Identity.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/src/SIO.Identity/Program.cs b/src/SIO.Identity/Program.cs new file mode 100644 index 0000000..a7b82ae --- /dev/null +++ b/src/SIO.Identity/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace SIO.Identity +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/src/SIO.Identity/SIO.Identity.csproj b/src/SIO.Identity/SIO.Identity.csproj new file mode 100644 index 0000000..423afac --- /dev/null +++ b/src/SIO.Identity/SIO.Identity.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + diff --git a/src/SIO.Identity/Startup.cs b/src/SIO.Identity/Startup.cs new file mode 100644 index 0000000..1386932 --- /dev/null +++ b/src/SIO.Identity/Startup.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace SIO.Identity +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseMvc(); + } + } +} diff --git a/src/SIO.Identity/appsettings.Development.json b/src/SIO.Identity/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/src/SIO.Identity/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/SIO.Identity/appsettings.json b/src/SIO.Identity/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/src/SIO.Identity/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/src/SIO.Migrations/SIO.Migrations.csproj b/src/SIO.Migrations/SIO.Migrations.csproj new file mode 100644 index 0000000..9f5c4f4 --- /dev/null +++ b/src/SIO.Migrations/SIO.Migrations.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/tests/Integration/SIO.Integration.Identity/SIO.Integration.Identity.csproj b/tests/Integration/SIO.Integration.Identity/SIO.Integration.Identity.csproj new file mode 100644 index 0000000..501a5ce --- /dev/null +++ b/tests/Integration/SIO.Integration.Identity/SIO.Integration.Identity.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp2.2 + + false + + + + + + + + +