Compare commits

..

9 Commits

@ -1,79 +0,0 @@
kind: pipeline
type: docker
name: default
trigger:
event:
- push
steps:
- name: build
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- cd VeraxShield
- dotnet restore VeraxShield.sln
- dotnet build VeraxShield.sln -c Release --no-restore
- dotnet publish VeraxShield.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- name: tests
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- cd VeraxShield
- dotnet restore VeraxShield.sln
- dotnet test VeraxShield.sln --no-restore
depends_on: [build]
- name: code-inspection
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
secrets: [ SECRET_SONAR_LOGIN ]
environment:
sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token:
from_secret: SECRET_SONAR_LOGIN # Secret de Drone
project_key: VeraxShield
commands:
- cd VeraxShield/
- dotnet restore VeraxShield.sln
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="VeraxShield/wwwroot/**","VeraxShield/composants/**","VeraxShield/pages/**","VeraxShield/Properties/**","TestVeraxShield/**","VeraxShield/Program.cs","VeraxShield/services/UtilisateursDataService/UtilisateursDataServiceApi.cs","VeraxShield/services/UtilisateursDataService/UtilisateursDataServiceFactice.cs" /d:sonar.login=$${sonar_token}
- dotnet build VeraxShield.sln -c Release --no-restore
- dotnet test VeraxShield.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet publish VeraxShield.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
when:
branch:
- master
event:
- push
- pull_request
depends_on: [build,tests]
- name: docker-build-and-push
image: plugins/docker
settings:
dockerfile: dockerfile
context: .
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/louis.laborie/sae_2a_blazor
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
when:
branch:
- master
- rebase
- name: deploy-container
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/louis.laborie/sae_2a_blazor:latest
CONTAINERNAME: verax-blazor
COMMAND: create
OVERWRITE: true
CODEFIRST_CLIENTDRONE_ENV_ASPNETCORE_HTTP_PORTS: 80
ADMINS: louislaborie,tonyfages,noasillard,jeanmarcillac,shanacascarra
depends_on:
- docker-build-and-push

459
.gitignore vendored

@ -1,429 +1,30 @@
# Created by https://www.toptal.com/developers/gitignore/api/dotnetcore,visualstudio,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore,visualstudio,visualstudiocode
### DotnetCore ###
# .NET Core build folders
bin/
obj/
# Common node modules locations
/node_modules
/wwwroot/node_modules
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
*.code-workspace
# Local History for Visual Studio Code
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
### VisualStudio Patch ###
# Additional files built by Visual Studio
# End of https://www.toptal.com/developers/gitignore/api/dotnetcore,visualstudio,visualstudiocode
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.fake

@ -1,47 +1,2 @@
<h1 align="center">VeraxShield</h1>
# Blazor_SAE
<p align="center">
<img src="https://img.shields.io/badge/C%23-239120.svg?style=for-the-badge&logo=c-sharp&logoColor=white" alt="C#"/>
<img src="https://img.shields.io/badge/Blazor-512BD4.svg?style=for-the-badge&logo=blazor&logoColor=white" alt="Blazor"/>
<img src="https://img.shields.io/badge/.NET-512BD4.svg?style=for-the-badge&logo=.net&logoColor=white" alt=".NET"/>
<img src="https://img.shields.io/badge/HTML5-E34F26.svg?style=for-the-badge&logo=html5&logoColor=white" alt="HTML5"/>
<img src="https://img.shields.io/badge/CSS3-1572B6.svg?style=for-the-badge&logo=css3&logoColor=white" alt="CSS3"/>
</p>
## Description
VeraxShield est une application web avancée développée avec Blazor, représentant la partie administration de notre projet plus large, [Verax](https://codefirst.iut.uca.fr/git/Verax/Verax). Conçue pour offrir une interface de gestion intuitive, VeraxShield permet aux administrateurs de gérer efficacement les différents aspects du système Verax.
### Fonctionnalités Clés
- **Gestion des Utilisateurs** : Permet aux administrateurs de créer, modifier et supprimer des comptes utilisateurs. Inclut la gestion des rôles et des permissions pour un contrôle d'accès granulaire.
- **Notifications et Suivis des Actions** : Envoie des notifications sur les différentes actions des modérateurs afin pour assurer une meilleure gestion du système.
### Objectif du Projet
L'objectif principal de VeraxShield est de fournir une plateforme centralisée pour la gestion et le contrôle administratif du système Verax, en rationalisant les processus administratifs et en offrant une vue d'ensemble claire des opérations.
## Installation et Configuration
1. Clonez le dépôt : `git clone (https://codefirst.iut.uca.fr/git/Verax/Blazor_SAE.git)`
2. Ouvrez le fichier `VeraxShield.sln` avec Visual Studio.
3. Restaurez les packages nécessaires.
4. Lancez le projet depuis Visual Studio.
<h2 align="center">Equipe de Développement</h2>
<p align="center" >
<a href="https://codefirst.iut.uca.fr/git/louis.laborie" style="margin-right: 20px;">
<img src="img/Louis.png" width="50" height="50" title="Louis Laborie" alt="Louis Laborie"/>
</a>
<a href="https://codefirst.iut.uca.fr/git/shana.cascarra" style="margin-right: 20px;">
<img src="img/Shana.png" width="50" height="50" title="Shana Cascarra" alt="Shana Cascarra"/>
</a>
<a href="https://codefirst.iut.uca.fr/git/jean.marcillac" style="margin-right: 20px;">
<img src="img/Jean.png" width="50" height="50" title="Jean Marcillac" alt="Jean Marcillac"/>
</a>
<a href="https://codefirst.iut.uca.fr/git/tony.fages" style="margin-right: 20px;">
<img src="img/Tony.png" width="50" height="50" title="Tony Fages" alt="Tony Fages"/>
</a>
<a href="https://codefirst.iut.uca.fr/git/noa.sillard" style="margin-right: 20px;">
<img src="img/Noa.png" width="50" height="50" title="Noa Sillard" alt="Noa Sillard"/>
</a>
<p>

@ -1,15 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/.idea.VeraxShield.iml
/contentModel.xml
/modules.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# GitHub Copilot persisted chat sessions
/copilot/chatSessions

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders>
<Path>../../Blazor_SAE</Path>
</attachedFolders>
<explicitIncludes />
<explicitExcludes />
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -1,105 +0,0 @@
using System.Security.Claims;
using Moq;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace TestVeraxShield;
public class AuthentificationServiceTests
{
private readonly AuthentificationService _authService;
private readonly Mock<IUtilisateursDataService> _mockDataService = new Mock<IUtilisateursDataService>();
public AuthentificationServiceTests()
{
_authService = new AuthentificationService(_mockDataService.Object);
}
[Fact]
public async Task Connexion_WithValidCredentials_ShouldSucceed()
{
// Arrange
var testUser = new Utilisateur("testUser", "Test", "User", "test@user.com", BCrypt.Net.BCrypt.HashPassword("password"), "User", false);
_mockDataService.Setup(s => s.getAllUtilisateurs())
.ReturnsAsync(new List<Utilisateur> { testUser });
var requete = new RequeteConnexion
{
Pseudo = "testUser",
MotDePasse = "password"
};
// Act & Assert
await _authService.Connexion(requete);
}
[Fact]
public async Task Connexion_WithInvalidCredentials_ShouldThrowException()
{
// Arrange
_mockDataService.Setup(s => s.getAllUtilisateurs())
.ReturnsAsync(new List<Utilisateur>());
var requete = new RequeteConnexion
{
Pseudo = "nonExistentUser",
MotDePasse = "wrongPassword"
};
// Act & Assert
await Assert.ThrowsAsync<Exception>(() => _authService.Connexion(requete));
}
[Fact]
public async Task Inscription_ShouldCreateNewUser()
{
// Arrange
var requete = new RequeteInscription
{
Pseudo = "newUser",
Nom = "New",
Prenom = "User",
Mail = "new@user.com",
MotDePasse = "newPassword"
};
// Setup the mock to verify that AjouterUtilisateur is called with a Utilisateur that matches the inscription details
_mockDataService.Setup(s => s.AjouterUtilisateur(It.IsAny<Utilisateur>()))
.Returns(Task.CompletedTask)
.Callback<Utilisateur>(u =>
{
Assert.Equal(requete.Pseudo, u.Pseudo);
Assert.True(BCrypt.Net.BCrypt.Verify(requete.MotDePasse, u.Mdp));
});
// Act
await _authService.Inscription(requete);
}
[Fact]
public async Task GetUtilisateur_ReturnsCorrectUser_WithClaims()
{
// Arrange
var expectedPseudo = "testUser";
var expectedRole = "User";
var testUser = new Utilisateur("testUser", "Test", "User", "test@user.com", BCrypt.Net.BCrypt.HashPassword("password"), "User", false);
var mockDataService = new Mock<IUtilisateursDataService>();
mockDataService.Setup(s => s.getAllUtilisateurs())
.ReturnsAsync(new List<Utilisateur> { testUser });
var authService = new AuthentificationService(mockDataService.Object);
// Act
var utilisateurCourant = await authService.GetUtilisateur(expectedPseudo);
utilisateurCourant.Claims.Add(ClaimTypes.Email, "test@user.com");
// Assert
Assert.NotNull(utilisateurCourant);
Assert.True(utilisateurCourant.EstAuthentifie);
Assert.Equal(expectedPseudo, utilisateurCourant.Pseudo);
}
}

@ -1,85 +0,0 @@
using Moq;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
using Xunit;
namespace VeraxShield.UnitTests
{
public class DonneurEtatTests
{
private readonly DonneurEtat _donneurEtat;
private readonly Mock<IAuthentificationService> _mockAuthService;
private readonly Mock<IUtilisateursDataService> _mockUserDataService;
public DonneurEtatTests()
{
_mockAuthService = new Mock<IAuthentificationService>();
_mockUserDataService = new Mock<IUtilisateursDataService>();
_donneurEtat = new DonneurEtat(_mockAuthService.Object, _mockUserDataService.Object);
}
[Fact]
public async Task Connexion_ValidCredentials_SetsCurrentUser()
{
// Arrange
var requeteConnexion = new RequeteConnexion { Pseudo = "testUser", MotDePasse = "testPass" };
var utilisateurCourant = new UtilisateurCourant
{
Pseudo = "testUser",
EstAuthentifie = true,
Claims = new Dictionary<string, string> { { ClaimTypes.Role, "User" } }
};
_mockAuthService.Setup(x => x.GetUtilisateur(requeteConnexion.Pseudo)).ReturnsAsync(utilisateurCourant);
_mockAuthService.Setup(x => x.Connexion(requeteConnexion)).Returns(Task.CompletedTask);
// Act
await _donneurEtat.Connexion(requeteConnexion);
// Assert
Assert.NotNull(_donneurEtat._utilisateurCourant);
Assert.True(_donneurEtat._utilisateurCourant.EstAuthentifie);
_mockAuthService.Verify(x => x.Connexion(requeteConnexion), Times.Once);
_mockAuthService.Verify(x => x.GetUtilisateur(requeteConnexion.Pseudo), Times.Once);
}
[Fact]
public async Task Deconnexion_ClearsCurrentUser()
{
// Arrange - assume user is logged in
_donneurEtat._utilisateurCourant = new UtilisateurCourant { EstAuthentifie = true };
// Act
await _donneurEtat.Deconnexion();
// Assert
Assert.Null(_donneurEtat._utilisateurCourant);
}
[Fact]
public async Task Inscription_ValidData_RegistersUser()
{
// Arrange
var requeteInscription = new RequeteInscription
{
Pseudo = "newUser",
MotDePasse = "newPass",
Mail = "newUser@test.com",
Nom = "New",
Prenom = "User"
};
_mockAuthService.Setup(x => x.Inscription(requeteInscription)).Returns(Task.CompletedTask);
// Act
await _donneurEtat.Inscription(requeteInscription);
// Assert - Since Inscription does not automatically log in the user, we check if the method was called.
_mockAuthService.Verify(x => x.Inscription(requeteInscription), Times.Once);
}
}
}

@ -1,45 +0,0 @@
using Moq;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace TestVeraxShield;
public class IAuthentificationServiceTests
{
private readonly Mock<IUtilisateursDataService> _mockDataService;
private readonly AuthentificationService _authService;
public IAuthentificationServiceTests()
{
_mockDataService = new Mock<IUtilisateursDataService>();
_authService = new AuthentificationService(_mockDataService.Object);
}
[Fact]
public async Task GetUtilisateur_ValidUser_ReturnsUser()
{
// Arrange
var expectedUser = new UtilisateurCourant { Pseudo = "user1", EstAuthentifie = true };
_mockDataService.Setup(x => x.getAllUtilisateurs()).ReturnsAsync(new List<Utilisateur>
{
new Utilisateur("user1", "Name", "Surname", "user1@example.com", "password", "User", false)
});
// Act
var result = await _authService.GetUtilisateur("user1");
// Assert
Assert.Equal(expectedUser.Pseudo, result.Pseudo);
Assert.True(result.EstAuthentifie);
}
[Fact]
public async Task GetUtilisateur_NonExistentUser_ThrowsException()
{
// Arrange
_mockDataService.Setup(x => x.getAllUtilisateurs()).ReturnsAsync(new List<Utilisateur>());
// Act & Assert
await Assert.ThrowsAsync<Exception>(() => _authService.GetUtilisateur("user2"));
}
}

@ -1,25 +0,0 @@
using Moq;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace TestVeraxShield;
public class IUtilisateursDataServiceTests
{
private readonly Mock<IUtilisateursDataService> _service = new Mock<IUtilisateursDataService>();
[Fact]
public async Task AjouterUtilisateur_AddsUserSuccessfully()
{
// Arrange
var user = new Utilisateur("testUser", "User", "Test", "dez", "password", "User", false);
_service.Setup(s => s.AjouterUtilisateur(It.IsAny<Utilisateur>()))
.Returns(Task.CompletedTask)
.Callback<Utilisateur>(u => Assert.Equal("testUser", u.Pseudo));
// Act
await _service.Object.AjouterUtilisateur(user);
// Assert is handled by the Callback
}
}

@ -1,47 +0,0 @@
namespace TestVeraxShield;
public class ModeleAppUtilisateurTests
{
[Fact]
public void Constructeur_DoitInitialiserProprietes()
{
// Arrange & Act
var utilisateur = new ModeleAppUtilisateur("pseudoTest", "NomTest", "PrenomTest", "email@test.com", "motdepasse", "RoleTest");
// Assert
Assert.Equal("pseudoTest", utilisateur.Pseudo);
Assert.Equal("NomTest", utilisateur.Nom);
Assert.Equal("PrenomTest", utilisateur.Prenom);
Assert.Equal("email@test.com", utilisateur.Mail);
Assert.Equal("motdepasse", utilisateur.MotDePasse);
Assert.Contains("RoleTest", utilisateur.Roles);
}
[Fact]
public void AjouterRole_DoItAjouterNouveauRole()
{
// Arrange
var utilisateur = new ModeleAppUtilisateur("pseudoTest", "NomTest", "PrenomTest", "email@test.com", "motdepasse", "RoleTest");
// Act
utilisateur.ajouterRole("NouveauRole");
// Assert
Assert.Contains("NouveauRole", utilisateur.Roles);
}
[Fact]
public void SupprimerRole_DoItSupprimerRoleExistant()
{
// Arrange
var utilisateur = new ModeleAppUtilisateur("pseudoTest", "NomTest", "PrenomTest", "email@test.com", "motdepasse", "RoleTest");
utilisateur.ajouterRole("NouveauRole");
// Act
utilisateur.supprimerRole("RoleTest");
// Assert
Assert.DoesNotContain("RoleTest", utilisateur.Roles);
}
}

@ -1,57 +0,0 @@
namespace TestVeraxShield;
public class ModeleCurrentUserTests
{
[Fact]
public void InitializesCorrectly()
{
var utilisateur = new UtilisateurCourant();
Assert.Null(utilisateur.Claims);
Assert.False(utilisateur.EstAuthentifie);
Assert.Null(utilisateur.Pseudo);
}
[Fact]
public void AddsAndUpdatesClaimsCorrectly()
{
var utilisateur = new UtilisateurCourant { Claims = new Dictionary<string, string>() };
utilisateur.Claims.Add("role", "user");
Assert.Equal("user", utilisateur.Claims["role"]);
utilisateur.Claims["role"] = "admin";
Assert.Equal("admin", utilisateur.Claims["role"]);
}
[Fact]
public void RemovesClaimsCorrectly()
{
var utilisateur = new UtilisateurCourant { Claims = new Dictionary<string, string>() };
utilisateur.Claims.Add("role", "user");
utilisateur.Claims.Remove("role");
Assert.False(utilisateur.Claims.ContainsKey("role"));
}
[Fact]
public void TogglesAuthenticationState()
{
var utilisateur = new UtilisateurCourant();
utilisateur.EstAuthentifie = true;
Assert.True(utilisateur.EstAuthentifie);
utilisateur.EstAuthentifie = false;
Assert.False(utilisateur.EstAuthentifie);
}
[Fact]
public void UpdatesPseudoCorrectly()
{
var utilisateur = new UtilisateurCourant();
utilisateur.Pseudo = "TestUser";
Assert.Equal("TestUser", utilisateur.Pseudo);
}
}

@ -1,66 +0,0 @@
using VeraxShield.modele.utilisateurs;
namespace TestVeraxShield;
public class ModeleUtilisateurTests
{
[Fact]
public void ConstructorAssignsPropertiesCorrectly()
{
// Arrange
string expectedPseudo = "TestPseudo";
string expectedNom = "TestNom";
string expectedPrenom = "TestPrenom";
string expectedRole = "TestRole";
string expectedMdp = "TestMdp";
string expectedMail = "test@mail.com";
bool expectedIsBan = true;
// Act
Utilisateur utilisateur = new Utilisateur(expectedPseudo, expectedNom, expectedPrenom, expectedRole, expectedMdp, expectedMail, expectedIsBan);
// Assert
Assert.Equal(expectedPseudo, utilisateur.Pseudo);
Assert.Equal(expectedNom, utilisateur.Nom);
Assert.Equal(expectedPrenom, utilisateur.Prenom);
Assert.Equal(expectedRole, utilisateur.Role);
Assert.Equal(expectedMdp, utilisateur.Mdp);
Assert.Equal(expectedMail, utilisateur.Mail);
Assert.Equal(expectedIsBan, utilisateur.IsBan);
}
[Theory]
[InlineData("NewPseudo", "NewNom", "NewPrenom", "NewRole", "NewMdp", "new@mail.com", false)]
[InlineData("AnotherPseudo", "AnotherNom", "AnotherPrenom", "AnotherRole", "AnotherMdp", "another@mail.com", true)]
public void PropertiesUpdateCorrectly(string pseudo, string nom, string prenom, string role, string mdp, string mail, bool isBan)
{
// Arrange
Utilisateur utilisateur = new Utilisateur(pseudo, nom, prenom, role, mdp, mail, isBan);
// Act - changing values to test setter
string updatedPseudo = pseudo + "Update";
string updatedNom = nom + "Update";
string updatedPrenom = prenom + "Update";
string updatedRole = role + "Update";
string updatedMdp = mdp + "Update";
string updatedMail = "updated@" + mail;
bool updatedIsBan = !isBan;
utilisateur.Pseudo = updatedPseudo;
utilisateur.Nom = updatedNom;
utilisateur.Prenom = updatedPrenom;
utilisateur.Role = updatedRole;
utilisateur.Mdp = updatedMdp;
utilisateur.Mail = updatedMail;
utilisateur.IsBan = updatedIsBan;
// Assert
Assert.Equal(updatedPseudo, utilisateur.Pseudo);
Assert.Equal(updatedNom, utilisateur.Nom);
Assert.Equal(updatedPrenom, utilisateur.Prenom);
Assert.Equal(updatedRole, utilisateur.Role);
Assert.Equal(updatedMdp, utilisateur.Mdp);
Assert.Equal(updatedMail, utilisateur.Mail);
Assert.Equal(updatedIsBan, utilisateur.IsBan);
}
}

@ -1,47 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="bunit.web" Version="1.27.17" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VeraxShield\VeraxShield.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="factoriesTests\**" />
<Compile Remove="ModeleTests\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="factoriesTests\**" />
<EmbeddedResource Remove="ModeleTests\**" />
</ItemGroup>
<ItemGroup>
<None Remove="factoriesTests\**" />
<None Remove="ModeleTests\**" />
</ItemGroup>
</Project>

@ -1,56 +0,0 @@
using Microsoft.AspNetCore.Components;
using Moq;
using Newtonsoft.Json;
using RichardSzalay.MockHttp;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace TestVeraxShield;
public class UtilisateursDataServiceApiTests
{
private readonly MockHttpMessageHandler _mockHttp;
private readonly HttpClient _clientHttp;
private readonly Mock<NavigationManager> _mockNavigationManager;
private readonly UtilisateursDataServiceApi _service;
public UtilisateursDataServiceApiTests()
{
_mockHttp = new MockHttpMessageHandler();
// Mock the response for the API call
_mockHttp.When("https://Verax.com/api/utilisateurs/recuperer")
.Respond("application/json", JsonConvert.SerializeObject(new List<Utilisateur>
{
new Utilisateur("testUser", "User", "Test", "dez", "password", "User", false)
}));
_clientHttp = _mockHttp.ToHttpClient();
_clientHttp.BaseAddress = new System.Uri("https://Verax.com");
_mockNavigationManager = new Mock<NavigationManager>();
_service = new UtilisateursDataServiceApi(_clientHttp, _mockNavigationManager.Object);
}
[Fact]
public async Task GetAllUtilisateurs_ReturnsUsers()
{
// Act
var users = await _service.getAllUtilisateurs();
// Assert
Assert.Single(users);
Assert.Equal("testUser", users[0].Pseudo);
}
[Fact]
public async Task GetUtilisateurFromPseudo_ReturnsUser()
{
// Act
var user = await _service.getUtilisateurFromPseudo("testUser");
// Assert
Assert.Equal("testUser", user.Pseudo);
}
}

@ -1,56 +0,0 @@
namespace TestVeraxShield.factoriesTests;
using Xunit;
using VeraxShield.factories;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.modele.utilisateurs;
public class UtilisateursFactoryTests
{
[Fact]
public void ConvertsToUtilisateur_WithNewPasswordHashing()
{
// Arrange
var modele = new FormulaireAjoutModele { Mdp = "newPassword", /* other properties */ };
// Act
var utilisateur = UtilisateursFactory.toUtilisateur(modele);
// Assert
Assert.NotEqual("newPassword", utilisateur.Mdp);
}
[Fact]
public void ConvertsToModele_FromUtilisateur()
{
// Arrange
var utilisateur = new Utilisateur("pseudo", "nom", "prenom", "role", "mdp", "mail", false);
// Act
var modele = UtilisateursFactory.toModele(utilisateur);
// Assert
}
[Fact]
public void ConvertsToModele_FromUtilisateurs()
{
// Arrange
var utilisateur = new Utilisateur("pseudo", "nom", "prenom", "role", "mdp", "mail", false);
// Act
var modele = UtilisateursFactory.toModele(utilisateur);
// Assert
Assert.Equal(utilisateur.Pseudo, modele.Pseudo);
Assert.Equal(utilisateur.Nom, modele.Nom);
Assert.Equal(utilisateur.Prenom, modele.Prenom);
Assert.Equal(utilisateur.Role, modele.Role);
Assert.Equal(utilisateur.Mail, modele.Mail);
Assert.Equal(utilisateur.IsBan, modele.IsBan);
}
}

@ -5,8 +5,6 @@ VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VeraxShield", "VeraxShield\VeraxShield.csproj", "{40D16910-ADA7-496E-BA48-AA9D6FF1E502}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestVeraxShield", "TestVeraxShield\TestVeraxShield.csproj", "{7924C3CD-C50B-41D1-8A93-C4E0AF0F1B3C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -17,10 +15,6 @@ Global
{40D16910-ADA7-496E-BA48-AA9D6FF1E502}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40D16910-ADA7-496E-BA48-AA9D6FF1E502}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40D16910-ADA7-496E-BA48-AA9D6FF1E502}.Release|Any CPU.Build.0 = Release|Any CPU
{7924C3CD-C50B-41D1-8A93-C4E0AF0F1B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7924C3CD-C50B-41D1-8A93-C4E0AF0F1B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7924C3CD-C50B-41D1-8A93-C4E0AF0F1B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7924C3CD-C50B-41D1-8A93-C4E0AF0F1B3C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,14 +1,12 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<CascadingAuthenticationState>
<VeraxShield.pages.erreurs.ErreurParDefaut/>
</CascadingAuthenticationState>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>

@ -0,0 +1,5 @@
@page "/"
<h1>VeraxShield</h1>
<NavLink href="/utilisateurs/liste"> --> Liste des utilisateurs</NavLink>

@ -0,0 +1,3 @@
@using VeraxShield.composants
@using VeraxShield.composants.modals
@using VeraxShield.composants.formulaires

@ -0,0 +1,11 @@
@using VeraxShield.composants.formulaires
@page "/utilisateurs/ajouter"
<h1>Ajouter un utilisateur</h1>
<FormulaireAjout/>

@ -0,0 +1,85 @@
@using VeraxShield.modele.utilisateurs;
@page "/utilisateurs/liste"
<h1>Utilisateurs de Verax</h1>
<DataGrid TItem="Utilisateur"
Data="@Utilisateurs"
@bind-SelectedRow="@utilisateurSelectionne"
Responsive
ShowPager
ShowPageSizes
PagerPosition="DataGridPagerPosition.TopAndBottom"
PagerOptions="new(){ ButtonSize=Size.Small }"
OnUtilisateurSupprime="HandleUtilisateurSupprime">
<DataGridColumns>
<DataGridCommandColumn />
<DataGridColumn Field="@nameof(Utilisateur.Pseudo)" Caption="Pseudo" Sortable="false" />
<DataGridColumn Field="@nameof(Utilisateur.Prenom)" Caption="Prenom" Editable />
<DataGridColumn Field="@nameof(Utilisateur.Nom)" Caption="Nom" Editable />
<DataGridColumn Field="@nameof(Utilisateur.IsBan)" Caption="Banissement" Editable />
</DataGridColumns>
<PageButtonTemplate>
<Span TextColor="TextColor.Success">
@context.PageNumber
</Span>
</PageButtonTemplate>
<NextPageButtonTemplate><Icon Name="IconName.StepForward" TextColor="TextColor.Success" /></NextPageButtonTemplate>
<PreviousPageButtonTemplate><Icon Name="IconName.StepBackward" TextColor="TextColor.Success" /></PreviousPageButtonTemplate>
<LastPageButtonTemplate><Icon Name="IconName.Forward" TextColor="TextColor.Success" /></LastPageButtonTemplate>
<FirstPageButtonTemplate><Icon Name="IconName.Backward" TextColor="TextColor.Success" /></FirstPageButtonTemplate>
<TotalItemsTemplate><Badge Color="Color.Success">@context.TotalItems total items</Badge></TotalItemsTemplate>
<TotalItemsShortTemplate><Badge Color="Color.Success">@context.TotalItems</Badge></TotalItemsShortTemplate>
<ItemsPerPageTemplate></ItemsPerPageTemplate>
<PageSelectorTemplate>
<Select TextColor="TextColor.Success" @bind-SelectedValue="@context.CurrentPage" Size="Size.Small">
@for (int i = context.FirstVisiblePage; i <= context.LastVisiblePage; ++i)
{
var pageNumber = i;
<SelectItem Value="@pageNumber">@pageNumber</SelectItem>
}
</Select>
</PageSelectorTemplate>
<PageSizesTemplate>
<Select TextColor="TextColor.Success" @bind-SelectedValue="@context.CurrentPageSize" Size="Size.Small">
@foreach (var curPageSize in context.PageSizes)
{
<SelectItem Value="@curPageSize">@curPageSize</SelectItem>
}
</Select>
</PageSizesTemplate>
</DataGrid>
<div>
<NavLink class="btn btn-primary" href="/utilisateurs/ajouter" Match="NavLinkMatch.All">
<i class="fa fa-plus"></i> Ajouter
</NavLink>
</div>
<div>
<Button Color="Color.Primary" Clicked="@modifierUtilisateur">Modifier</Button>
</div>
<div>
<Button Color="Color.Primary" Clicked="@afficherModal">Supprimer</Button>
</div>
<div>
<ModalSuppressionUtilisateur
@ref ="Modal"
utilisateur="@utilisateurSelectionne"
modalFerme="fermetureModal"/>
</div>

@ -0,0 +1,68 @@
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.modals;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace VeraxShield.pages.utilisateurs
{
public partial class ListeUtilisateurs
{
[Inject]
private IUtilisateursDataService utilisateursDataService { get; set; }
public List<Utilisateur> Utilisateurs { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; }
private Utilisateur? utilisateurSelectionne;
[Parameter]
public ModalSuppressionUtilisateur Modal {get; set;}
protected override async Task OnInitializedAsync()
{
//await this.utilisateursDataService.resetDataUtilisateurs();
this.utilisateurSelectionne = null;
this.Utilisateurs = await this.utilisateursDataService.getAllUtilisateurs();
await base.OnInitializedAsync();
}
private async Task HandleUtilisateurSupprime()
{
this.Utilisateurs = await this.utilisateursDataService.getAllUtilisateurs();
StateHasChanged(); // Actualiser la vue
}
public async Task fermetureModal(bool val) {
if (val) {
await this.supprimerUtilisateur(this.utilisateurSelectionne);
}
}
public async Task supprimerUtilisateur(Utilisateur u)
{
await this.utilisateursDataService.SupprimerUtilisateur(u);
this.Utilisateurs = await this.utilisateursDataService.getAllUtilisateurs();
this.NavigationManager.NavigateTo("/utilisateurs/liste");
}
public async Task afficherModal()
{
if (this.Modal != null) {
await this.Modal.afficher();
}
}
public void modifierUtilisateur()
{
if (this.utilisateurSelectionne != null)
{
this.NavigationManager.NavigateTo("/utilisateurs/modifier/" + utilisateurSelectionne.Pseudo);
}
}
}
}

@ -0,0 +1,6 @@
@page "/utilisateurs/modifier/{pseudo}"
<h1> Modifier l'utilisateur </h1>
<FormulaireModification Pseudo="@Pseudo"/>

@ -9,14 +9,14 @@ namespace VeraxShield.pages.utilisateurs
[Parameter]
public String Pseudo {get; set;}
public Utilisateur Utilisateur { get; set;}
[Inject]
private IUtilisateursDataService utilisateursDataService {get; set;}
private Utilisateur utilisateur {get; set;}
protected override async Task OnInitializedAsync()
{
this.Utilisateur = await this.utilisateursDataService.getUtilisateurFromPseudo(this.Pseudo);
await base.OnInitializedAsync();
}
}

@ -5,7 +5,6 @@ using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web;
using VeraxShield.services.UtilisateursDataService;
@ -13,17 +12,17 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
// Ajout du client http par défaut :
builder.Services.AddHttpClient();
// Service factice :
// Ajout du service de gestion des utilisateurs :
// On le met scoped, car c'est comme ça qu'est le service du localStorage alors sinon ça marche pas...
builder.Services.AddScoped<IUtilisateursDataService, UtilisateursDataServiceFactice>();
// Utilisation de l'api :
//builder.Services.AddScoped<IUtilisateursDataService, UtilisateursDataServiceApi>();
// Ajout du service pour le Blazored LocalStorage :
builder.Services.AddBlazoredLocalStorage();
// Ajout de Blazorise :
builder.Services
.AddBlazorise(options =>
{
@ -32,11 +31,6 @@ builder.Services
.AddBootstrapProviders()
.AddFontAwesomeIcons();
builder.Services.AddOptions();
builder.Services.AddAuthorizationCore();
builder.Services.AddScoped<DonneurEtat>();
builder.Services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<DonneurEtat>());
builder.Services.AddScoped<IAuthentificationService, AuthentificationService>();
var app = builder.Build();

@ -1,22 +1,28 @@
{
"iisSettings": {
"iisExpress": {
"applicationUrl": "http://localhost:38362",
"sslPort": 44368
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5272",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5272"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7112;http://localhost:5272",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7112;http://localhost:5272"
}
},
"IIS Express": {
"commandName": "IISExpress",
@ -24,24 +30,6 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:7112",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:7112;http://localhost:5272"
},
"distributionName": ""
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38362",
"sslPort": 44368
}
}
}

@ -11,12 +11,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.4.1" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.4.0" />
<PackageReference Include="Blazorise.Components" Version="1.4.0" />
<PackageReference Include="Blazorise.DataGrid" Version="1.4.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.1" />
<PackageReference Include="Blazorise.DataGrid" Version="1.4.0" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.0" />
</ItemGroup>
</Project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>https</ActiveDebugProfile>
</PropertyGroup>
</Project>

@ -7,5 +7,3 @@
@using Blazorise
@using Blazorise.DataGrid
@using Microsoft.AspNetCore.Components.Authorization

@ -0,0 +1,19 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "7.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,9 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

@ -1,33 +0,0 @@
@inherits LayoutComponentBase
<head>
<link rel="stylesheet" href="css/composants/navBar/NavBarPrincipale.css" />
</head>
<Bar Breakpoint="Breakpoint.Desktop" class="bar-container">
<BarBrand>
<img class="logo" src="/ressources/images/logo/logo.png" Text="Logo de Verax" Fluid @onclick="@NavAccueil"/>
</BarBrand>
<BarToggler />
<BarMenu class="bar-menu">
<BarItem>
<BarLink class="bar-link" @onclick="@NavUtilisateurs">Utilisateurs</BarLink>
</BarItem>
<BarItem>
<BarLink class="bar-link" @onclick="@NavArticles">Articles</BarLink>
</BarItem>
<BarItem>
<BarLink class="bar-link" @onclick="@NavModerateurs">Modérateurs</BarLink>
</BarItem>
</BarMenu>
<BarEnd>
<BarItem class="bar-role">
@DonneurEtat.getUtilisateurCourant().Pseudo
</BarItem>
<BarItem>
<Button Color="Color.Primary" @onclick="@Deconnecter">Deconnexion</Button>
</BarItem>
</BarEnd>
</Bar>
@Body

@ -1,39 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace VeraxShield.composants.affichages.navBar
{
public partial class NavBarPrincipale
{
[Inject]
private DonneurEtat DonneurEtat { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; }
private async Task NavUtilisateurs()
{
NavigationManager.NavigateTo("/utilisateurs/liste");
}
private async Task NavArticles()
{
NavigationManager.NavigateTo("/articles/liste");
}
private async Task NavModerateurs()
{
NavigationManager.NavigateTo("/moderateurs/liste");
}
private async Task Deconnecter()
{
await DonneurEtat.Deconnexion();
NavigationManager.NavigateTo("/connexion");
}
private async Task NavAccueil()
{
NavigationManager.NavigateTo("/");
}
}
}

@ -1,102 +0,0 @@
@using VeraxShield.modele.utilisateurs;
@using Microsoft.AspNetCore.Components;
@using VeraxShield.composants.modals;
@using VeraxShield.composants.affichages.navBar;
@layout NavBarPrincipale
<head>
<link rel="stylesheet" href="css/composants/affichages/utilisateurs/datagridUtilisateurs.css">
</head>
<DataGrid TItem="Utilisateur"
Data="@Utilisateurs"
@bind-SelectedRow="@UtilisateurSelectionne"
Responsive
ShowPager
ShowPageSizes
PagerPosition="DataGridPagerPosition.TopAndBottom"
PagerOptions="new(){ ButtonSize=Size.Small }"
OnUtilisateurSupprime="HandleUtilisateurSupprime">
<DataGridColumns>
<DataGridCommandColumn />
<DataGridColumn Field="@nameof(Utilisateur.Pseudo)" Caption="Pseudo" Sortable="false" />
<DataGridColumn Field="@nameof(Utilisateur.Prenom)" Caption="Prenom" Editable />
<DataGridColumn Field="@nameof(Utilisateur.Nom)" Caption="Nom" Editable />
<DataGridColumn Field="@nameof(Utilisateur.IsBan)" Caption="Banissement" Editable >
<DisplayTemplate>
@if (context.IsBan)
{
<Badge Color="Color.Danger" Pill>Ban</Badge>
} else
{
<Badge Color="Color.Success" Pill>Valide</Badge>
}
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn Field="@nameof(Utilisateur.Role)" Caption="role" Editable />
<DataGridColumn Field="@nameof(Utilisateur.Mail)" Caption="mail" Editable />
<DataGridColumn Field="@nameof(Utilisateur.Pseudo)" Caption="Gerer">
<DisplayTemplate>
<button type="button" class="btn btn-primary editButton" @onclick="() => onClickBoutonSuppression(context.Pseudo)"><i class="fa fa-trash"></i> </button>
<button type="button" class="btn btn-primary editButton" @onclick="() => onClickBoutonModification(context.Pseudo)"><i class="fa fa-edit"></i> </button>
</DisplayTemplate>
</DataGridColumn>
</DataGridColumns>
<PageButtonTemplate>
<Span class="darkBlue">
@context.PageNumber
</Span>
</PageButtonTemplate>
<NextPageButtonTemplate><Icon Name="IconName.StepForward" class="darkBlue" /></NextPageButtonTemplate>
<PreviousPageButtonTemplate><Icon Name="IconName.StepBackward" class="darkBlue" /></PreviousPageButtonTemplate>
<LastPageButtonTemplate><Icon Name="IconName.Forward" class="darkBlue" /></LastPageButtonTemplate>
<FirstPageButtonTemplate><Icon Name="IconName.Backward" class="darkBlue" /></FirstPageButtonTemplate>
<TotalItemsTemplate><Badge class="darkBlue">@context.TotalItems utilisateurs</Badge></TotalItemsTemplate>
<TotalItemsShortTemplate><Badge class="darkBlue">@context.TotalItems</Badge></TotalItemsShortTemplate>
<ButtonRowTemplate>
<Button Class="editButton biggest" Clicked="boutonclick">+</Button>
</ButtonRowTemplate>
<ItemsPerPageTemplate></ItemsPerPageTemplate>
<PageSelectorTemplate>
<Select TextColor="TextColor.Success" @bind-SelectedValue="@context.CurrentPage" Size="Size.Small">
@for (int i = context.FirstVisiblePage; i <= context.LastVisiblePage; ++i)
{
var pageNumber = i;
<SelectItem Value="@pageNumber">@pageNumber</SelectItem>
}
</Select>
</PageSelectorTemplate>
<PageSizesTemplate>
<Select class="darkBlue" @bind-SelectedValue="@context.CurrentPageSize" Size="Size.Small">
@foreach (var curPageSize in context.PageSizes)
{
<SelectItem Value="@curPageSize">@curPageSize</SelectItem>
}
</Select>
</PageSizesTemplate>
</DataGrid>
<div>
<ModalSuppressionUtilisateur
utilisateur="@UtilisateurSelectionne"
@ref="Modal"
modalFerme="fermetureModal" />
</div>

@ -1,92 +0,0 @@
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.factories;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
using VeraxShield.composants.modals;
namespace VeraxShield.composants.affichages.utilisateurs
{
public partial class DatagridUtilisateurs
{
[Inject]
private IUtilisateursDataService UtilisateursDataService { get; set; }
public static List<Utilisateur> Utilisateurs { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; }
[Inject]
private DonneurEtat DonneurEtat {get; set;}
public static Utilisateur? UtilisateurSelectionne { get; set; }
[Parameter]
public ModalSuppressionUtilisateur Modal {get; set;}
protected override async Task OnInitializedAsync()
{
DatagridUtilisateurs.UtilisateurSelectionne = null;
DatagridUtilisateurs.Utilisateurs = await this.UtilisateursDataService.getAllUtilisateurs();
await base.OnInitializedAsync();
}
private async Task HandleUtilisateurSupprime()
{
DatagridUtilisateurs.Utilisateurs = await this.UtilisateursDataService.getAllUtilisateurs();
StateHasChanged();
}
public async Task fermetureModal(bool suppressionConfirmee) {
if (suppressionConfirmee) {
await this.supprimerUtilisateur(DatagridUtilisateurs.UtilisateurSelectionne);
}
}
public async Task supprimerUtilisateur(Utilisateur u)
{
await this.UtilisateursDataService.SupprimerUtilisateur(u);
DatagridUtilisateurs.Utilisateurs = await this.UtilisateursDataService.getAllUtilisateurs();
this.NavigationManager.NavigateTo("/utilisateurs/liste");
}
public async Task afficherModal()
{
if (this.Modal != null) {
await this.Modal.afficher();
}
}
public void modifierUtilisateur()
{
if (DatagridUtilisateurs.UtilisateurSelectionne != null)
{
this.NavigationManager.NavigateTo("/utilisateurs/modifier/" + DatagridUtilisateurs.UtilisateurSelectionne.Pseudo);
}
}
public async Task onClickBoutonSuppression(String pseudo)
{
DatagridUtilisateurs.UtilisateurSelectionne= await this.UtilisateursDataService.getUtilisateurFromPseudo(pseudo);
if (this.DonneurEtat._utilisateurCourant.Pseudo != DatagridUtilisateurs.UtilisateurSelectionne.Pseudo)
{
await this.afficherModal();
}
}
public async Task onClickBoutonModification(String pseudo)
{
DatagridUtilisateurs.UtilisateurSelectionne = await this.UtilisateursDataService.getUtilisateurFromPseudo(pseudo);
this.modifierUtilisateur();
}
public async Task boutonclick()
{
NavigationManager.NavigateTo("/utilisateurs/ajouter");
}
}
}

@ -1,67 +0,0 @@
@using Blazorise.Components;
@using System.ComponentModel.DataAnnotations;
<head>
<link rel="stylesheet" href="css/composants/authentification/FormulaireConnexion.css" />
</head>
<div class="connexion-container">
<h1 class="title-spacing"> Se connecter</h1>
<Validations @ref="Validations" Mode="ValidationMode.Manual" Model="Requete">
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Pseudo</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre pseudo" @bind-Text="@Requete.Pseudo">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Mot de passe</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<div class="input-group">
<TextEdit @bind-Text="@Requete.MotDePasse"
Type="@(showPassword ? "text" : "password")"
Class="form-control" Placeholder="Mot De Passe"/>
<span class="input-group-btn">
<button class="btn btn-default" type="button" @onclick="ToggleShowPassword">
<i class="@(showPassword ? "fa fa-eye-slash" : "fa fa-eye")"></i>
</button>
</span>
</div>
</FieldBody>
</Field>
</Validation>
</div>
<div class="btn-container">
<Button Class="btn-se-connecter" Clicked="@OnSubmit">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.Seedling" />
Se connecter</Button>
<Button Class="btn-s-inscrire" Clicked="@RedirectionInscription">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.CreditCard" />
S'inscrire</Button>
</div>
<label class="text-danger">@Erreur</label>
</Validations>
</div>

@ -1,58 +0,0 @@
using Blazorise;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.formulaires.modeles;
namespace VeraxShield.composants.authentification
{
public partial class FormulaireConnexion
{
[Parameter]
public Validations Validations {get; set;}
public RequeteConnexion Requete {get; set;}
[Inject]
private NavigationManager NavigationManager {get; set;}
[Inject]
private DonneurEtat DonneurEtat {get; set;}
public String Erreur {get; set; }
public bool showPassword = false;
protected override async Task OnInitializedAsync()
{
this.Requete = new RequeteConnexion();
await base.OnInitializedAsync();
}
public async Task OnSubmit()
{
if (await this.Validations.ValidateAll())
{
try
{
await DonneurEtat.Connexion(this.Requete);
NavigationManager.NavigateTo("/");
} catch (Exception ex)
{
this.Erreur = ex.Message;
}
}
}
public async Task RedirectionInscription()
{
this.NavigationManager.NavigateTo("/inscription");
}
private void ToggleShowPassword()
{
showPassword = !showPassword;
}
}
}

@ -1,131 +0,0 @@
@using Blazorise.Components;
@using System.ComponentModel.DataAnnotations;
<head>
<link rel="stylesheet" href="css/composants/authentification/FormulaireConnexion.css" />
</head>
<div class="connexion-container">
<h1 class="title-spacing"> S'inscrire </h1>
<Validations @ref="Validations" Mode="ValidationMode.Manual" Model="Requete">
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Pseudo</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre pseudo" @bind-Text="@Requete.Pseudo">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Prenom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre prenom" @bind-Text="@Requete.Prenom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Nom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre nom" @bind-Text="@Requete.Nom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Mail</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre mail" @bind-Text="@Requete.Mail">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Mot de passe</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<div class="input-group">
<TextEdit @bind-Text="@Requete.MotDePasse"
Type="@(showPassword ? "text" : "password")"
Class="form-control" Placeholder="Mot de passe" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" @onclick="ToggleShowPassword">
<i class="@(showPassword ? "fa fa-eye-slash" : "fa fa-eye")"></i>
</button>
</span>
</div>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Confirmer le mot de passe</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<div class="input-group">
<TextEdit @bind-Text="@Requete.MotDePasseConfirmation"
Type="@(showPasswordConf ? "text" : "password")"
Class="form-control" Placeholder="Confirmez mot de passe" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" @onclick="ToggleShowPasswordConf">
<i class="@(showPasswordConf ? "fa fa-eye-slash" : "fa fa-eye")"></i>
</button>
</span>
</div>
</FieldBody>
</Field>
</Validation>
</div>
<div class="btn-container">
<Button Class="btn-se-connecter" Clicked="@OnSubmit">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.CheckCircle" />
S'inscrire</Button>
<Button Class="btn-s-inscrire" Clicked="@OnAnnulation">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.Reply" />
Annuler</Button>
</div>
<label class="text-danger">@Erreur</label>
</Validations>
</div>

@ -1,63 +0,0 @@
using Blazorise;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.affichages.utilisateurs;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.services.UtilisateursDataService;
namespace VeraxShield.composants.authentification
{
public partial class FormulaireInscription
{
[Parameter]
public Validations Validations {get; set;}
public RequeteInscription Requete {get; set;}
[Inject]
private NavigationManager NavigationManager {get; set;}
[Inject]
private DonneurEtat DonneurEtat {get; set;}
[Inject]
private IUtilisateursDataService UtilisateursDataService {get; set;}
public String Erreur {get; set; }
public bool showPassword {get; set;}
public bool showPasswordConf {get; set;}
protected override async Task OnInitializedAsync()
{
this.showPassword = false;
this.showPasswordConf = false;
this.Requete = new RequeteInscription();
DatagridUtilisateurs.Utilisateurs = await this.UtilisateursDataService.getAllUtilisateurs();
await base.OnInitializedAsync();
}
public async Task OnSubmit()
{
if (await this.Validations.ValidateAll())
{
await DonneurEtat.Inscription(this.Requete);
NavigationManager.NavigateTo("/connexion");
}
}
public async Task OnAnnulation()
{
this.NavigationManager.NavigateTo("/connexion");
}
private void ToggleShowPassword()
{
showPassword = !showPassword;
}
private void ToggleShowPasswordConf()
{
showPasswordConf = !showPasswordConf;
}
}
}

@ -1,13 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace VeraxShield.composants.formulaires.modeles
{
public class RequeteConnexion
{
[Required(ErrorMessage="le champ est obligatoire !")]
public string MotDePasse { get; set; }
[Required(ErrorMessage="le champ est obligatoire !")]
public string Pseudo { get; set; }
}
}

@ -1,36 +0,0 @@
using System.ComponentModel.DataAnnotations;
using VeraxShield.composants.formulaires.modeles.attributsValidationCustoms;
namespace VeraxShield.composants.formulaires.modeles
{
public class RequeteInscription
{
[Required]
[RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "Le mot de passe doit contenir uniquement des caractères alphanumériques.")]
public string MotDePasse { get; set; }
[Required]
[Compare(nameof(MotDePasse), ErrorMessage = "Les mots de passe diffèrent !")]
public string MotDePasseConfirmation { get; set; }
[Required]
[RegularExpression("^[a-zA-Z]+$", ErrorMessage = "Le nom doit contenir uniquement des lettres.")]
[StringLength(20, ErrorMessage = "Le nom ne doit pas dépasser 20 caractères !")]
public string Nom { get; set; }
[Required]
[StringLength(20, ErrorMessage = "Le prénom ne doit pas dépasser 20 caractères !")]
[RegularExpression("^[a-zA-Z]+$", ErrorMessage = "Le prénom doit contenir uniquement des lettres.")]
public string Prenom {get; set;}
[Required]
[StringLength(20, ErrorMessage = "Le pseudo ne doit pas dépasser 20 caractères !")]
[RegularExpression("^[a-zA-Z0-9_]+$", ErrorMessage = "Le pseudo contient des caractères interdits.")]
[PseudoCorrect]
public string Pseudo { get; set; }
[Required]
[EmailAddress(ErrorMessage = "Veuillez entrer une adresse email valide.")]
public string Mail { get; set;}
}
}

@ -1,115 +1,58 @@
@using Blazorise.Components
@using System.ComponentModel.DataAnnotations;
<head>
<link rel="stylesheet" href="css/composants/formulaires/FormulaireAjout.css" />
</head>
<div class="formulaire-conteneur">
<h1 class="title-spacing"> Ajouter un utilisateur </h1>
<Validations @ref="Validations" Mode="ValidationMode.Manual" Model="Modele">
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Pseudo</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son pseudo" @bind-Text="@Modele.Pseudo">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Prenom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son prénom" @bind-Text="@Modele.Prenom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Nom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son nom" @bind-Text="@Modele.Nom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Mail</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son mail" @bind-Text="@Modele.Mail">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Role</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son role" @bind-Text="@Modele.Role">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2" Class="field-label">Mot de passe</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez son mot de passe" @bind-Text="@Modele.Mdp">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="btn-container">
<Button Class="btn-se-connecter" Clicked="@OnSubmit">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.CheckCircle" />
Ajouter</Button>
<Button Class="btn-s-inscrire" Clicked="@OnAnnulation">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.Reply" />
Annuler</Button>
</div>
</Validations>
</div>

<EditForm Model="@Modele" OnValidSubmit="@ajouterUtilisateur">
<DataAnnotationsValidator />
<Microsoft.AspNetCore.Components.Forms.ValidationSummary />
<p>
<label for="pseudo">
Pseudo :
<InputText id="pseudo" @bind-Value="Modele.Pseudo" />
</label>
</p>
<p>
<label for="prenom">
Prénom :
<InputText id="prenom" @bind-Value="Modele.Prenom" />
</label>
</p>
<p>
<label for="nom">
Nom :
<InputText id="nom" @bind-Value="Modele.Nom" />
</label>
</p>
<p>
<label for="role">
Role :
<InputText id="role" @bind-Value="Modele.Role" />
</label>
</p>
<p>
<label for="mail">
Email :
<InputText id="mail" @bind-Value="Modele.Mail" />
</label>
</p>
<p>
<label for="mdp">
Mot de passe :
<InputText id="mdp" @bind-Value="Modele.Mdp" />
</label>
</p>
<p>
<label>
Utilisateur banni :
<InputCheckbox @bind-Value="Modele.IsBan" />
</label>
</p>
<button Type="Submit">Valider la création</button>
</EditForm>

