Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
511328edf9
|
@ -202,9 +202,9 @@ namespace MediaBrowser.Api
|
|||
|
||||
var result = new PluginSecurityInfo
|
||||
{
|
||||
IsMBSupporter = kernel.PluginSecurityManager.IsMBSupporter,
|
||||
SupporterKey = kernel.PluginSecurityManager.SupporterKey,
|
||||
LegacyKey = kernel.PluginSecurityManager.LegacyKey
|
||||
IsMBSupporter = kernel.SecurityManager.IsMBSupporter,
|
||||
SupporterKey = kernel.SecurityManager.SupporterKey,
|
||||
LegacyKey = kernel.SecurityManager.LegacyKey
|
||||
};
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
|
@ -220,8 +220,8 @@ namespace MediaBrowser.Api
|
|||
|
||||
var info = _jsonSerializer.DeserializeFromStream<PluginSecurityInfo>(request.RequestStream);
|
||||
|
||||
kernel.PluginSecurityManager.SupporterKey = info.SupporterKey;
|
||||
kernel.PluginSecurityManager.LegacyKey = info.LegacyKey;
|
||||
kernel.SecurityManager.SupporterKey = info.SupporterKey;
|
||||
kernel.SecurityManager.LegacyKey = info.LegacyKey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
@ -152,6 +153,12 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <value>The TCP manager.</value>
|
||||
public IServerManager ServerManager { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plug-in security manager.
|
||||
/// </summary>
|
||||
/// <value>The plug-in security manager.</value>
|
||||
public ISecurityManager SecurityManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the UDP server port number.
|
||||
/// This can't be configurable because then the user would have to configure their client to discover the server.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.System;
|
||||
using System;
|
||||
|
@ -89,6 +90,12 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <value>The TCP manager.</value>
|
||||
IServerManager ServerManager { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plug-in security manager.
|
||||
/// </summary>
|
||||
/// <value>The plug-in security manager.</value>
|
||||
ISecurityManager SecurityManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the web socket listeners.
|
||||
/// </summary>
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
<Compile Include="ScheduledTasks\DailyTrigger.cs" />
|
||||
<Compile Include="ScheduledTasks\IntervalTrigger.cs" />
|
||||
<Compile Include="ScheduledTasks\WeeklyTrigger.cs" />
|
||||
<Compile Include="Security\ISecurityManager.cs" />
|
||||
<Compile Include="Updates\IInstallationManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
34
MediaBrowser.Common/Security/ISecurityManager.cs
Normal file
34
MediaBrowser.Common/Security/ISecurityManager.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Threading.Tasks;
|
||||
using Mediabrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Common.Security
|
||||
{
|
||||
public interface ISecurityManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is MB supporter.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is MB supporter; otherwise, <c>false</c>.</value>
|
||||
bool IsMBSupporter { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the supporter key.
|
||||
/// </summary>
|
||||
/// <value>The supporter key.</value>
|
||||
string SupporterKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the legacy key.
|
||||
/// </summary>
|
||||
/// <value>The legacy key.</value>
|
||||
string LegacyKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the registration status.
|
||||
/// </summary>
|
||||
/// <param name="feature">The feature.</param>
|
||||
/// <param name="mb2Equivalent">The MB2 equivalent.</param>
|
||||
/// <returns>Task{MBRegistrationRecord}.</returns>
|
||||
Task<MBRegistrationRecord> GetRegistrationStatus(string feature, string mb2Equivalent = null);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
@ -91,12 +92,6 @@ namespace MediaBrowser.Controller
|
|||
/// <value>The user data manager.</value>
|
||||
public UserDataManager UserDataManager { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plug-in security manager.
|
||||
/// </summary>
|
||||
/// <value>The plug-in security manager.</value>
|
||||
public PluginSecurityManager PluginSecurityManager { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The _users
|
||||
/// </summary>
|
||||
|
@ -321,7 +316,7 @@ namespace MediaBrowser.Controller
|
|||
ImageManager = (ImageManager)ApplicationHost.CreateInstance(typeof(ImageManager));
|
||||
ProviderManager = (ProviderManager)ApplicationHost.CreateInstance(typeof(ProviderManager));
|
||||
UserDataManager = (UserDataManager)ApplicationHost.CreateInstance(typeof(UserDataManager));
|
||||
PluginSecurityManager = (PluginSecurityManager)ApplicationHost.CreateInstance(typeof(PluginSecurityManager));
|
||||
SecurityManager = (PluginSecurityManager)ApplicationHost.CreateInstance(typeof(PluginSecurityManager));
|
||||
|
||||
base.FindParts();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using Mediabrowser.Model.Entities;
|
||||
using Mediabrowser.PluginSecurity;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
|
@ -12,7 +13,7 @@ namespace MediaBrowser.Controller.Plugins
|
|||
/// <summary>
|
||||
/// Class PluginSecurityManager
|
||||
/// </summary>
|
||||
public class PluginSecurityManager
|
||||
public class PluginSecurityManager : ISecurityManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The _is MB supporter
|
||||
|
|
|
@ -183,7 +183,7 @@ namespace MediaBrowser.Controller.Updates
|
|||
PackageType? packageType = null,
|
||||
Version applicationVersion = null)
|
||||
{
|
||||
var data = new Dictionary<string, string> { { "key", Kernel.PluginSecurityManager.SupporterKey }, { "mac", _networkManager.GetMacAddress() } };
|
||||
var data = new Dictionary<string, string> { { "key", Kernel.SecurityManager.SupporterKey }, { "mac", _networkManager.GetMacAddress() } };
|
||||
|
||||
using (var json = await HttpClient.Post(Controller.Kernel.MBAdminUrl + "service/package/retrieveall", data, Kernel.ResourcePools.Mb, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user