-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .NET Standard 2.0 support to support ASP.NET Core 1 and 2
- Loading branch information
1 parent
32accdd
commit 34dd0aa
Showing
11 changed files
with
101 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Amazon; | ||
using Amazon.DynamoDBv2; | ||
using Amazon.KeyManagementService; | ||
using Amazon.Runtime; | ||
using Microsoft.Extensions.Configuration; | ||
using Narochno.Credstash; | ||
using Narochno.Credstash.Configuration; | ||
|
||
namespace CredstashTester | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
//var creds = new StoredProfileAWSCredentials(); | ||
//var stash = new Credstash(new CredstashOptions(), new AmazonKeyManagementServiceClient(creds, RegionEndpoint.EUWest1), | ||
// new AmazonDynamoDBClient(creds, RegionEndpoint.EUWest1)); | ||
//var val = stash.GetSecret("redis:host", null, new Dictionary<string, string>() | ||
//{ | ||
// { "environment", "beta"} | ||
//}).Result; | ||
//Console.WriteLine(val); | ||
|
||
//foreach (var entry in stash.List().Result) | ||
//{ | ||
// Console.WriteLine($"{entry.Name} v{entry.Version}"); | ||
//} | ||
|
||
AWSCredentials creds = new StoredProfileAWSCredentials(); | ||
var configBuilder = new ConfigurationBuilder(); | ||
configBuilder.AddCredstash(creds, new CredstashConfigurationOptions() | ||
{ | ||
EncryptionContext = new Dictionary<string, string>() | ||
{ | ||
{"environment", "beta"} | ||
} | ||
}); | ||
|
||
var config = configBuilder.Build(); | ||
var beta = config.GetSection("beta"); | ||
|
||
Print(beta, string.Empty); | ||
} | ||
|
||
private static void Print(IConfiguration c, string prefix) | ||
{ | ||
foreach (var section in c.GetChildren()) | ||
{ | ||
if (!string.IsNullOrEmpty(section.Value)) | ||
{ | ||
Console.WriteLine(prefix + ":" + section.Key + " " + section.Value); | ||
} | ||
Print(section, prefix + ":" + section.Key); | ||
} | ||
} | ||
} | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
using Amazon.Runtime; | ||
using Microsoft.Extensions.Configuration; | ||
using Narochno.Credstash.Configuration; | ||
|
||
namespace CredstashTester | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
//var creds = new StoredProfileAWSCredentials(); | ||
//var stash = new Credstash(new CredstashOptions(), new AmazonKeyManagementServiceClient(creds, RegionEndpoint.EUWest1), | ||
// new AmazonDynamoDBClient(creds, RegionEndpoint.EUWest1)); | ||
//var val = stash.GetSecret("redis:host", null, new Dictionary<string, string>() | ||
//{ | ||
// { "environment", "beta"} | ||
//}).Result; | ||
//Console.WriteLine(val); | ||
|
||
//foreach (var entry in stash.List().Result) | ||
//{ | ||
// Console.WriteLine($"{entry.Name} v{entry.Version}"); | ||
//} | ||
|
||
AWSCredentials creds = new StoredProfileAWSCredentials(); | ||
var configBuilder = new ConfigurationBuilder(); | ||
configBuilder.AddCredstash(creds, new CredstashConfigurationOptions() | ||
{ | ||
EncryptionContext = new Dictionary<string, string>() | ||
{ | ||
{"environment", "beta"} | ||
} | ||
}); | ||
|
||
var config = configBuilder.Build(); | ||
var beta = config.GetSection("beta"); | ||
|
||
Print(beta, string.Empty); | ||
} | ||
|
||
private static void Print(IConfiguration c, string prefix) | ||
{ | ||
foreach (var section in c.GetChildren()) | ||
{ | ||
if (!string.IsNullOrEmpty(section.Value)) | ||
{ | ||
Console.WriteLine(prefix + ":" + section.Key + " " + section.Value); | ||
} | ||
Print(section, prefix + ":" + section.Key); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
src/Narochno.Credstash.Configuration/Narochno.Credstash.Configuration.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<VersionPrefix>1.1.1</VersionPrefix> | ||
<VersionPrefix>2.0.0</VersionPrefix> | ||
<Authors>adamhathcock</Authors> | ||
<TargetFramework>netstandard1.3</TargetFramework> | ||
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks> | ||
<AssemblyName>Narochno.Credstash.Configuration</AssemblyName> | ||
<PackageId>Narochno.Credstash.Configuration</PackageId> | ||
<PackageTags>credstash</PackageTags> | ||
<PackageProjectUrl>https://github.com/Narochno/Narochno.Credstash</PackageProjectUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Narochno.Credstash\Narochno.Credstash.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' "> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.2" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.