Coder Social home page Coder Social logo

directory-api's Introduction

directory-api

code-climate-image circle-ci-image codecov-image gitflow-image calver-image

GREAT platform API


Development

Installing

$ git clone https://github.com/uktrade/directory-api
$ cd directory-api
$ virtualenv .venv -p Python3.9.2
$ source .venv/bin/activate
$ make install_requirements

Requirements

Configuration

Secrets such as API keys and environment specific configurations are placed in conf/env/secrets-do-not-commit - a file that is not added to version control. To create a template secrets file with dummy values run make secrets.

Commands

Command Description
make clean Delete pyc files
make pytest Run all tests
make pytest test_foo.py Run all tests in file called test_foo.py
make pytest -- --last-failed` Run the last tests to fail
make pytest -- -k foo Run the test called foo
make pytest -- Run arbitrary pytest command
make manage Run arbitrary management command
make webserver Run the development web server
make requirements Compile the requirements file
make install_requirements Installed the compile requirements file
make css Compile scss to css
make secrets Create your secret env var file
make worker Run the celery worker
make beat Run the celery beat scheduler
make checks Run isort, black and flake8 in check-only mode
make autoformat Run isort, black and flake8 in update-files mode

SSO

To make sso work locally add the following to your machine's /etc/hosts:

IP Adress URL
127.0.0.1 buyer.trade.great
127.0.0.1 supplier.trade.great
127.0.0.1 sso.trade.great
127.0.0.1 api.trade.great
127.0.0.1 profile.trade.great
127.0.0.1 exred.trade.great

Then log into directory-sso via sso.trade.great:8004

Note in production, the directory-sso session cookie is shared with all subdomains that are on the same parent domain as directory-sso. However in development we cannot share cookies between subdomains using localhost - that would be like trying to set a cookie for .com, which is not supported by any RFC.

Therefore to make cookie sharing work in development we need the apps to be running on subdomains. Some stipulations:

  • directory-ui-supplier and directory-sso must both be running on sibling subdomains (with same parent domain)
  • directory-sso must be told to target cookies at the parent domain.

Linux setup

Linux (Fedora 27) instructions are available here

Helpful links

Related projects:

https://github.com/uktrade?q=directory https://github.com/uktrade?q=great

directory-api's People

Contributors

agiamas avatar bobby-didcoding avatar bobmeredith avatar bsabhilash avatar davidu1975 avatar dependabot[bot] avatar depsiatwal avatar eadpearce avatar ecbm avatar ejayesh avatar froddd avatar gauravdott avatar hal274 avatar konradko avatar kowalcj0 avatar luptonm avatar mforner13 avatar michalc avatar monikasulik avatar rafa-garcia avatar richtier avatar sdonk avatar seijihg avatar stevenburnell-dit avatar timothypatterson avatar toe703 avatar tommacca avatar tomstevens9 avatar webbyfox avatar willtaylor22 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.