Skip to content

namanv3/Secure-DataStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Data Store

Environment Setup

Before starting the application, make sure you have a connection to a mongodb server.
For example, it can present on localhost on port number 27017. Add two system environment variables:

export MONGODB_HOST=localhost
export MONGODB_PORT=27017

The code uses these environment variables to get credentials for connecting to the MongoDB server.

Usage

Make sure you have Java version 11 or more, and Maven installed.
Use Maven to build the project:

mvn install

Following this, you can run it as follows:

mvn exec:java

This will start the Java Spark server, which listens on localhost at port 4567.
To add a user, we can use the provided python script as follows:

python3 sendGetandPostRequest.py 1 <username> <password>

The 1 is a token which means that a user has to be added. Say we add a user as follows:

python3 sendGetandPostRequest.py 1 namanv3 badPassword

Now, we can login with the same credentials as follows:

python3 2 namanv3 badPassword

Follow the instructions to add files, and retreive them too.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages