diff options
| author | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-02-28 20:52:56 +0200 |
|---|---|---|
| committer | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-02-28 20:52:56 +0200 |
| commit | 8d604f9e353cf0b8b8302fc6fb71dd4408c937fe (patch) | |
| tree | 9471b70a01b459c08bf2c1528cb4aba76d781f97 /src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs | |
| parent | d53d67776f0746cc6eb8973f7c55767fcf82df65 (diff) | |
| parent | 2a85613d6827f5a1d151b856739863fbe9782143 (diff) | |
| download | DevHive-8d604f9e353cf0b8b8302fc6fb71dd4408c937fe.tar DevHive-8d604f9e353cf0b8b8302fc6fb71dd4408c937fe.tar.gz DevHive-8d604f9e353cf0b8b8302fc6fb71dd4408c937fe.zip | |
merge with dev
Diffstat (limited to 'src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs')
| -rw-r--r-- | src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs index 153b17f..6a5799f 100644 --- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs +++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs @@ -1,3 +1,6 @@ +using System.Text; +using DevHive.Common.Jwt; +using DevHive.Common.Jwt.Interfaces; using DevHive.Data.Interfaces; using DevHive.Data.Repositories; using DevHive.Services.Interfaces; @@ -27,11 +30,19 @@ namespace DevHive.Web.Configurations.Extensions services.AddTransient<IPostService, PostService>(); services.AddTransient<ICommentService, CommentService>(); services.AddTransient<IFeedService, FeedService>(); + services.AddTransient<IRateService, RateService>(); + services.AddTransient<ICloudService, CloudinaryService>(options => new CloudinaryService( cloudName: configuration.GetSection("Cloud").GetSection("cloudName").Value, apiKey: configuration.GetSection("Cloud").GetSection("apiKey").Value, apiSecret: configuration.GetSection("Cloud").GetSection("apiSecret").Value)); + + services.AddSingleton<IJwtService, JwtService>(options => + new JwtService( + signingKey: Encoding.ASCII.GetBytes(configuration.GetSection("Jwt").GetSection("signingKey").Value), + validationIssuer: configuration.GetSection("Jwt").GetSection("validationIssuer").Value, + audience: configuration.GetSection("Jwt").GetSection("audience").Value)); services.AddTransient<IRatingService, RatingService>(); } } |
