Skip to content

Commit 4512fcb

Browse files
v1.0.0 (#1)
* Initial version with the support of multi-tenants Entra ID.
1 parent 31fdb3f commit 4512fcb

File tree

71 files changed

+3325
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3325
-2
lines changed

.editorconfig

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8-bom
5+
insert_final_newline = false
6+
trim_trailing_whitespace = true
7+
8+
# Markdown specific settings
9+
[*.md]
10+
indent_style = space
11+
indent_size = 2
12+
13+
# YAML specific settings
14+
[*.yaml]
15+
indent_style = space
16+
indent_size = 2
17+
18+
# x.proj specific settings
19+
[*.{csproj,props}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
[*.{cs,vb}]
24+
25+
#### Naming styles ####
26+
tab_width = 4
27+
indent_size = 4
28+
end_of_line = crlf
29+
30+
csharp_style_prefer_primary_constructors = false:suggestion
31+
csharp_using_directive_placement = inside_namespace:warning
32+
33+
# Naming rules
34+
35+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
36+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
37+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
38+
39+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
40+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
41+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
42+
43+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
44+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
45+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
46+
47+
# Symbol specifications
48+
49+
dotnet_naming_symbols.interface.applicable_kinds = interface
50+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
51+
dotnet_naming_symbols.interface.required_modifiers =
52+
53+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
54+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
55+
dotnet_naming_symbols.types.required_modifiers =
56+
57+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
58+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
59+
dotnet_naming_symbols.non_field_members.required_modifiers =
60+
61+
# Naming styles
62+
63+
dotnet_naming_style.begins_with_i.required_prefix = I
64+
dotnet_naming_style.begins_with_i.required_suffix =
65+
dotnet_naming_style.begins_with_i.word_separator =
66+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
67+
68+
dotnet_naming_style.pascal_case.required_prefix =
69+
dotnet_naming_style.pascal_case.required_suffix =
70+
dotnet_naming_style.pascal_case.word_separator =
71+
dotnet_naming_style.pascal_case.capitalization = pascal_case
72+
73+
dotnet_naming_style.pascal_case.required_prefix =
74+
dotnet_naming_style.pascal_case.required_suffix =
75+
dotnet_naming_style.pascal_case.word_separator =
76+
dotnet_naming_style.pascal_case.capitalization = pascal_case
77+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
78+
dotnet_style_coalesce_expression = true:suggestion
79+
dotnet_style_namespace_match_folder = false:suggestion
80+
dotnet_style_null_propagation = true:suggestion
81+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
82+
dotnet_style_prefer_auto_properties = true:silent
83+
dotnet_style_object_initializer = true:suggestion
84+
dotnet_style_collection_initializer = true:suggestion
85+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
86+
87+
### Visual Studio ###
88+
89+
# IDE0005: Using directive is unnecessary.
90+
dotnet_diagnostic.IDE0005.severity = warning
91+
92+
# IDE0130: Namespace does not match folder structure
93+
dotnet_diagnostic.IDE0130.severity = none
94+
95+
### StyleCop ###
96+
97+
# SA1600: Elements should be documented
98+
dotnet_diagnostic.SA1600.severity = none
99+
100+
# SA1602: Enumeration items should be documented
101+
dotnet_diagnostic.SA1602.severity = none
102+
103+
# Verify
104+
[*.{received,verified}.{txt}]
105+
charset = utf-8-bom
106+
end_of_line = lf
107+
indent_size = unset
108+
indent_style = unset
109+
insert_final_newline = false
110+
tab_width = unset
111+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.verified.txt text eol=lf working-tree-encoding=UTF-8
2+
*.verified.xml text eol=lf working-tree-encoding=UTF-8
3+
*.verified.json text eol=lf working-tree-encoding=UTF-8
4+
*.verified.bin binary
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "releases/**" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: 9.x
19+
20+
- name: Restore dependencies
21+
run: dotnet restore PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx
22+
23+
- name: Build solution
24+
run: dotnet build PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx --configuration Release --no-restore
25+
26+
- name: Run tests
27+
run: |
28+
dotnet test PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx \
29+
--configuration Release \
30+
--no-build \
31+
--logger "trx;LogFileName=test_results.trx" \
32+
--results-directory ./TestResults
33+
34+
- name: Publish Test Results
35+
uses: EnricoMi/publish-unit-test-result-action@v2
36+
if: (!cancelled())
37+
with:
38+
files: |
39+
TestResults/**/*.trx
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
VersionPrefix:
7+
type: string
8+
description: The version of the application
9+
required: true
10+
default: 1.0.0
11+
VersionSuffix:
12+
type: string
13+
description: The version suffix of the application (for example rc.1)
14+
15+
run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET 9.x
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: '9.x'
27+
28+
- name: Build AppRegistrationSecretWatcher Azure Functions
29+
run: dotnet publish
30+
--property:Configuration=Release
31+
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
32+
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
33+
--output ./publish
34+
"src/Functions/Functions.csproj"
35+
36+
- name: Package the AppRegistrationSecretWatcher Azure Functions
37+
run: cd ./publish && zip -r ../PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.Functions.net9.0.zip .
38+
39+
- name: Upload to release
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
tag_name: v${{ github.event.inputs.VersionPrefix }}${{ github.event.inputs.VersionSuffix && format('-{0}', github.event.inputs.VersionSuffix) || '' }}
43+
files: ./PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.Functions.net9.0.zip
44+
overwrite_files: true
45+
draft: ${{ !github.event.inputs.VersionSuffix }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Directory.Build.props

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<Project>
2+
3+
<!-- Common properties -->
4+
<PropertyGroup>
5+
<Authors>Gilles TOURREAU</Authors>
6+
<Company>P.O.S Informatique</Company>
7+
<Product>P.O.S Informatique</Product>
8+
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
9+
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Azure.Identity.AppRegistrationSecretWatcher</RepositoryUrl>
10+
<RepositoryType>git</RepositoryType>
11+
12+
<!-- Enable the last version of C# -->
13+
<LangVersion>latest</LangVersion>
14+
15+
<!-- Enable implict usings -->
16+
<ImplicitUsings>enable</ImplicitUsings>
17+
18+
<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
19+
<NoWarn>$(NoWarn);SA0001</NoWarn>
20+
21+
<!-- Disable packaging -->
22+
<IsPackable>false</IsPackable>
23+
24+
<!-- Enforce .editorconfig style on build -->
25+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
26+
27+
<!-- By default prefix all the assemblies name with ChantierConnect -->
28+
<AssemblyName>PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.$(MSBuildProjectName)</AssemblyName>
29+
<RootNamespace>PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
30+
</PropertyGroup>
31+
32+
<ItemGroup>
33+
<AdditionalFiles Include="..\..\stylecop.json">
34+
<Link>stylecop.json</Link>
35+
</AdditionalFiles>
36+
</ItemGroup>
37+
38+
<!-- Common NuGet packages -->
39+
<ItemGroup>
40+
<PackageReference Include="SonarAnalyzer.CSharp">
41+
<PrivateAssets>all</PrivateAssets>
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
43+
</PackageReference>
44+
<PackageReference Include="StyleCop.Analyzers">
45+
<PrivateAssets>all</PrivateAssets>
46+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
47+
</PackageReference>
48+
</ItemGroup>
49+
50+
<!-- Add the default using directive for all the code -->
51+
<ItemGroup>
52+
<Using Include="System" />
53+
<Using Include="System.Collections.ObjectModel" />
54+
<Using Include="System.Threading.Tasks" />
55+
</ItemGroup>
56+
57+
</Project>

Directory.Packages.props

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="Azure.Identity" Version="1.17.0" />
7+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
8+
<PackageVersion Include="FluentAssertions" Version="7.2.0" />
9+
<PackageVersion Include="Microsoft.ApplicationInsights.WorkerService" Version="2.23.0" />
10+
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="2.2.0" />
11+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.0.0" />
12+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.1.0" />
13+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
14+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.6" />
15+
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.10" />
16+
<PackageVersion Include="Microsoft.Graph" Version="5.96.0" />
17+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
18+
<PackageVersion Include="Moq" Version="4.20.72" />
19+
<PackageVersion Include="PosInformatique.Foundations.EmailAddresses" Version="1.0.0-alpha.6" />
20+
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="2.0.1-rc.2" />
21+
<PackageVersion Include="Scriban" Version="6.5.0" />
22+
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.15.0.120848" />
23+
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
24+
<PackageVersion Include="Verify.XunitV3" Version="31.5.1" />
25+
<PackageVersion Include="xunit.v3" Version="3.2.0" />
26+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
27+
</ItemGroup>
28+
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".editorconfig" />
4+
<File Path=".gitattributes" />
5+
<File Path=".gitignore" />
6+
<File Path="Directory.Build.props" />
7+
<File Path="Directory.Packages.props" />
8+
<File Path="global.json" />
9+
<File Path="LICENSE" />
10+
<File Path="README.md" />
11+
<File Path="stylecop.json" />
12+
</Folder>
13+
<Folder Name="/Solution Items/.github/" />
14+
<Folder Name="/Solution Items/.github/workflow/">
15+
<File Path=".github/workflows/github-actions-ci.yaml" />
16+
<File Path=".github/workflows/github-actions-release.yml" />
17+
</Folder>
18+
<Folder Name="/Solution Items/src/">
19+
<File Path="src/Directory.Build.props" />
20+
</Folder>
21+
<Folder Name="/Solution Items/tests/">
22+
<File Path="tests/.editorconfig" />
23+
<File Path="tests/Directory.Build.props" />
24+
</Folder>
25+
<Project Path="src/Core/Core.csproj" />
26+
<Project Path="src/Functions/Functions.csproj" />
27+
<Project Path="tests/Core.Tests/Core.Tests.csproj" />
28+
<Project Path="tests/Functions.Tests/Functions.Tests.csproj" />
29+
</Solution>

0 commit comments

Comments
 (0)