diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e3f23f5 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,14 @@ +# The MIT License (MIT) # + +Copyright (c) 2023 Umbraco + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/README.md b/README.md index a26311a..4258149 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,23 @@ Secondly, the developer has access to an interface - `IAuthorizedServiceCaller` ## Usage +### Installation + +To easily install the package you can use the `Package Manager Console` from Visual Studio, or the `dotnet CLI` tool. + +#### Package Manager Console +``` +Install-Package +Umbraco.AuthorizedServices +``` + +#### Dotnet CLI +``` +dotnet add package +Umbraco.AuthorizedServices +``` + + ### App Creation Services that this package are intended to support will offer an OAuth authentication and authorization flow against an "app" that the developer will need to create with the service. From this various information will be available, including for example a "client ID" and "client secret" that will need to be applied in configuration. diff --git a/Umbraco.AuthorizedServices.sln b/Umbraco.AuthorizedServices.sln index de63799..eb67253 100644 --- a/Umbraco.AuthorizedServices.sln +++ b/Umbraco.AuthorizedServices.sln @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props global.json = global.json icon.png = icon.png + LICENSE.md = LICENSE.md README.md = README.md umbraco-marketplace.json = umbraco-marketplace.json version.json = version.json diff --git a/src/Umbraco.AuthorizedServices/AuthorizedServicesComposer.cs b/src/Umbraco.AuthorizedServices/AuthorizedServicesComposer.cs index 9a50f81..f043539 100644 --- a/src/Umbraco.AuthorizedServices/AuthorizedServicesComposer.cs +++ b/src/Umbraco.AuthorizedServices/AuthorizedServicesComposer.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Umbraco.AuthorizedServices.Configuration; +using Umbraco.AuthorizedServices.Manifests; using Umbraco.AuthorizedServices.Migrations; using Umbraco.AuthorizedServices.Services; using Umbraco.AuthorizedServices.Services.Implement; @@ -18,6 +19,9 @@ public void Compose(IUmbracoBuilder builder) IConfigurationSection configSection = builder.Config.GetSection("Umbraco:AuthorizedServices"); builder.Services.Configure(configSection); + // manifest filter + builder.ManifestFilters().Append(); + builder.Services.AddUnique(); builder.Services.AddUnique(); builder.Services.AddUnique(); diff --git a/src/Umbraco.AuthorizedServices/ClientApp/src/package.manifest b/src/Umbraco.AuthorizedServices/ClientApp/src/package.manifest deleted file mode 100644 index a5aeb6a..0000000 --- a/src/Umbraco.AuthorizedServices/ClientApp/src/package.manifest +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "Umbraco Authorized Services", - "version": "", - "bundleOptions": "None", - "allowPackageTelemetry": true, - "css": [ - "~/App_Plugins/UmbracoAuthorizedServices/css/style.css" - ], - "javascript": [ - "~/App_Plugins/UmbracoAuthorizedServices/index.js" - ] -} diff --git a/src/Umbraco.AuthorizedServices/Constants.cs b/src/Umbraco.AuthorizedServices/Constants.cs index 47a9635..5e9a4a4 100644 --- a/src/Umbraco.AuthorizedServices/Constants.cs +++ b/src/Umbraco.AuthorizedServices/Constants.cs @@ -1,3 +1,5 @@ +using System.Diagnostics; + namespace Umbraco.AuthorizedServices; public static class Constants @@ -6,6 +8,8 @@ public static class Constants public const string Separator = "-"; + public static readonly string InformationalVersion = FileVersionInfo.GetVersionInfo(typeof(Constants).Assembly.Location).ProductVersion!; + public static class Trees { public const string AuthorizedServices = nameof(AuthorizedServices); diff --git a/src/Umbraco.AuthorizedServices/Manifests/AuthorizedServicesManifestFilter.cs b/src/Umbraco.AuthorizedServices/Manifests/AuthorizedServicesManifestFilter.cs new file mode 100644 index 0000000..3b62410 --- /dev/null +++ b/src/Umbraco.AuthorizedServices/Manifests/AuthorizedServicesManifestFilter.cs @@ -0,0 +1,25 @@ +using Umbraco.Cms.Core.Manifest; + +namespace Umbraco.AuthorizedServices.Manifests; + +public class AuthorizedServicesManifestFilter : IManifestFilter +{ + public void Filter(List manifests) + { + manifests.Add(new PackageManifest + { + AllowPackageTelemetry = true, + Version = Constants.InformationalVersion, + PackageName = "Umbraco Authorized Services", + BundleOptions = BundleOptions.None, + Scripts = new[] + { + "/App_Plugins/UmbracoAuthorizedServices/index.js" + }, + Stylesheets = new[] + { + "/App_Plugins/UmbracoAuthorizedServices/css/style.css" + } + }); + } +} diff --git a/src/Umbraco.AuthorizedServices/Umbraco.AuthorizedServices.csproj b/src/Umbraco.AuthorizedServices/Umbraco.AuthorizedServices.csproj index 1d35b2d..a41e0c8 100644 --- a/src/Umbraco.AuthorizedServices/Umbraco.AuthorizedServices.csproj +++ b/src/Umbraco.AuthorizedServices/Umbraco.AuthorizedServices.csproj @@ -32,14 +32,7 @@ - - - - <_PackageManifestFiles Include="$(IntermediateOutputPath)clientassets\**\package.manifest" /> - - -