simpler, better

This commit is contained in:
2018-06-10 20:40:11 +02:00
parent b14ad5242b
commit 78c89b32b4
27 changed files with 3323 additions and 50 deletions

55
Yavsc.Server/Constants.cs Normal file
View File

@ -0,0 +1,55 @@
namespace Yavsc
{
using Yavsc.Models.Auth;
public static class Constants
{
public const string ApplicationName = "Yavsc",
CompanyClaimType = "https://schemas.pschneider.fr/identity/claims/Company",
UserNameRegExp = @"^[a-zA-Z][a-zA-Z0-9 ]*$",
AuthorizePath = "~/authorize",
TokenPath = "~/token",
LoginPath = "~/signin",
LogoutPath = "~/signout", UserInfoPath = "~/api/me",
ApplicationAuthenticationSheme = "ServerCookie",
ExternalAuthenticationSheme= "ExternalCookie",
CompanyInfoUrl = " https://societeinfo.com/app/rest/api/v1/company/json?registration_number={0}&key={1}",
DefaultFactor = "Default",
MobileAppFactor = "Mobile Application",
EMailFactor = "Email",
SMSFactor = "SMS",
AdminGroupName = "Administrator",
PerformerGroupName = "Performer",
StarGroupName = "Star",
StarHunterGroupName = "StarHunter",
BlogModeratorGroupName = "Moderator",
FrontOfficeGroupName = "FrontOffice",
GCMNotificationUrl = "https://gcm-http.googleapis.com/gcm/send",
UserFilesPath = "/files",
AvatarsPath = "/avatars",
GitPath = "/git",
DefaultAvatar = "/images/Users/icon_user.png",
AnonAvatar = "/images/Users/icon_anon_user.png";
public static readonly long DefaultFSQ = 1024*1024*500;
public static readonly Scope[] SiteScopes = { 
new Scope { Id = "profile", Description = "Your profile informations" },  
new Scope { Id = "book" , Description ="Your booking interface"},  
new Scope { Id = "blog" , Description ="Your blogging interface"},  
new Scope { Id = "estimate" , Description ="Your estimation interface"},  
new Scope { Id = "contract" , Description ="Your contract signature access"}, 
new Scope { Id = "admin" , Description ="Your administration rights on this site"}, 
new Scope { Id = "moderation" , Description ="Your moderator interface"}, 
new Scope { Id = "frontoffice" , Description ="Your front office interface" }
};
public const string SshHeaderKey = "SSH";
private static readonly string[] GoogleScopes = { "openid", "profile", "email" };
public static readonly string[] GoogleCalendarScopes =
{ "openid", "profile", "email", "https://www.googleapis.com/auth/calendar" };
public static readonly string NoneCode = "none";
}
}

View File

@ -0,0 +1,9 @@
namespace Yavsc.Server.Helpers
{
public static class DbHelpers
{
// FIXME BUG [fr] DependencyInjection Pourquoi ce champ ne pourrait pas devenir une propriété ?
// : casse à l'execution d'un controlleur, se plaignant d'une valeur nule
public static string ConnectionString = "Server=Your-Server-Adress;Port=5432;Database=YourDadabaseName;Username=YourDatabaseUserName;Password=YourPassword;";
}
}

View File

@ -3,3 +3,5 @@ include ../dnx.mk
all: $(BINTARGETPATH)
bin/$(CONFIGURATION)/Yavsc.Server.dll: ../OAuth.AspNet.AuthServer/bin/$(CONFIGURATION)/OAuth.AspNet.AuthServer.dll

View File

@ -1,9 +1,18 @@
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models;
namespace Yavsc.Server.Models.IT.SourceCode
{
public class GitRepositoryReference
{
public string Url { get; set; }
public string Path { get; set; }
public string Branch { get; set; }
public string OwnerId { get; set; }
[ForeignKey("OwnerId")]
public virtual ApplicationUser Owner { get; set; }
}
}

View File

