Giter Site home page Giter Site logo

wikimedia / tool-my-first-flask-oauth-tool Goto Github PK

View Code? Open in Web Editor NEW
1.0 13.0 0.0 26 KB

Mirror of https://phabricator.wikimedia.org/source/tool-my-first-flask-oauth-tool/

License: GNU General Public License v3.0

Python 41.26% CSS 0.32% HTML 58.41%
tool-labs tutorial oauth python3 flask

tool-my-first-flask-oauth-tool's Introduction

My first Flask OAuth tool

This git repository contains the source code for a basic Python webservice built using the Flask framework. It shows how to use the mwoath library to manage OAuth authentication with a MediaWiki server.

Deploy on Toolforge

See https://wikitech.wikimedia.org/wiki/Help:Toolforge/My_first_Flask_OAuth_tool for a detailed tutorial describing the full process of creating a tool account and running this tool.

$ ssh login.toolforge.org
$ become $TOOL_NAME
$ cat > $HOME/service.template << EOF
backend: kubernetes
type: python3.7
canonical: true
EOF
$ mkdir -p $HOME/www/python
$ git clone https://phabricator.wikimedia.org/source/tool-my-first-flask-oauth-tool.git \
  $HOME/www/python/src
$ touch $HOME/www/python/src/config.yaml
$ chmod u=rw,go= $HOME/www/python/src/config.yaml
$ cat > $HOME/www/python/src/config.yaml << EOF
SESSION_COOKIE_PATH: /$TOOL_NAME
SECRET_KEY: $(python -c "import os; print repr(os.urandom(24))")
CONSUMER_KEY: $KEY_YOU_GOT_FROM_OAUTH_REGISTRATION
CONSUMER_SECRET: $SECRET_YOU_GOT_FROM_OAUTH_REGISTRATION
EOF
$ webservice shell
$ python3 -m venv $HOME/www/python/venv
$ source $HOME/www/python/venv/bin/activate
$ pip install --upgrade pip
$ pip install -r $HOME/www/python/src/requirements.txt
$ exit
$ webservice start

License

GNU GPLv3+

tool-my-first-flask-oauth-tool's People

Contributors

bd808 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.