Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions Umbraco.AuthorizedServices.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/Umbraco.AuthorizedServices/AuthorizedServicesComposer.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,6 +19,9 @@ public void Compose(IUmbracoBuilder builder)
IConfigurationSection configSection = builder.Config.GetSection("Umbraco:AuthorizedServices");
builder.Services.Configure<AuthorizedServiceSettings>(configSection);

// manifest filter
builder.ManifestFilters().Append<AuthorizedServicesManifestFilter>();

builder.Services.AddUnique<IAuthorizationClientFactory, AuthorizationClientFactory>();
builder.Services.AddUnique<IAuthorizationParametersBuilder, AuthorizationParametersBuilder>();
builder.Services.AddUnique<IAuthorizationRequestSender, AuthorizationRequestSender>();
Expand Down
12 changes: 0 additions & 12 deletions src/Umbraco.AuthorizedServices/ClientApp/src/package.manifest

This file was deleted.

4 changes: 4 additions & 0 deletions src/Umbraco.AuthorizedServices/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Diagnostics;

namespace Umbraco.AuthorizedServices;

public static class Constants
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Umbraco.Cms.Core.Manifest;

namespace Umbraco.AuthorizedServices.Manifests;

public class AuthorizedServicesManifestFilter : IManifestFilter
{
public void Filter(List<PackageManifest> 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"
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@
<ClientAssetsInputs Remove="ClientApp\src\css\style.css" />
</ItemGroup>

<!-- Update package.manifest files with current build version after client assets build -->
<ItemGroup>
<PackageReference Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" PrivateAssets="all" />
</ItemGroup>
<Target Name="UpdatePackageManifestVersion" DependsOnTargets="ClientAssetsBuild" AfterTargets="GetUmbracoBuildVersion">
<ItemGroup>
<_PackageManifestFiles Include="$(IntermediateOutputPath)clientassets\**\package.manifest" />
</ItemGroup>
<JsonPathUpdateValue JsonFile="%(_PackageManifestFiles.FullPath)" Path="$.version" Value="&quot;$(PackageVersion)&quot;" />
</Target>
</Project>