Giter VIP home page Giter VIP logo

stow's Introduction

stow

A Flask app to securely PUT and GET data.

This app was developed as a learning endeavor, in order to learn about Flask and various other packages in the Flask ecosystem.

In this example the following packages are used:

Getting started

Clone the repository

git clone [email protected]:rossmacarthur/stow.git && cd stow

Create a virtualenv using pyenv or similar, you will need to use Python 3.6 or later

pyenv virtualenv stow
pyenv local stow

Then inside the virtual environment install the app

make install-dev

Create the database and run all migrations

make migrate

Finally run the development server

make run

Stow will then be available at http://localhost:5001! ๐ŸŽ‰

API

To store <value> under the key <key> you must PUT to /api/stow/<key> with:

{
    "value": "some interesting secret data"
}

You can then GET from /api/stow/<key> to retrieve:

{
    "value": "some interesting secret data",
    "modified": "2018-03-10T10:25:35.576296",
    "created": "2018-03-10T10:25:35.576296"
}

Of course to do the above you need to provide authorization. You must first register a user by POST to /api/user with:

{
    "name": "John Smith",
    "password": "secret1234"
}

You can then use HTTP Basic Auth with the name and password. Or if you prefer you can request a token from /api/token and use this as the HTTP Basic Auth username (in this case the password can be left blank or set to an arbitrary value). The token will last for an hour.

License

This project is licensed under the MIT License. See the LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.