Compare commits
No commits in common. "1024cf844aa411d14120d1cd6e8a583bf635cdbc" and "c7d0542d5ff2930226ec21d928ff6452ecbbe7f9" have entirely different histories.
1024cf844a
...
c7d0542d5f
2 changed files with 27 additions and 39 deletions
|
@ -780,8 +780,7 @@ expressMiddleware(server, {
|
|||
token,
|
||||
new TextEncoder().encode(process.env.SECRET_KEY),
|
||||
);
|
||||
// Log du payload du token
|
||||
console.log('Token verified:', verify.payload);
|
||||
console.log('Token verified:', verify.payload); // Log du payload du token
|
||||
user = await new UserService().findUserByEmail(
|
||||
verify.payload.email,
|
||||
);
|
||||
|
@ -817,9 +816,8 @@ export const customAuthChecker: AuthChecker<MyContext> = (
|
|||
roles
|
||||
) => {
|
||||
if (context.user) {
|
||||
// si l 'utilisateur est connecté
|
||||
// vérifier que le user a le role demandé
|
||||
// si le tableau de roles a une longueur > 1
|
||||
//si l 'utilisateur est connecté
|
||||
//vérifier que le user à le role demandé si le tableau de roles à une longueur > 1
|
||||
if (roles.length > 0) { // si un role est indiqué au décorateur
|
||||
//et que le user a le role parmi ce tableau
|
||||
if (roles.includes(context.user.role)) {
|
||||
|
@ -1319,12 +1317,7 @@ import styles from '../components/MainNav/MainNav.module.css';
|
|||
function CategoryButton({name, id}: {name: string, id: string}) {
|
||||
return (
|
||||
<div>
|
||||
<Button
|
||||
className={styles.categoryButton}
|
||||
variant="contained"
|
||||
href={`/categories/${id}`}
|
||||
style={{width: 285}}
|
||||
>{name}</Button>
|
||||
<Button className={styles.categoryButton} variant="contained" href={`/categories/${id}`} style={{width: 285}}>{name}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -1913,10 +1906,7 @@ Ensuite, nous avons mis en place l'environnement serveur requis pour le déploie
|
|||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- >
|
||||
curl -f http://backend:4000/graphql?query=%7B__typename%7D
|
||||
-H 'Apollo-Require-Preflight: true'
|
||||
|| exit 1
|
||||
- "curl -f http://backend:4000/graphql?query=%7B__typename%7D -H 'Apollo-Require-Preflight: true' || exit 1"
|
||||
interval: 10s
|
||||
timeout: 30s
|
||||
retries: 5
|
||||
|
@ -2006,8 +1996,7 @@ Ensuite, nous avons mis en place l'environnement serveur requis pour le déploie
|
|||
# Caddyfile
|
||||
|
||||
1123-jaune-1.wns.wilders.dev {
|
||||
# Redirect request to production running on port 8000
|
||||
reverse_proxy localhost:8000
|
||||
# Redirect request to production running on port 8000 reverse_proxy localhost:8000
|
||||
|
||||
# log
|
||||
log {
|
||||
|
@ -2016,8 +2005,7 @@ Ensuite, nous avons mis en place l'environnement serveur requis pour le déploie
|
|||
}
|
||||
|
||||
staging.1123-jaune-1.wns.wilders.dev {
|
||||
# Redirect request to staging running on port 8001
|
||||
reverse_proxy localhost:8001
|
||||
# Redirect request to staging running on port 8001 reverse_proxy localhost:8001
|
||||
|
||||
# log
|
||||
log {
|
||||
|
@ -2026,31 +2014,29 @@ Ensuite, nous avons mis en place l'environnement serveur requis pour le déploie
|
|||
}
|
||||
|
||||
ops.1123-jaune-1.wns.wilders.dev {
|
||||
# Redirect request to webhook service running on port 9000
|
||||
reverse_proxy localhost:9000
|
||||
# Redirect request to webhook service running on port 9000 reverse_proxy localhost:9000
|
||||
# log
|
||||
log {
|
||||
output file /var/log/caddy/ops.log
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```javascript
|
||||
// webhook.conf
|
||||
[
|
||||
{
|
||||
"id": "update-staging",
|
||||
"execute-command": "/home/wns_student/apps/oros/staging/fetch-and-deploy.sh",
|
||||
"command-working-directory": "/home/wns_student/apps/oros/staging/"
|
||||
},
|
||||
{
|
||||
"id": "update-prod",
|
||||
"execute-command": "/home/wns_student/apps/oros/prod/fetch-and-deploy.sh",
|
||||
"command-working-directory": "/home/wns_student/apps/oros/prod/"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
```javascript
|
||||
// webhook.conf
|
||||
[
|
||||
{
|
||||
"id": "update-staging",
|
||||
"execute-command": "/home/wns_student/apps/oros/staging/fetch-and-deploy.sh",
|
||||
"command-working-directory": "/home/wns_student/apps/oros/staging/"
|
||||
},
|
||||
{
|
||||
"id": "update-prod",
|
||||
"execute-command": "/home/wns_student/apps/oros/prod/fetch-and-deploy.sh",
|
||||
"command-working-directory": "/home/wns_student/apps/oros/prod/"
|
||||
}
|
||||
]
|
||||
```
|
||||
\newpage
|
||||
|
||||
# Securité de l’application
|
||||
|
@ -2086,6 +2072,8 @@ La securité d’une application est extrêmement importante. On ne peut pas pen
|
|||
* Security Headers : Middleware peut ajouter des security headers HTTP aux réponse, ce qui donne une couche additionnelle de sécurité contre les attaques.
|
||||
* Gestion des Sessions : Middleware peut gérer les cookies de session secures et implemente les mesures comme expiration des cookies et secure flags pour protéder les données de session.
|
||||
|
||||
\newpage
|
||||
|
||||
# Annexe (diagramme de classe)
|
||||
|
||||
![](images/class diagram.jpg){height=95%}
|
||||
![](images/class diagram.jpg){height=99%}
|
||||
|
|
Loading…
Reference in a new issue