Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[!Note] For English, scroll below the French part

Fake-vestalis (FR)

Objectifs

Ce repository a deux objectifs principaux:

  • Permettre de tester eo-connect en avance de phase des développements par Vestalis (branche testing)
  • Servir d'implémentation de référence pour Vestalis (branche main)

Prérequis

Rust

Ce code a été écrit en rust 1.69.0 et doit donc être installé soit manuellement via rustup, soit via nix en utilisant le fichier shell.nix fournit.

Variables d'environnement

Trois variables d'environnement doivent être présente pour pouvoir lancer le serveur :

  • SIGNATURE_KEY doit contenir le chemin vers la clé privée utilisé pour la signature.
  • CIPHER_KEY doit contenir la clé de chiffrement partagée entre Eove et Vestalis.
  • CONNECT_NAME doit contenir le nom du serveur eo-connect à utiliser.

Le fichier secrets.nix.template donne les valeurs à utiliser en cas d'utilisation locale et peut être copié en secrets.nix pour être chargé automatiquement par nix.

Génération des secrets

Pour une utilisation standard (en local), des secrets ont été commités, ainsi aucune génération n'est nécessaire. Les scripts de génération sont toute fois documentés à toute fin utiles.

Clé de signature

Les clés de signature ed25519 peuvent être générées via :

bash ./scripts/generate-ed25519.sh

Elles seront alors disponible dans security/keys.

Certificat ssl pour https

La communication avec le serveur est sécurisée via HTTPS. Il faut donc créer une authorité et un certificat pour le serveur. La commande :

bash ./scripts/generate-ca.sh

Crée une autorité dans le dossier security/ca. Le mot de passe de l'autorité commité est iMe*Fa$YJ3$E%^psDUMQA9Swc2AT8q

La commande :

bash ./scripts/generate-server-certificate.sh

Crée un certificat pour le serveur pour qu'il tourne sur localhost dans le dossier security/server. Si le nom de domaine souhaité est différent, alors il faut créer un fichier .ext en s'inspirant de scripts/vestalis.ext et renseigner la variable d'environnement SERVER_CERTIFICATE_EXTENSION_PATH pour contenir le chemin vers ce fichier. La commande précédent créera alors un certificat adapté.

Enfin, si le certificat et/ou l'autorité ne sont pas crées dans les dossiers mentionnés, alors il faudra mettre à jour le fichier Rocket.toml en fonction.

Lancer le server

Pour lancer le serveur, lancer la commande suivante :

cargo run

Le serveur sera alors accessible sur le port 8042.

Lancer les tests

L'exemple décrit par les spécifications a été implémenté en tant que test. Le test peut être lancé via :

cargo test

Fake-vestalis (EN)

Aims

This repository has two main aims:

  • Allows to test eo-connect in early phases of development (testing branch)
  • Serves as an implementation reference (main branch)

Prerequisites

Rust

This code was written using Rust 1.69.0 and must therefore be installed manually using rustup, or with nix using the shell.nix file.

Environment variables

Three environment variables must be available to launch the server:

  • SIGNATURE_KEY must contain the path to the private key used for the signature.
  • CIPHER_KEY must contain the shared cipher (agreed upon between Eove and the partner).
  • CONNECT_NAME must contain the name of the eo-connect server to use.

The secrets.nix.template gives the values to use locally and can be duplicated as secrets.nix to be loaded automatically by nix.

Secret generation

For a standard usage (locally), some secrets were committed, that way no generation is necessary. The generation scripts are still documented below to ease any development.

Signature key

The ed25519 signature keys can be generated using:

bash ./scripts/generate-ed25519.sh

They will then be available in security/keys.

SSL certificates for HTTPS

The communication with the server goes over HTTPS. It's therefore necessary to create a certificate authority and a certificate for the server:

bash ./scripts/generate-ca.sh

This creates the certificate authority in the folder security/ca. The password of the committed authority is iMe*Fa$YJ3$E%^psDUMQA9Swc2AT8q

Then generate the certificate using:

bash ./scripts/generate-server-certificate.sh

This creates a certificate for a localhost server, it is available in security/server. If the desired domain name is different, an .ext file must be created, using scripts/vestalis.ext as an example, and providing the environment variable SERVER_CERTIFICATE_EXTENSION_PATH containing the path to this file. The previous command will generate the correct certificate.

Finally, if the certificate and/or authority are not created in the aforementioned folders, then the Rocket.toml file must be updated with the correct values.

Launch server

To launch the server, using the following command:

cargo run

The server will then be available on the port 8042.

Launch tests

The example described in the specifications was implemented as a test in this project. It can be launched using:

cargo test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages