nettoyages

vnext
Paul Schneider 8 years ago
parent 27769da140
commit 7aa1085474
7 changed files with 35 additions and 11 deletions

@ -117,7 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="About"><value>À propos de</value></data>
<data name="About"><value>À propos de </value></data>
<data name="About BookAStar"><value>À propos de BookAStar</value></data>
<data name="About Message"><value>Bienvenue chez vos stars.</value></data>
<data name="access denied"><value>Accès refusé</value></data>

@ -28,6 +28,12 @@
<dd>
@Html.DisplayFor(model => model.RedirectUri)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ApplicationID)
</dt>
<dd>
@Html.DisplayFor(model => model.ApplicationID)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Secret)
</dt>

@ -14,17 +14,24 @@
},
"Site": {
"Title": "Yavsc",
"Slogan":"Yavsc!",
"Authority": "http://127.0.0.1:5000/",
"Audience": "http://127.0.0.1:5000/",
"Owner": {
"Name": "Paul",
"Address": "paul@pschneider.fr"
"Name": "[query]",
"Address": "bigchief@company.com"
},
"Admin": {
"Name": "Paul",
"Address": "contact@pschneider.fr"
"Name": "[answer]",
"Address": "contact@company.com"
},
"UserFiles": {
"RootDir": "UserFiles",
"Quota": "200M"
},
"DirNames": {
"Bills":"Bills",
"Blog":"Blog"
}
},
"Smtp": {

@ -9063,7 +9063,7 @@
},
"MailKit/1.3.0-beta7": {
"type": "package",
"sha512": "xO66P+XLWyo3/POInJpkCsA0bFI3XmDxsdR+rSXCm9d7kbPU6kFBgvXT4AxW0TaWYUcsaxJEcZdhMgOODWu/ew==",
"sha512": "LalD+6uE97WdfZ9Ohmz2ZeYbPXzql4VNazGO/e9PLMENKNPwENc4eSr8v/r+mHY3EsRsAH34DCkub8rA4Zwyrw==",
"files": [
"lib/dotnet5.5/MailKit.dll",
"lib/dotnet5.5/MailKit.xml",
@ -9088,7 +9088,7 @@
},
"MarkdownDeep.NET/1.5.0": {
"type": "package",
"sha512": "Y0vPM1u1nNtNhTVI6lZPr80W3PlTJZROmc7oqvjg85XVzVjlZX1Cp5+yOuz+qHa264JosYjzGAiBUQuWdnBeZg==",
"sha512": "8UPmeM6TB0ut7EKBd+uA7bY988SN+C9NxKiNqLrlUZrGZQQGiQzomeIm33uyvLJ1Umm23mdf7/fe204AOhYMMw==",
"files": [
"lib/net451/MarkdownDeep.dll",
"MarkdownDeep.NET.1.5.0.nupkg",
@ -10985,7 +10985,7 @@
},
"MimeKit/1.3.0-beta7": {
"type": "package",
"sha512": "vWNZ2pDJXTFRHiErdZW6bOPej+sikIOjf8LlZSSiZXgYE2s4raQeHVQtvyGVpoQvx/PKXKoACzJDCkm9hr/OQQ==",
"sha512": "M7F4OnPXfcI4AljQUdvok29vz3DEruiqIBDIn6zGVdFQpNpaVbmrp80YLX9SH2hJO+8fSOX6/k3ScUXqZheFSQ==",
"files": [
"lib/dotnet5.4/MimeKit.dll",
"lib/dotnet5.4/MimeKit.xml",

@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc
{

@ -111,6 +111,10 @@ namespace Yavsc
services.Configure<GoogleAuthSettings>(googleSettings);
var cinfoSettings = Configuration.GetSection("Authentication").GetSection("Societeinfo");
services.Configure<CompanyInfoSettings>(cinfoSettings);
var oauthLocalAppSettings = Configuration.GetSection("Authentication").GetSection("OAuth2LocalApp");
services.Configure<OAuth2AppSettings>(oauthLocalAppSettings);
var oauthFacebookSettings = Configuration.GetSection("Authentication").GetSection("Facebook");
services.Configure<FacebookOAuth2AppSettings>(oauthFacebookSettings);
services.Configure<MvcOptions>(options =>
{
@ -171,6 +175,7 @@ namespace Yavsc
services.Add(ServiceDescriptor.Singleton(typeof(IOptions<SmtpSettings>), typeof(OptionsManager<SmtpSettings>)));
services.Add(ServiceDescriptor.Singleton(typeof(IOptions<GoogleAuthSettings>), typeof(OptionsManager<GoogleAuthSettings>)));
services.Add(ServiceDescriptor.Singleton(typeof(IOptions<CompanyInfoSettings>), typeof(OptionsManager<CompanyInfoSettings>)));
services.Add(ServiceDescriptor.Singleton(typeof(IOptions<OAuth2AppSettings>), typeof(OptionsManager<OAuth2AppSettings>)));
services.AddTransient<Microsoft.Extensions.WebEncoders.UrlEncoder, UrlEncoder>();
services.AddDataProtection();
@ -229,6 +234,10 @@ namespace Yavsc
{
options.AddPolicy("AdministratorOnly", policy => policy.RequireRole(Constants.AdminGroupName));
options.AddPolicy("FrontOffice", policy => policy.RequireRole(Constants.FrontOfficeGroupName));
options.AddPolicy("API", policy => {
policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme);
policy.RequireClaim(OpenIdConnectConstants.Claims.Scope, "api-resource-controller");
});
// options.AddPolicy("EmployeeId", policy => policy.RequireClaim("EmployeeId", "123", "456"));
// options.AddPolicy("BuildingEntry", policy => policy.Requirements.Add(new OfficeEntryRequirement()));
});
@ -259,7 +268,7 @@ namespace Yavsc
{
options.ResourcesPath = "Resources";
})
.AddDataAnnotationsLocalization();
.AddDataAnnotationsLocalization( opt => opt.ResourcesPath = "Resources");
services.AddScoped<LanguageActionFilter>();
// Inject ticket formatting
@ -284,6 +293,7 @@ namespace Yavsc
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
IOptions<SiteSettings> siteSettings, IOptions<RequestLocalizationOptions> localizationOptions,
IOptions<OAuth2AppSettings> oauth2SettingsContainer,
ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
@ -326,7 +336,9 @@ namespace Yavsc
{
if (ex.InnerException is InvalidOperationException)
// nothing to do ?
{ }
{
// TODO Send an email to the Admin
}
else throw ex;
}
}

Loading…