@ -1,4 +1,4 @@
using Blazorise;
using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.factories;
@ -9,41 +9,34 @@ namespace VeraxShield.composants.formulaires
{
public partial class FormulaireAjout
{
[Parameter]
public Validations Validations {get; set;}
public FormulaireAjoutModele Modele {get; set;}
[Inject]
private NavigationManager NavigationManager {get; set;}
private NavigationManager NavigationManager { get; set; }
private FormulaireAjoutModele Modele { get; set; }
[Inject]
private IUtilisateursDataService utilisateursDataService { get; set; }
public FormulaireAjout()
{
}
protected override async Task OnInitializedAsync()
{
this.Modele = new FormulaireAjoutModele();
this.Modele.IsBan = false;
await base.OnInitializedAsync();
}
public async Task OnSubmit()
public async void ajouterUtilisateur()
{
if (await this.Validations.ValidateAll())
{
if(this.Modele.Mdp == null)
{
this.Modele.Mdp = this.Modele.Pseudo;
}
Utilisateur nouvelUtilisateur = UtilisateursFactory.toUtilisateur(this.Modele);
await this.utilisateursDataService.AjouterUtilisateur(nouvelUtilisateur);
this.NavigationManager.NavigateTo("/utilisateurs/liste");
}
}
public async Task OnAnnulation()
{
//Console.WriteLine("Utilisateur bien ajouté !");
this.NavigationManager.NavigateTo("/utilisateurs/liste");
}
}

@ -1,119 +1,58 @@
<head>
<link rel="stylesheet" href="css/composants/formulaires/FormulaireModification.css">
</head>
<div class="formulaire-conteneur">
<h1 class="title-spacing"> Modifier l'utilisateur</h1>
<Validations @ref="Validations" Mode="ValidationMode.Manual" Model="Modele">
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Pseudo</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre pseudo" @bind-Text="@Modele.Pseudo">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Prenom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre prenom" @bind-Text="@Modele.Prenom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Nom</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre nom" @bind-Text="@Modele.Nom">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Mail</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez votre mail" @bind-Text="@Modele.Mail">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Role</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Entrez le role" @bind-Text="@Modele.Role">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div class="field-container">
<Validation>
<Field Horizontal>
<FieldLabel ColumnSize="ColumnSize.Is2">Modifier Mot de passe</FieldLabel>
<FieldBody ColumnSize="ColumnSize.Is10">
<TextEdit Placeholder="Nouveau mot de passe (facultatif)" @bind-Text="@Modele.Mdp">
<Feedback>
<ValidationError />
</Feedback>
</TextEdit>
</FieldBody>
</Field>
</Validation>
</div>
<div>
<Validation>
<Switch TValue="bool" @bind-Checked="@Modele.IsBan" Color="Color.Primary">Utilisateur banni</Switch>
</Validation>
</div>
<div class="btn-container">
<Button Class="btn-se-connecter" Clicked="@modifierUtilisateur">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.CheckCircle" />
Modifier</Button>
<Button Class="btn-s-inscrire" Clicked="@OnAnnulation">
<Icon Name="Blazorise.Icons.FontAwesome.FontAwesomeIcons.Reply" />
Annuler</Button>
</div>
</Validations>
</div>
<EditForm Model="@Modele" OnValidSubmit="@modifierUtilisateur">
<DataAnnotationsValidator />
<Microsoft.AspNetCore.Components.Forms.ValidationSummary />
<p>
<label for="pseudo">
Pseudo :
<InputText id="pseudo" @bind-Value="Modele.Pseudo" />
</label>
</p>
<p>
<label for="prenom">
Prénom :
<InputText id="prenom" @bind-Value="Modele.Prenom" />
</label>
</p>
<p>
<label for="nom">
Nom :
<InputText id="nom" @bind-Value="Modele.Nom" />
</label>
</p>
<p>
<label for="role">
Role :
<InputText id="role" @bind-Value="Modele.Role" />
</label>
</p>
<p>
<label for="mail">
Email :
<InputText id="mail" @bind-Value="Modele.Mail" />
</label>
</p>
<p>
<label for="mdp">
Mot de passe :
<InputText id="mdp" @bind-Value="Modele.Mdp" />
</label>
</p>
<p>
<label>
Utilisateur banni :
<InputCheckbox @bind-Value="Modele.IsBan" />
</label>
</p>
<button Type="Submit">Valider la modification </button>
</EditForm>

@ -1,7 +1,5 @@
using Blazorise;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.composants.formulaires.modeles.attributsValidationCustoms;
using VeraxShield.factories;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
@ -11,63 +9,42 @@ namespace VeraxShield.composants.formulaires
public partial class FormulaireModification
{
[Parameter]
public String Pseudo { get; set; }
public Utilisateur Utilisateur {get; set;}
[Parameter]
public Validations Validations {get; set;}
public FormulaireAjoutModele Modele {get; set;}
[Inject]
private IUtilisateursDataService utilisateursDataService { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set;}
protected override async Task OnParametersSetAsync()
{
if (this.Utilisateur != null)
{
Utilisateur temp = new Utilisateur(" ", " ", " ", " ", " ", " ", true);
this.Modele = UtilisateursFactory.toModele(this.Utilisateur);
} else
protected override async Task OnInitializedAsync()
{
Utilisateur temp = new Utilisateur(" ", " ", " ", " ", " ", " ", true);
this.Modele = UtilisateursFactory.toModele(temp);
}
//Console.WriteLine("[comp] pseudo param : " + this.Pseudo);
await base.OnParametersSetAsync();
}
//Utilisateur temp = await this.utilisateursDataService.getUtilisateurFromPseudo(this.Pseudo);
//if (temp != null)
//{
// Console.WriteLine("[comp] : Le user est pas nul ! p : " + temp.Pseudo);
//}
protected async Task modifierUtilisateur()
{
this.Utilisateur = new Utilisateur("temp", "temp", "temp", "temp", "temp", "temp", true);
this.Modele = UtilisateursFactory.toModele(this.Utilisateur);
if (await this.Validations.ValidateAll())
if (this.Modele == null)
{
if (this.Modele.Mdp == null)
{
this.Modele.Mdp = Utilisateur.Mdp;
Console.WriteLine("Le modele est tjrs nul...");
}
Utilisateur temp = UtilisateursFactory.toUtilisateur(this.Modele);
if (this.Utilisateur.Pseudo != this.Modele.Pseudo)
{
await this.utilisateursDataService.MettreAJourUtilisateur(this.Utilisateur, temp);
}
else
{
await this.utilisateursDataService.MettreAJourUtilisateur(temp);
await base.OnInitializedAsync();
}
this.NavigationManager.NavigateTo("/utilisateurs/liste");
}
}
protected async Task OnAnnulation()
protected async Task modifierUtilisateur()
{
this.NavigationManager.NavigateTo("/utilisateurs/liste");
Utilisateur temp = UtilisateursFactory.toUtilisateur(this.Modele);
await this.utilisateursDataService.MettreAJourUtilisateur(temp);
}
}
}

@ -1,8 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.formulaires.modeles.attributsValidationCustoms;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace VeraxShield.composants.formulaires.modeles
{
@ -10,29 +6,23 @@ namespace VeraxShield.composants.formulaires.modeles
{
[Required]
[StringLength(20, ErrorMessage = "Le pseudo ne doit pas dépasser 20 caractères !")]
[RegularExpression("^[a-zA-Z0-9_]+$", ErrorMessage = "Le pseudo contient des caractères interdits.")]
[PseudoCorrect]
public string Pseudo { get; set; }
public String Pseudo { get; set; }
[Required]
[StringLength(20, ErrorMessage = "Le nom ne doit pas dépasser 20 caractères !")]
[RegularExpression("^[a-zA-Z]+$", ErrorMessage = "Le nom doit contenir uniquement des lettres.")]
public String Nom { get; set; }
[Required]
[StringLength(20, ErrorMessage = "Le prénom ne doit pas dépasser 20 caractères !")]
[RegularExpression("^[a-zA-Z]+$", ErrorMessage = "Le prénom doit contenir uniquement des lettres.")]
public String Prenom { get; set; }
[Required]
[EmailAddress(ErrorMessage = "Veuillez entrer une adresse email valide.")]
public String Mail { get; set; }
[RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "Le mot de passe doit contenir uniquement des caractères alphanumériques.")]
[Required]
public String Mdp { get; set; }
[Required]
[RoleExistant]
public String Role { get; set; }
[Required]
@ -50,7 +40,12 @@ namespace VeraxShield.composants.formulaires.modeles
public FormulaireAjoutModele()
{
Mdp = null;
//Pseudo = "temporairementVide";
//Nom = "temporairementVide";
//Prenom = "temporairementVide";
//Mail = "temporairementVide";
//Mdp = "temporairementVide";
//IsBan = true;
}
}
}

@ -1,37 +0,0 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Components;
using VeraxShield.composants.affichages.utilisateurs;
using VeraxShield.modele.utilisateurs;
using VeraxShield.services.UtilisateursDataService;
namespace VeraxShield.composants.formulaires.modeles.attributsValidationCustoms
{
public class PseudoCorrectAttribute : ValidationAttribute
{
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
{
bool pseudoExisteDeja = false;
var pseudo = (string)value;
foreach (Utilisateur u in DatagridUtilisateurs.Utilisateurs)
{
if ((u.Pseudo == pseudo))
{
if (DatagridUtilisateurs.UtilisateurSelectionne == null) {
return new ValidationResult("Le pseudo existe deja, choississez en un autre.");
}
if (DatagridUtilisateurs.UtilisateurSelectionne != null)
{
if (u.Pseudo != DatagridUtilisateurs.UtilisateurSelectionne.Pseudo)
{
return new ValidationResult("Le pseudo existe deja, choississez en un autre.");
}
}
}
}
return ValidationResult.Success;
}
}
}

@ -1,33 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace VeraxShield.composants.formulaires.modeles.attributsValidationCustoms
{
public class RoleExistantAttribute : ValidationAttribute
{
private List<string> RolesExistants {get; set;}
public RoleExistantAttribute()
{
this.RolesExistants = new List<string>();
this.RolesExistants.Add("admin");
this.RolesExistants.Add("modo");
this.RolesExistants.Add("invite");
this.RolesExistants.Add("redacteur");
}
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
{
var role = (string)value;
foreach (string roleListe in this.RolesExistants)
{
if (roleListe == role)
{
return ValidationResult.Success;;
}
}
return new ValidationResult("Le role n'existe pas.");
}
}
}