@ -8,7 +8,6 @@ namespace Yavsc.ViewModels.Account
// ErrorMessage = "",
[Display(ResourceType = typeof(RegisterViewModel), Name = "UserName")]
[StringLength(102)]
[YaRegularExpression(@"[a-zA-Z0-9 .'_-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(RegisterViewModel))]
public string UserName { get; set; }
@ -23,11 +22,9 @@ namespace Yavsc.ViewModels.Account
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
[Display(ResourceType = typeof(RegisterViewModel), Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(ResourceType = typeof(RegisterViewModel), Name = "PasswordConfirm")]
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(RegisterViewModel) )]
public string ConfirmPassword { get; set; }

View File

@ -45,6 +45,7 @@
"defaultNamespace": "Yavsc"
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-*",
"Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
@ -64,7 +65,9 @@
"PayPalMerchant-net451": "2.7.109",
"MailKit": "1.12.0",
"Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01",
"Yavsc.Abstract": {}
"Yavsc.Abstract": {
"type": "build"
}
},
"frameworks": {
"dnx451": {
@ -102,4 +105,4 @@
"ef": "EntityFramework.Commands",
"gen": "Microsoft.Extensions.CodeGeneration"
}
}
}

View File

@ -12,6 +12,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -75,6 +95,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -1190,6 +1232,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -1239,6 +1299,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -2354,6 +2433,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -2403,6 +2500,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -3518,6 +3634,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -3581,6 +3717,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -4696,6 +4854,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -4759,6 +4937,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -5874,6 +6074,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -5923,6 +6141,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -7038,6 +7275,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -7087,6 +7342,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -8202,6 +8476,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -8251,6 +8543,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -9366,6 +9677,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -9415,6 +9744,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -10537,6 +10885,33 @@
"Readme.txt"
]
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
"sha512": "+wa2VWX3/vDkOpeCeIotMevqpIISimGqeYNTGYRLRhv+8HzsCLeymLzmmYpjav6zYQVvuJiJodapQvijAIfRrA==",
"files": [
"app/ef",
"app/ef.cmd",
"app/project.json",
"build/netcore50/EntityFramework.Commands.props",
"EntityFramework.Commands.7.0.0-rc1-final.nupkg",
"EntityFramework.Commands.7.0.0-rc1-final.nupkg.sha512",
"EntityFramework.Commands.nuspec",
"lib/dnx451/EntityFramework.Commands.dll",
"lib/dnx451/EntityFramework.Commands.xml",
"lib/dnxcore50/EntityFramework.Commands.dll",
"lib/dnxcore50/EntityFramework.Commands.xml",
"lib/net451/EntityFramework.Commands.dll",
"lib/net451/EntityFramework.Commands.xml",
"lib/netcore50/_._",
"tools/about_EntityFramework.help.txt",
"tools/EntityFramework.psd1",
"tools/EntityFramework.psm1",
"tools/init.ps1",
"tools/install.ps1",
"tools/OperationHandlers.cs"
]
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
@ -10571,6 +10946,24 @@
"lib/netcore50/EntityFramework.Relational.xml"
]
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
"sha512": "sXAqOxpHmbqOELC21vAzKlsjqgNCrk3jEjyJxjGnn1+j4hazxiqgSBTl8ZofqYzLO6ias9WfeXJy8HcXOl7waw==",
"files": [
"build/netcore50/EntityFramework.Relational.Design.props",
"EntityFramework.Relational.Design.7.0.0-rc1-final.nupkg",
"EntityFramework.Relational.Design.7.0.0-rc1-final.nupkg.sha512",
"EntityFramework.Relational.Design.nuspec",
"lib/dnx451/EntityFramework.Relational.Design.dll",
"lib/dnx451/EntityFramework.Relational.Design.xml",
"lib/dnxcore50/EntityFramework.Relational.Design.dll",
"lib/dnxcore50/EntityFramework.Relational.Design.xml",
"lib/net451/EntityFramework.Relational.Design.dll",
"lib/net451/EntityFramework.Relational.Design.xml",
"lib/netcore50/_._"
]
},
"Gapi.net45/1.0.0": {
"type": "package",
"sha512": "ZA31xhTPss1akMMgT3PvDNkqI46t9dvkxgyKVnjXKP9OFSNSSxvSomev5Srvq1tXyadCP0cFBM1GkS0qLwTtUg==",
@ -12133,6 +12526,7 @@
},
"projectFileDependencyGroups": {
"": [
"EntityFramework.Commands >= 7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework >= 3.0.0-rc1-*",
"Microsoft.Extensions.Configuration.Abstractions >= 1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions >= 1.0.0-rc1-final",