Skip to content

Commit

Permalink
Merge pull request #48 from umbraco/feature/v14
Browse files Browse the repository at this point in the history
Migrate Umbraco AuthorizedServices for Umbraco 14
  • Loading branch information
acoumb authored Jul 25, 2024
2 parents 9119ee0 + 5f63419 commit e0c0b4a
Show file tree
Hide file tree
Showing 110 changed files with 17,475 additions and 21,240 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,6 @@ $RECYCLE.BIN/
## Umbraco AuthorizedServices specific
##
/src/Umbraco.AuthorizedServices/ClientApp/gulp/config.outputPath.js

/examples/Umbraco.AuthorizedServices.TestSite.V14/umbraco/Data/TEMP/
# Git
.orig
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Details of services available need to be applied to the Umbraco web application'
"RequestTokenPath": "",
"RequestTokenMethod": "GET|POST",
"RequestAuthorizationPath": "",
"JsonSerializer": "Default|JsonNet|SystemTextJson",
"RequestTokenFormat": "Querystring|FormUrlEncoded",
"AuthorizationRequestRequiresAuthorizationHeaderWithBasicToken": true|false,
"ApiKey": "",
Expand Down Expand Up @@ -212,14 +211,6 @@ An enum value that controls how the request to retrieve an access token is forma

Required in `OAuth1` flows for building the service authorization URL.

###### JsonSerializer

An enum value that defines the JSON serializer to use when creating requests and deserializing responses. Options are `Default` and `JsonNet` and `SystemTextJson`.

- `Default` - uses the Umbraco CMS default `IJsonSerializer`.
- `JsonNet` - uses the JSON.Net serializer.
- `SystemTextJson` - uses the System.Text.Json serializer.

###### AuthorizationRequestRequiresAuthorizationHeaderWithBasicToken

This flag indicates whether the basic token should be included in the request for access token. If true, a base64 encoding of <clientId>:<clientSecret> will be added to
Expand Down Expand Up @@ -289,7 +280,7 @@ Clicking on an item will show some details about the configured service, and it'

If the service is not yet authorized, click the _Authorize Service_ button to trigger the authentication and authorization flow. You will be directed to the service to login, and optionally choose an account. You will then be asked to agree to the permissions requested by the app. Finally you will be redirect back to the Umbraco backoffice and should see confirmation that an access token has been retrieved and stored such that the service is now authorized. If provided, you can click the _Verify Sample Request_ button to ensure that service's API can be called.

### Calling an Service
### Calling a Service

To make a call to an authorized service, you first need to obtain an instance of `IAuthorizedServiceCaller`. This is registered with the dependency injection framework and as such can be injected into a controller, view or service class where it needs to be used.

Expand Down Expand Up @@ -344,6 +335,23 @@ The list of providers for which the package has been verified is maintained at t

## Package Development

To run the solution in a local development environment:

```
cd \examples\Umbraco.AuthorizedServices.TestSite\
dotnet run

cd \src\Umbraco.AuthorizedServices\Client>
npm i
npm run build
```

To generate types from the management API:

```
npm run generate:api
```

### Branching Strategy

The branching strategy in this repository follows a "gitflow" model:
Expand Down
46 changes: 0 additions & 46 deletions Umbraco.AuthorizedServices.Build.sln

This file was deleted.

14 changes: 7 additions & 7 deletions Umbraco.AuthorizedServices.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{49BBAC1E-F1C7-48E2-BCF7-240B9144983F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.AuthorizedServices.TestSite", "examples\Umbraco.AuthorizedServices.TestSite\Umbraco.AuthorizedServices.TestSite.csproj", "{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.AuthorizedServices.Tests", "tests\Umbraco.AuthorizedServices.Tests\Umbraco.AuthorizedServices.Tests.csproj", "{3AB01311-A4B3-4F64-B9D5-8C96B0F6321A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.AuthorizedServices.TestSite", "examples\Umbraco.AuthorizedServices.TestSite\Umbraco.AuthorizedServices.TestSite.csproj", "{2039395D-F4DD-4BB3-B8D9-52EBE0572A18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -37,20 +37,20 @@ Global
{7F8774A8-B9D5-4F8B-B16C-26E829E948AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F8774A8-B9D5-4F8B-B16C-26E829E948AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F8774A8-B9D5-4F8B-B16C-26E829E948AD}.Release|Any CPU.Build.0 = Release|Any CPU
{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B}.Release|Any CPU.Build.0 = Release|Any CPU
{3AB01311-A4B3-4F64-B9D5-8C96B0F6321A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3AB01311-A4B3-4F64-B9D5-8C96B0F6321A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3AB01311-A4B3-4F64-B9D5-8C96B0F6321A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3AB01311-A4B3-4F64-B9D5-8C96B0F6321A}.Release|Any CPU.Build.0 = Release|Any CPU
{2039395D-F4DD-4BB3-B8D9-52EBE0572A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2039395D-F4DD-4BB3-B8D9-52EBE0572A18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2039395D-F4DD-4BB3-B8D9-52EBE0572A18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2039395D-F4DD-4BB3-B8D9-52EBE0572A18}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D63A0D65-08F3-497C-9311-0FBFC3AF2F4B} = {49BBAC1E-F1C7-48E2-BCF7-240B9144983F}
{2039395D-F4DD-4BB3-B8D9-52EBE0572A18} = {49BBAC1E-F1C7-48E2-BCF7-240B9144983F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B8057185-AA26-4285-9232-D6DDB1E11E42}
Expand Down
6 changes: 3 additions & 3 deletions azure-pipeline - Umbraco.AuthorizedServices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ parameters:
default: false

variables:
nodeVersion: 18.x
solution: Umbraco.AuthorizedServices.Build.sln
nodeVersion: 20
solution: Umbraco.AuthorizedServices.sln
buildConfiguration: Release
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
Expand Down Expand Up @@ -77,7 +77,7 @@ stages:
displayName: Run dotnet build

# Pack
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)/nupkg
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-restore --output $(Build.ArtifactStagingDirectory)/nupkg
displayName: Run dotnet pack

# Publish
Expand Down
Loading

0 comments on commit e0c0b4a

Please sign in to comment.