-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from EAVFW/ssp/entraidFunctionality
Added functionality
- Loading branch information
Showing
9 changed files
with
224 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Basic dependabot.yml file with | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: nuget | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 2 | ||
allow: | ||
- dependency-name: "EAVFramework" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
branches: | ||
- name: main | ||
- name: dev | ||
prerelease: dev | ||
|
||
plugins: | ||
- - "@semantic-release/commit-analyzer" | ||
- preset: conventionalcommits | ||
|
||
- - "@semantic-release/release-notes-generator" | ||
- preset: conventionalcommits | ||
|
||
- - "@semantic-release/github" | ||
- assets: | ||
- path: ../../artifacts/*.nupkg | ||
label: Parser DLL | ||
|
||
- - "@semantic-release/exec" | ||
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\*.nupkg --source https://nuget.pkg.github.com/eavfw/index.json --api-key ${process.env.GITHUB_TOKEN}" | ||
|
||
- - "@semantic-release/exec" | ||
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${process.env.CI_NUGET_API_KEY}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
on: | ||
pull_request: | ||
types: [ assigned, opened, synchronize, reopened ] | ||
push: | ||
branches: | ||
- 'feature/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
name: Building | ||
steps: | ||
- name: Checkout code base | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Cleaning | ||
run: dotnet clean | ||
|
||
- name: Build solution | ||
run: dotnet build -c Release | ||
|
||
#- name: Archive build to artifacts | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: build | ||
# path: | | ||
# build/* | ||
# retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Releasing | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Add plugin for conventional commits | ||
run: npm install [email protected] | ||
working-directory: ./.github/workflows | ||
|
||
- name: Add plugin for executing bash commands | ||
run: npm install @semantic-release/exec -D | ||
working-directory: ./.github/workflows | ||
|
||
- name: Dry Run Semantic to get next Version nummber | ||
working-directory: ./.github/workflows | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_AUTHOR_NAME: pksorensen | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
run: | | ||
echo "RELEASE_VERSION=$((npx semantic-release --dry-run).Where({ $_ -like '*Release note*' }) | Out-String | Select-String '[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-z]+[.][0-9]*)?' | % { $_.Matches } | % { $_.Value })" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Print release verison | ||
run: echo ${env:RELEASE_VERSION} | ||
|
||
- name: Cleaning | ||
run: dotnet clean | ||
|
||
- name: Restore NuGet packages | ||
run: dotnet restore | ||
|
||
- name: Package Parser | ||
run: dotnet pack -c Release -p:PackageVersion=${env:RELEASE_VERSION} -o ./artifacts | ||
if: ${{ env.RELEASE_VERSION }} | ||
|
||
- name: Release to GitHub and NuGet | ||
working-directory: .\\.github\\workflows | ||
env: | ||
CI_NUGET_API_KEY: ${{ secrets.CI_NUGET_API_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_AUTHOR_NAME: pksorensen | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<Import Condition="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) != ''" Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
<PropertyGroup> | ||
<LangVersion>10.0</LangVersion> | ||
<EAVFrameworkVersion Condition="'$(EAVFrameworkVersion)' == ''">4.2.8</EAVFrameworkVersion> | ||
<UseEAVFromNuget Condition="'$(UseEAVFromNuget)' == ''">true</UseEAVFromNuget> | ||
<LocalEAVFrameworkPath Condition="'$(LocalEAVFrameworkPath)' == ''">$(MSBuildThisFileDirectory)/external/EAVFramework</LocalEAVFrameworkPath> | ||
<LocalExternalpath Condition="'$(LocalExternalpath)' == ''">$(MSBuildThisFileDirectory)/external</LocalExternalpath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
src/EAVFW.Extensions.EasyAuth.MicrosoftEntraId/MicrosoftEntraIdEasyAuthExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
src/EAVFW.Extensions.EasyAuth.MicrosoftEntraId/MicrosoftEntraIdEasyAuthOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
namespace EAVFW.Extensions.EasyAuth.MicrosoftEntraId | ||
using IdentityModel.Client; | ||
using Microsoft.AspNetCore.Http; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Security.Claims; | ||
using System.Threading.Tasks; | ||
|
||
namespace EAVFW.Extensions.EasyAuth.MicrosoftEntraId | ||
{ | ||
public class MicrosoftEntraIdEasyAuthOptions | ||
{ | ||
public string AuthorizationUrl { get; set; } | ||
public string ClientId { get; set; } | ||
public string RedirectUri { get; set; } | ||
public string ClientSecret { get; set; } | ||
public string TenantId { get; set; } | ||
public string GroupId { get; set; } | ||
public string Scope { get; set; } | ||
public string TokenEndpoint { get; set; } | ||
public string RedirectUrl { get; set; } | ||
|
||
public Func<HttpContext, string, TokenResponse, Task<ClaimsPrincipal>> ValidateUserAsync { get; set; } | ||
} | ||
} |