Added support for per site options and OpenID Connect

This commit is contained in:
Shaun Walker
2022-03-13 22:55:52 -04:00
parent a47ecbdea9
commit 9bbbff31f8
31 changed files with 1064 additions and 180 deletions

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace Oqtane.Models
{
public interface IAlias
{
int AliasId { get; set; }
string Name { get; set; }
int TenantId { get; set; }
int SiteId { get; set; }
bool IsDefault { get; set; }
string CreatedBy { get; set; }
DateTime CreatedOn { get; set; }
string ModifiedBy { get; set; }
DateTime ModifiedOn { get; set; }
string Path { get; }
string SiteKey { get; }
Dictionary<string, string> SiteSettings { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Oqtane.Models
@ -6,7 +7,7 @@ namespace Oqtane.Models
/// <summary>
/// An Alias maps a url like `oqtane.my` or `oqtane.my/products` to a <see cref="Oqtane.Models.Site"/> and <see cref="Oqtane.Models.Tenant"/>
/// </summary>
public class Alias : IAuditable
public class Alias : IAlias, IAuditable
{
/// <summary>
/// The primary ID for internal use. It's also used in API calls to identify the site.
@ -68,5 +69,22 @@ namespace Oqtane.Models
}
}
/// <summary>
/// Unique key used for identifying a site within a runtime process (ie. cache, etc...)
/// </summary>
[NotMapped]
public string SiteKey
{
get
{
return TenantId.ToString() + ":" + SiteId.ToString();
}
}
/// <summary>
/// Site-specific settings
/// </summary>
[NotMapped]
public Dictionary<string, string> SiteSettings { get; set; }
}
}

View File

@ -85,5 +85,8 @@ namespace Oqtane.Shared {
public static readonly string AntiForgeryTokenCookieName = "X-XSRF-TOKEN-COOKIE";
public static readonly string DefaultVisitorFilter = "bot,crawler,slurp,spider,(none),??";
public static readonly string HttpContextAliasKey = "SiteState.Alias";
public static readonly string SiteToken = "{SiteToken}";
}
}

View File

@ -2,7 +2,7 @@ using Oqtane.Models;
namespace Oqtane.Shared
{
// this class is used for passing state between components and services, or controllers and repositories
// this class is used for passing state between components and services as well as controllers and repositories
public class SiteState
{
public Alias Alias { get; set; }