Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
35eb859
Add graph implementation
GillesTourreau Nov 9, 2025
a3b5408
Add graph implementation to send the emails.
GillesTourreau Nov 9, 2025
958d6fe
Add the check code.
GillesTourreau Nov 10, 2025
e4c1ab0
Fix new line at the end of file.
GillesTourreau Nov 10, 2025
2b5e59b
Retrieves the display name of the tenant.
GillesTourreau Nov 10, 2025
57b045c
Add id for the app reg.
GillesTourreau Nov 10, 2025
2c7727f
Changes Expired to status
GillesTourreau Nov 10, 2025
de0521c
Add a DaysBeforeExpiration property.
GillesTourreau Nov 10, 2025
b1a466c
Create the HTML report.
GillesTourreau Nov 10, 2025
8461b60
Fix graph email provider.
GillesTourreau Nov 10, 2025
4607c2e
Remove usage of display name for sender / recipients.
GillesTourreau Nov 10, 2025
df1c1a5
Implementation of the Azure Function.
GillesTourreau Nov 10, 2025
0f88581
Display explicitly no secret / no application.
GillesTourreau Nov 10, 2025
b44e3b4
Change to .slnx
GillesTourreau Nov 10, 2025
76dd7c7
Add github actions.
GillesTourreau Nov 10, 2025
73c01aa
Fix unit tests previously failed.
GillesTourreau Nov 10, 2025
10bd72f
Fix the release github action.
GillesTourreau Nov 10, 2025
ee24acd
Fix release github actions.
GillesTourreau Nov 11, 2025
e2f14fd
Use the v2 of softprops/action-gh-release
GillesTourreau Nov 11, 2025
20f0f47
Fiox git hub actions.
GillesTourreau Nov 11, 2025
a3c7732
Fix style cop
GillesTourreau Nov 12, 2025
5ef505e
Suffix the zip package with the net9.0.zip.
GillesTourreau Nov 12, 2025
02566af
Improve the HTML template.
GillesTourreau Nov 13, 2025
fd0242b
Add the README
GillesTourreau Nov 13, 2025
7b4a355
Fix unit test
GillesTourreau Nov 13, 2025
db88544
Add unit tests to fix Verify() setup.
GillesTourreau Nov 13, 2025
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
111 changes: 111 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
root = true

[*]
charset = utf-8-bom
insert_final_newline = false
trim_trailing_whitespace = true

# Markdown specific settings
[*.md]
indent_style = space
indent_size = 2

# YAML specific settings
[*.yaml]
indent_style = space
indent_size = 2

# x.proj specific settings
[*.{csproj,props}]
indent_style = space
indent_size = 2

[*.{cs,vb}]

#### Naming styles ####
tab_width = 4
indent_size = 4
end_of_line = crlf

csharp_style_prefer_primary_constructors = false:suggestion
csharp_using_directive_placement = inside_namespace:warning

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_namespace_match_folder = false:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion

### Visual Studio ###

# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = warning

# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = none

### StyleCop ###

# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none

# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = none

# Verify
[*.{received,verified}.{txt}]
charset = utf-8-bom
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
*.verified.bin binary
39 changes: 39 additions & 0 deletions .github/workflows/github-actions-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Continuous Integration

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "releases/**" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- name: Restore dependencies
run: dotnet restore PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx

- name: Build solution
run: dotnet build PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx --configuration Release --no-restore

- name: Run tests
run: |
dotnet test PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx \
--configuration Release \
--no-build \
--logger "trx;LogFileName=test_results.trx" \
--results-directory ./TestResults

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (!cancelled())
with:
files: |
TestResults/**/*.trx
47 changes: 47 additions & 0 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
workflow_dispatch:
inputs:
VersionPrefix:
type: string
description: The version of the application
required: true
default: 1.0.0
VersionSuffix:
type: string
description: The version suffix of the application (for example rc.1)

run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET 9.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: Build AppRegistrationSecretWatcher Azure Functions
run: dotnet publish
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
--output ./publish
"src/Functions/Functions.csproj"

- name: Package the AppRegistrationSecretWatcher Azure Functions
run: cd ./publish && zip -r ../PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.Functions.net9.0.zip .

- name: Upload to release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ github.event.inputs.VersionPrefix }}${{ github.event.inputs.VersionSuffix && format('-{0}', github.event.inputs.VersionSuffix) || '' }}
files: ./PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.Functions.net9.0.zip
overwrite_files: true
draft: ${{ !github.event.inputs.VersionSuffix }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Project>

<!-- Common properties -->
<PropertyGroup>
<Authors>Gilles TOURREAU</Authors>
<Company>P.O.S Informatique</Company>
<Product>P.O.S Informatique</Product>
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Azure.Identity.AppRegistrationSecretWatcher</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Enable the last version of C# -->
<LangVersion>latest</LangVersion>

<!-- Enable implict usings -->
<ImplicitUsings>enable</ImplicitUsings>

<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
<NoWarn>$(NoWarn);SA0001</NoWarn>

<!-- Disable packaging -->
<IsPackable>false</IsPackable>

<!-- Enforce .editorconfig style on build -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

<!-- By default prefix all the assemblies name with ChantierConnect -->
<AssemblyName>PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
</ItemGroup>

<!-- Common NuGet packages -->
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Add the default using directive for all the code -->
<ItemGroup>
<Using Include="System" />
<Using Include="System.Collections.ObjectModel" />
<Using Include="System.Threading.Tasks" />
</ItemGroup>

</Project>
28 changes: 28 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.17.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="FluentAssertions" Version="7.2.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.WorkerService" Version="2.23.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="2.2.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.1.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.6" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.10" />
<PackageVersion Include="Microsoft.Graph" Version="5.96.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="PosInformatique.Foundations.EmailAddresses" Version="1.0.0-alpha.6" />
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="2.0.1-rc.2" />
<PackageVersion Include="Scriban" Version="6.5.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.15.0.120848" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="Verify.XunitV3" Version="31.5.1" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
</Project>
29 changes: 29 additions & 0 deletions PosInformatique.Azure.Identity.AppRegistrationSecretWatcher.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="README.md" />
<File Path="stylecop.json" />
</Folder>
<Folder Name="/Solution Items/.github/" />
<Folder Name="/Solution Items/.github/workflow/">
<File Path=".github/workflows/github-actions-ci.yaml" />
<File Path=".github/workflows/github-actions-release.yml" />
</Folder>
<Folder Name="/Solution Items/src/">
<File Path="src/Directory.Build.props" />
</Folder>
<Folder Name="/Solution Items/tests/">
<File Path="tests/.editorconfig" />
<File Path="tests/Directory.Build.props" />
</Folder>
<Project Path="src/Core/Core.csproj" />
<Project Path="src/Functions/Functions.csproj" />
<Project Path="tests/Core.Tests/Core.Tests.csproj" />
<Project Path="tests/Functions.Tests/Functions.Tests.csproj" />
</Solution>
Loading
Loading