Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -2,3 +2,4 @@ | ||||
| .vs/ | ||||
| bin/ | ||||
| obj/ | ||||
| appsettings.secrets.json | ||||
| @@ -9,10 +9,4 @@ | ||||
|     <ProjectReference Include="..\FarmmapsApi\FarmmapsApi.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <None Update="appsettings.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </None> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|   "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|   "Endpoint": "https://test.farmmaps.eu/", | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -18,4 +18,8 @@ | ||||
|         <PackageReference Include="Winista.MimeDetect" Version="1.0.1" /> | ||||
|     </ItemGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|       <ProjectReference Include="..\Secrets\Secrets.csproj" /> | ||||
|     </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -20,6 +20,7 @@ namespace FarmmapsApi | ||||
|         { | ||||
|             IConfiguration config = new ConfigurationBuilder() | ||||
|                 .AddJsonFile("appsettings.json", false, true) | ||||
|                 .AddJsonFile("appsettings.secrets.json", false, true) | ||||
|                 .Build(); | ||||
|  | ||||
|             var configuration = config.Get<Configuration>(); | ||||
|   | ||||
| @@ -27,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FarmmapsDataDownload", "Far | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FarmmapsBulkSatDownload", "FarmmapsBulkSatDownload\FarmmapsBulkSatDownload.csproj", "{772DBDCD-9FAA-40A7-8551-2C1620C4AB67}" | ||||
| EndProject | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Secrets", "Secrets\Secrets.csproj", "{C4EE5ECA-253A-4B71-9F67-D231AC4517D6}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Any CPU = Debug|Any CPU | ||||
| @@ -69,6 +71,10 @@ Global | ||||
| 		{772DBDCD-9FAA-40A7-8551-2C1620C4AB67}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{772DBDCD-9FAA-40A7-8551-2C1620C4AB67}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{772DBDCD-9FAA-40A7-8551-2C1620C4AB67}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{C4EE5ECA-253A-4B71-9F67-D231AC4517D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{C4EE5ECA-253A-4B71-9F67-D231AC4517D6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{C4EE5ECA-253A-4B71-9F67-D231AC4517D6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{C4EE5ECA-253A-4B71-9F67-D231AC4517D6}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
|   | ||||
| @@ -10,9 +10,6 @@ | ||||
|     </ItemGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|       <None Update="appsettings.json"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|       <None Update="Data\**\*"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|   "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|   "Endpoint": "https://test.farmmaps.eu/", | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -6,9 +6,6 @@ | ||||
|     </PropertyGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|       <None Update="appsettings.json"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|       <None Update="Data\**\*"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|     "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|     "Endpoint": "https://test.farmmaps.eu/", | ||||
|     "BasePath": "api/v1", | ||||
|     "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|     "RedirectUri": "http://example.nl/api", | ||||
|     "ClientId": "", | ||||
|     "ClientSecret": "", | ||||
|     "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -6,9 +6,6 @@ | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <None Update="appsettings.json"> | ||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|     </None> | ||||
|     <None Update="Data\**\*"> | ||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|     </None> | ||||
|   | ||||
| @@ -6,9 +6,6 @@ | ||||
|     </PropertyGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|         <None Update="appsettings.json"> | ||||
|             <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|         </None> | ||||
|         <None Update="Data\**\*"> | ||||
|             <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|         </None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|   "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|   "Endpoint": "https://test.farmmaps.eu/", | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -6,9 +6,6 @@ | ||||
|     </PropertyGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|       <None Update="appsettings.json"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|       <None Update="Data\**\*"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|   "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|   "Endpoint": "https://test.farmmaps.eu/", | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -6,9 +6,6 @@ | ||||
|   </PropertyGroup> | ||||
|  | ||||
| 	<ItemGroup> | ||||
| 		<None Update="appsettings.json"> | ||||
| 			<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
| 		</None> | ||||
| 		<None Update="Data\**\*"> | ||||
| 			<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
| 		</None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|     "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|     "Endpoint": "https://test.farmmaps.eu/", | ||||
|     "BasePath": "api/v1", | ||||
|     "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|     "RedirectUri": "http://example.nl/api", | ||||
|     "ClientId": "", | ||||
|     "ClientSecret": "", | ||||
|     "Scopes": [ "api" ] | ||||
| } | ||||
| @@ -6,15 +6,9 @@ | ||||
|     </PropertyGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|         <None Update="appsettings.json"> | ||||
|             <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|         </None> | ||||
|         <None Update="Data\**\*"> | ||||
|             <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|         </None> | ||||
|         <None Update="appsettings.json"> | ||||
|           <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|         </None> | ||||
|         <None Update="ZoneringInput.json"> | ||||
|           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|         </None> | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| { | ||||
|   "Authority": "https://accounts.test.farmmaps.eu/", | ||||
|   "Endpoint": "https://test.farmmaps.eu/", | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": [ "api" ] | ||||
| } | ||||
							
								
								
									
										10
									
								
								README.MD
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.MD
									
									
									
									
									
								
							| @@ -1,6 +1,14 @@ | ||||
| ##### NOT PRODUCTION READY CODE, JUST AN EXAMPLE | ||||
|  | ||||
| Put your clientId and clientSecret in the appsettings.json.   | ||||
| Put your clientId and clientSecret in a newly created appsettings.secrets.json file inside the root of the Secrets project.   | ||||
|  | ||||
| **appsettings.secrets.json** | ||||
| ``` | ||||
| { | ||||
|   "ClientId": "<clientId>", | ||||
|   "ClientSecret": "<clientSecret>" | ||||
| } | ||||
| ``` | ||||
|  | ||||
| * Isn't 100% complete.   | ||||
| * Needs proper testing of all public api methods. | ||||
|   | ||||
							
								
								
									
										18
									
								
								Secrets/Secrets.csproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Secrets/Secrets.csproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
|  | ||||
|     <PropertyGroup> | ||||
|         <TargetFramework>netstandard1.0</TargetFramework> | ||||
|     </PropertyGroup> | ||||
|  | ||||
|     <ItemGroup> | ||||
|       <None Remove="appsettings.json" /> | ||||
|       <Content Include="appsettings.json"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </Content> | ||||
|       <None Remove="appsettings.secrets.json" /> | ||||
|       <Content Include="appsettings.secrets.json"> | ||||
|         <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||
|       </Content> | ||||
|     </ItemGroup>     | ||||
|  | ||||
| </Project> | ||||
| @@ -4,7 +4,5 @@ | ||||
|   "BasePath": "api/v1", | ||||
|   "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", | ||||
|   "RedirectUri": "http://example.nl/api", | ||||
|   "ClientId": "", | ||||
|   "ClientSecret": "", | ||||
|   "Scopes": ["api"] | ||||
| } | ||||
		Reference in New Issue
	
	Block a user