diff --git a/.editorconfig b/.editorconfig
index 80392cb9..16c9e49a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,10 +16,15 @@ insert_final_newline = true
charset = utf-8
# 4 space indentation
-[*.py]
+[*.py,*.xml,*.csproj]
indent_style = space
indent_size = 4
+# 2 space indentation
+[*.xml,*.csproj,*.axaml]
+indent_style = space
+indent_size = 2
+
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
diff --git a/contrib/Makefile b/contrib/Makefile
index 8e0e5567..62e1e22d 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -74,6 +74,7 @@ install: build_publish copy-binaries copy-services
done
reinstall: copy-binaries
+ @sync
@for project in $(APP_PROJECT_NAMES); do \
sudo systemctl start yavsc$${project} ; done
diff --git a/src/PostIt/PostIt/Views/HomePage.axaml b/src/PostIt/PostIt/Views/HomePage.axaml
index 1c188b31..bb7204d6 100644
--- a/src/PostIt/PostIt/Views/HomePage.axaml
+++ b/src/PostIt/PostIt/Views/HomePage.axaml
@@ -1,16 +1,16 @@
-
-
-
-
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="PostIt.Views.HomePage"
+ Header="Home">
+
+
+
+
diff --git a/src/Yavsc.Api/Program.cs b/src/Yavsc.Api/Program.cs
index 103d1773..4fa640d9 100644
--- a/src/Yavsc.Api/Program.cs
+++ b/src/Yavsc.Api/Program.cs
@@ -61,7 +61,7 @@ internal class Program
{
policy
.RequireAuthenticatedUser()
- .RequireClaim(JwtClaimTypes.Scope, new string[] { "com" });
+ .RequireClaim(JwtClaimTypes.Scope, new string[] { "api" });
});
})
.AddYavscCors(builder.Configuration)
diff --git a/src/Yavsc.Blogs/Program.cs b/src/Yavsc.Blogs/Program.cs
index ea9f044b..dd50b475 100644
--- a/src/Yavsc.Blogs/Program.cs
+++ b/src/Yavsc.Blogs/Program.cs
@@ -18,6 +18,7 @@ using Yavsc.Interface;
using Yavsc.Models;
using Yavsc.Services;
using Yavsc.Server.Helpers;
+using Microsoft.AspNetCore.Identity;
namespace Yavsc.Blogs;
internal class Program
@@ -32,62 +33,58 @@ internal class Program
var services = builder.Services;
- // builder.Services.AddDistributedMemoryCache();
-
- // accepts any access token issued by identity server
- // adds an authorization policy for scope 'scope1'
-
- services
+ // MvcBuilder
+ builder.Services
.AddAuthorization(options =>
{
options.AddPolicy("BlogScope", policy =>
{
policy
.RequireAuthenticatedUser()
- .RequireClaim(JwtClaimTypes.Scope, new string[] { "blogs" });
+ .RequireClaim(JwtClaimTypes.Scope, new string[] { "blog" });
});
})
.AddYavscCors(builder.Configuration)
.AddControllers();
- // accepts any access token issued by identity server
+ // AuthenticationBuilder
services.AddAuthentication("Bearer")
.AddYavscJwtBearer(builder.Configuration);
+ // DbContextBuilder
services.AddDbContext(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString(YavscConstants.YavscConnectionStringName)));
- services.AddTransient()
- .AddTransient()
- .AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddScoped();
-
- services.AddLocalization(options =>
+ // other services
+ services
+ .AddTransient()
+ .AddTransient, MailSender>()
+ .AddTransient()
+ .AddTransient()
+ .AddTransient()
+ .AddTransient()
+ .AddScoped()
+ .AddLocalization(options =>
{
options.ResourcesPath = "Resources";
- });
- services.AddDistributedMemoryCache();
-
- services.AddSession(options =>
+ })
+ .AddDistributedMemoryCache()
+ .AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromMinutes(30);
options.Cookie.HttpOnly = true;
options.Cookie.IsEssential = false;
- });
-
- services.Configure(options =>
+ }).Configure(options =>
{
var supportedCultures = new[] { "fr", "en", "pt" };
options.SetDefaultCulture(supportedCultures[0])
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures);
});
-
+
+ // App startup
using (var app = builder.Build())
{
-
if (app.Environment.IsDevelopment())
app.UseDeveloperExceptionPage();
@@ -97,13 +94,13 @@ internal class Program
.UseAuthorization()
.UseCors("default")
;
- app.MapIdentityApi().RequireAuthorization("blog");
-
+ app.MapIdentityApi().RequireAuthorization("blog");
+
app.MapGet("/identity", (HttpContext context) =>
new JsonResult(context?.User?.Claims.Select(c => new { c.Type, c.Value }))
);
- // app.UseSession();
+ app.UseSession();
await app.RunAsync();
}
}
diff --git a/src/Yavsc.Org/Directory.Packages.props b/src/Yavsc.Org/Directory.Packages.props
index 0d136bd7..c5f856a2 100644
--- a/src/Yavsc.Org/Directory.Packages.props
+++ b/src/Yavsc.Org/Directory.Packages.props
@@ -6,7 +6,7 @@
-
+
@@ -17,8 +17,8 @@
-
+
-
\ No newline at end of file
+
diff --git a/src/Yavsc.Org/Helpers/GoogleOAuthHelpers.cs b/src/Yavsc.Org/Helpers/GoogleOAuthHelpers.cs
index c772f1e8..8867003e 100644
--- a/src/Yavsc.Org/Helpers/GoogleOAuthHelpers.cs
+++ b/src/Yavsc.Org/Helpers/GoogleOAuthHelpers.cs
@@ -18,10 +18,7 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see .
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+
using Google.Apis.Auth.OAuth2;
@@ -32,7 +29,6 @@ using Google.Apis.Util.Store;
using Google.Apis.Auth.OAuth2.Responses;
using Google.Apis.Util;
using Yavsc.Models;
-using Yavsc.Models.Calendar;
using Yavsc.Services;
using Yavsc.Server.Helpers;
using Microsoft.AspNetCore.Identity;
diff --git a/src/Yavsc.Server/Directory.Packages.props b/src/Yavsc.Server/Directory.Packages.props
index 4c344619..661f437f 100644
--- a/src/Yavsc.Server/Directory.Packages.props
+++ b/src/Yavsc.Server/Directory.Packages.props
@@ -17,4 +17,4 @@
-
\ No newline at end of file
+
diff --git a/src/Yavsc.Server/Interfaces/ICalendarManager.cs b/src/Yavsc.Server/Interfaces/ICalendarManager.cs
index 01b81e95..c30f4f5e 100644
--- a/src/Yavsc.Server/Interfaces/ICalendarManager.cs
+++ b/src/Yavsc.Server/Interfaces/ICalendarManager.cs
@@ -19,7 +19,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see .
-using System;
using Google.Apis.Calendar.v3.Data;
namespace Yavsc.Services