@ -1,6 +1,4 @@
using Blazorise.DataGrid;
using VeraxShield.composants.affichages.utilisateurs;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.composants.formulaires.modeles;
using VeraxShield.modele.utilisateurs;
namespace VeraxShield.factories
@ -9,21 +7,6 @@ namespace VeraxShield.factories
{
public static Utilisateur toUtilisateur(FormulaireAjoutModele modele)
{
if (DatagridUtilisateurs.UtilisateurSelectionne != null )
{
if (DatagridUtilisateurs.UtilisateurSelectionne.Mdp != modele.Mdp)
{
var motDePasseClair = modele.Mdp;
modele.Mdp = BCrypt.Net.BCrypt.HashPassword(motDePasseClair);
}
}
else
{
var motDePasseClair = modele.Mdp;
modele.Mdp = BCrypt.Net.BCrypt.HashPassword(motDePasseClair);
}
Utilisateur temp = new Utilisateur(
modele.Pseudo,
modele.Nom,
@ -42,11 +25,7 @@ namespace VeraxShield.factories
temp.Pseudo = u.Pseudo;
temp.Nom = u.Nom;
temp.Prenom = u.Prenom;
// ici dehash
//temp.Mdp = u.Mdp;
temp.Mdp = u.Mdp;
temp.Role = u.Role;
temp.Mail = u.Mail;
temp.IsBan = u.IsBan;

@ -1,32 +0,0 @@
public class ModeleAppUtilisateur
{
public string MotDePasse { get; set; }
public List<string> Roles { get; set; }
public string Pseudo { get; set; }
public string Prenom { get; set; }
public string Nom { get; set; }
public string Mail { get; set; }
public ModeleAppUtilisateur(string pseudo,string nom, string prenom, string mail, string mdp, String premierRole)
{
this.MotDePasse = mdp;
this.Pseudo = pseudo;
this.Mail = mail;
this.Prenom = prenom;
this.Nom = nom;
this.Roles = new List<string>();
this.Roles.Add(premierRole);
}
public void ajouterRole(string nouveauRole)
{
this.Roles.Add(nouveauRole);
}
public void supprimerRole(string ancienRole)
{
this.Roles.Remove(ancienRole);
}
}

@ -1,6 +0,0 @@
public class UtilisateurCourant
{
public Dictionary<string, string> Claims { get; set; }
public bool EstAuthentifie { get; set; }
public string Pseudo { get; set; }
}

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("VeraxShield")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("VeraxShield")]
[assembly: System.Reflection.AssemblyTitleAttribute("VeraxShield")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Généré par la classe MSBuild WriteCodeFragment.

@ -0,0 +1 @@
54ec86336691cd8e30d56e0626a072204aa8b87e70c3335381168aefb1f8f397

@ -0,0 +1,83 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb = true
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = VeraxShield
build_property.RootNamespace = VeraxShield
build_property.ProjectDir = C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.RazorLangVersion = 7.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield
build_property._RazorSourceGeneratorDebug =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/App.razor]
build_metadata.AdditionalFiles.TargetPath = QXBwLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/composants/formulaires/FormulaireAjout.razor]
build_metadata.AdditionalFiles.TargetPath = Y29tcG9zYW50c1xmb3JtdWxhaXJlc1xGb3JtdWxhaXJlQWpvdXQucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/composants/formulaires/FormulaireModification.razor]
build_metadata.AdditionalFiles.TargetPath = Y29tcG9zYW50c1xmb3JtdWxhaXJlc1xGb3JtdWxhaXJlTW9kaWZpY2F0aW9uLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/composants/formulaires/_Imports.razor]
build_metadata.AdditionalFiles.TargetPath = Y29tcG9zYW50c1xmb3JtdWxhaXJlc1xfSW1wb3J0cy5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/composants/modals/ModalSuppressionUtilisateur.razor]
build_metadata.AdditionalFiles.TargetPath = Y29tcG9zYW50c1xtb2RhbHNcTW9kYWxTdXBwcmVzc2lvblV0aWxpc2F0ZXVyLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/composants/modals/_Imports.razor]
build_metadata.AdditionalFiles.TargetPath = Y29tcG9zYW50c1xtb2RhbHNcX0ltcG9ydHMucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/MainLayout.razor]
build_metadata.AdditionalFiles.TargetPath = TWFpbkxheW91dC5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/connexion/connexion.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcY29ubmV4aW9uXGNvbm5leGlvbi5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/Index.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXgucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/utilisateurs/AjouterUtilisateur.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcdXRpbGlzYXRldXJzXEFqb3V0ZXJVdGlsaXNhdGV1ci5yYXpvcg==
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/utilisateurs/ListeUtilisateurs.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcdXRpbGlzYXRldXJzXExpc3RlVXRpbGlzYXRldXJzLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/utilisateurs/ModifierUtilisateur.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcdXRpbGlzYXRldXJzXE1vZGlmaWVyVXRpbGlzYXRldXIucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/_Imports.razor]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0ltcG9ydHMucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/shared/layouts/Entete.razor]
build_metadata.AdditionalFiles.TargetPath = c2hhcmVkXGxheW91dHNcRW50ZXRlLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/_Imports.razor]
build_metadata.AdditionalFiles.TargetPath = X0ltcG9ydHMucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Users/nosillard/source/repos/Blazor_SAE/VeraxShield/VeraxShield/Pages/_Host.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0hvc3QuY3NodG1s
build_metadata.AdditionalFiles.CssScope =

@ -0,0 +1,17 @@
// <auto-generated/>
global using global::Microsoft.AspNetCore.Builder;
global using global::Microsoft.AspNetCore.Hosting;
global using global::Microsoft.AspNetCore.Http;
global using global::Microsoft.AspNetCore.Routing;
global using global::Microsoft.Extensions.Configuration;
global using global::Microsoft.Extensions.DependencyInjection;
global using global::Microsoft.Extensions.Hosting;
global using global::Microsoft.Extensions.Logging;
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Net.Http.Json;
global using global::System.Threading;
global using global::System.Threading.Tasks;

@ -0,0 +1 @@
d5ac7ab69059af111e9d7125adeb7b174ca570725d4b64a544cca7bd11ac7ca0

@ -0,0 +1,18 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ProvideApplicationPartFactoryAttribute("Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFact" +
"ory, Microsoft.AspNetCore.Mvc.Razor")]
// Généré par la classe MSBuild WriteCodeFragment.

@ -0,0 +1 @@
cf775d073cd547bf1accc222093a6622004faebaa543ebbe3f1bac5d79987cf9

@ -0,0 +1,58 @@
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\appsettings.Development.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\appsettings.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.staticwebassets.runtime.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.exe
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.deps.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.runtimeconfig.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\VeraxShield.pdb
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.AssemblyInfoInputs.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.AssemblyInfo.cs
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.csproj.CoreCompileInputs.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.MvcApplicationPartsAssemblyInfo.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.RazorAssemblyInfo.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.RazorAssemblyInfo.cs
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets.build.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets.development.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets\msbuild.VeraxShield.Microsoft.AspNetCore.StaticWebAssets.props
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets\msbuild.build.VeraxShield.props
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets\msbuild.buildMultiTargeting.VeraxShield.props
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets\msbuild.buildTransitive.VeraxShield.props
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\staticwebassets.pack.json
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\scopedcss\bundle\VeraxShield.styles.css
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\refint\VeraxShield.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.pdb
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.genruntimeconfig.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\ref\VeraxShield.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazored.LocalStorage.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.csproj.AssemblyReference.cache
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.csproj.CopyComplete
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.Bootstrap.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.DataGrid.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.Icons.FontAwesome.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.Licensing.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\DeepCloner.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.AspNetCore.Authorization.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.AspNetCore.Components.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.AspNetCore.Components.Forms.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.AspNetCore.Components.Web.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.AspNetCore.Metadata.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.Extensions.Logging.Abstractions.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.Extensions.Options.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Microsoft.JSInterop.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.Components.dll
C:\Users\jeanm\OneDrive\Documents\BUT\Blazor_SAE\VeraxShield\VeraxShield\bin\Debug\net7.0\Blazorise.Snackbar.dll
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.csproj.AssemblyReference.cache
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.AssemblyInfoInputs.cache
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.AssemblyInfo.cs
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.csproj.CoreCompileInputs.cache
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.MvcApplicationPartsAssemblyInfo.cache
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.RazorAssemblyInfo.cache
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.RazorAssemblyInfo.cs
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.dll
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\refint\VeraxShield.dll
C:\Users\nosillard\source\repos\Blazor_SAE\VeraxShield\VeraxShield\obj\Debug\net7.0\VeraxShield.pdb

@ -0,0 +1 @@
a5ef9924292fc9d83e22623a89ae80f245a08dda172e8ca4fdd9cef47b726341

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save