This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [flake8] | |
| exclude = | |
| *migrations*, | |
| __pycache__, | |
| .pytest_cache, | |
| venv, | |
| .env, | |
| .git*, | |
| pytest*, | |
| requirements*, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MASTER] | |
| # A comma-separated list of package or module names from where C extensions may | |
| # be loaded. Extensions are loading into the active Python interpreter and may | |
| # run arbitrary code. | |
| extension-pkg-whitelist= | |
| # Add files or directories to the blacklist. They should be base names, not | |
| # paths. | |
| ignore=CVS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [pytest] | |
| minversion = 6.0 | |
| addopts = -ra -q | |
| testpaths = | |
| tests/unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """This module sets up the fixtures that will be used in our testing.""" | |
| import pytest | |
| from API import app | |
| @pytest.fixture | |
| def client(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """This module contains initialization code for the API package.""" | |
| from dotenv import load_dotenv | |
| from flask import Flask | |
| load_dotenv() | |
| app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """This module creates the routes for our API.""" | |
| from API import app | |
| @app.route('/index', methods=['GET']) | |
| @app.route('/', methods=['GET']) | |
| def index() -> dict: | |
| """Handle get requests to /index route. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @app.route('/home', methods=['GET']) | |
| def home() -> str: | |
| """Provide the user with the option to register with GitHub.""" | |
| return render_template('index.html', client_id=app.config['CLIENT_ID']), 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """This module contain the confuguration for the application.""" | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| class BaseConfig(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- templates/index.html --> | |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Github OAuth</title> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <!-- load bulma css --> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- load fontawesome --> | |
| <style> | |
| body { padding-top:70px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """This module creates the routes for our API.""" | |
| from flask import render_template, request | |
| from API import app | |
| from API.helpers import get_access_token, get_user_data | |
| @app.route('/index', methods=['GET']) |