Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sala 2 #19

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions privacy-vault/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Sala 2

# Ejercicio grupal: Data Privacy Vault

_Tiempo: 30 minutos_
Expand Down Expand Up @@ -39,3 +41,10 @@ Tareas extra a explorar si hay tiempo una vez habéis realizado el PR funcional:
- Interfaz gráfica que permita tanto copiar el mensaje anonimizado directamente al portapapeles para pegarlo directamente en el LLM, como copiar el contenido del LLM con tokens para de-anonimizar directamente y obtener el contenido final


# Como ejecutar la api en entorno local

- primero instalar [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- entrar en la carpeta `app`
- ejecutar `npm install`
- ejecutar `npm start`
- tirar los comandos cURL presentados anteriormente
34 changes: 34 additions & 0 deletions privacy-vault/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const express = require('express');
const bodyParser = require('body-parser');

const app = express();
const PORT = 3000;

// Middleware to parse JSON bodies
app.use(bodyParser.json());

// Endpoint to anonymize data
app.post('/anonymize', (req, res) => {
// Perform anonymization logic here
// For demonstration purposes, let's just echo back the received data
const { message } = req.body; // Extracting the 'message' attribute from the request body
const textToBeAnonymized = message; // Assigning the 'message' to the 'textToBeAnonymized' variable

console.log(`text to be anonymized: ${textToBeAnonymized}`)

res.json({ anonymizedMessage: textToBeAnonymized });
});

// Endpoint to deanonymize data
app.post('/deanonymize', (req, res) => {
const { message } = req.body; // Extracting the 'message' attribute from the request body
const textToBeDeanonymized = message; // Assigning the 'message' to the 'textToBeAnonymized' variable
// Perform deanonymization logic here
// For demonstration purposes, let's just echo back the received data
res.json({ originalMessage: textToBeDeanonymized });
});

// Start the server
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
Loading