diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs index 012c4eaca5..c6c7da2bd2 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs @@ -122,6 +122,8 @@ namespace OpenSim.Grid.AssetInventoryServer } frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty)); + AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider; + AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider; return true; } diff --git a/OpenSim/Grid/AssetInventoryServer/Interfaces.cs b/OpenSim/Grid/AssetInventoryServer/Interfaces.cs index c4aa7ac8c3..19298c5932 100644 --- a/OpenSim/Grid/AssetInventoryServer/Interfaces.cs +++ b/OpenSim/Grid/AssetInventoryServer/Interfaces.cs @@ -102,14 +102,14 @@ namespace OpenSim.Grid.AssetInventoryServer BackendResponse TryPurgeFolder(Uri owner, UUID folderID); } - public interface IAuthenticationProvider + public interface IAuthenticationProvider : IAssetInventoryServerPlugin { void AddIdentifier(UUID authToken, Uri identifier); bool RemoveIdentifier(UUID authToken); bool TryGetIdentifier(UUID authToken, out Uri identifier); } - public interface IAuthorizationProvider + public interface IAuthorizationProvider : IAssetInventoryServerPlugin { bool IsMetadataAuthorized(UUID authToken, UUID assetID); /// diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/AuthorizeAll.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs similarity index 70% rename from OpenSim/Grid/AssetInventoryServer/Extensions/AuthorizeAll.cs rename to OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs index 10f3bdc32f..8974b6f6a4 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/AuthorizeAll.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs @@ -28,28 +28,54 @@ */ using System; -using ExtensionLoader; using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Grid.AssetInventoryServer.Extensions +namespace OpenSim.Grid.AssetInventoryServer.Plugins { - public class AuthorizeAll : IExtension, IAuthorizationProvider + public class AuthorizeAllPlugin : IAuthorizationProvider { AssetInventoryServer server; - public AuthorizeAll() + public AuthorizeAllPlugin() { } - public void Start(AssetInventoryServer server) + #region IPlugin implementation + + public void Initialise(AssetInventoryServer server) { this.server = server; + + Logger.Log.Info("[ASSET] Authorize All loaded."); } - public void Stop() + /// + /// Initialises asset interface + /// + public void Initialise() + { + Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); + throw new PluginNotInitialisedException(Name); + } + + public void Dispose() { } + public string Version + { + // TODO: this should be something meaningful and not hardcoded? + get { return "0.1"; } + } + + public string Name + { + get { return "AssetInventoryServer Null authentication frontend"; } + } + + #endregion IPlugin implementation + public bool IsMetadataAuthorized(UUID authToken, UUID assetID) { return true; diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/NullAuthentication.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs similarity index 67% rename from OpenSim/Grid/AssetInventoryServer/Extensions/NullAuthentication.cs rename to OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs index 96e210a835..81e58c6dd8 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/NullAuthentication.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs @@ -28,28 +28,54 @@ */ using System; -using ExtensionLoader; using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Grid.AssetInventoryServer.Extensions +namespace OpenSim.Grid.AssetInventoryServer.Plugins { - public class NullAuthentication : IExtension, IAuthenticationProvider + public class NullAuthenticationPlugin : IAuthenticationProvider { AssetInventoryServer server; - public NullAuthentication() + public NullAuthenticationPlugin() { } - public void Start(AssetInventoryServer server) + #region IPlugin implementation + + public void Initialise(AssetInventoryServer server) { this.server = server; + + Logger.Log.Info("[ASSET] Null Authentication loaded."); } - public void Stop() + /// + /// Initialises asset interface + /// + public void Initialise() + { + Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); + throw new PluginNotInitialisedException(Name); + } + + public void Dispose() { } + public string Version + { + // TODO: this should be something meaningful and not hardcoded? + get { return "0.1"; } + } + + public string Name + { + get { return "AssetInventoryServer Null authentication frontend"; } + } + + #endregion IPlugin implementation + public void AddIdentifier(UUID authToken, Uri identifier) { } diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml index 0ec28deb5c..67c4cd209d 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml @@ -16,4 +16,10 @@ + + + + + +