Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Fix/813 #829

Merged
merged 16 commits into from
Apr 21, 2021
Merged

Fix/813 #829

merged 16 commits into from
Apr 21, 2021

Conversation

victorperezc
Copy link
Contributor

@victorperezc victorperezc commented Mar 31, 2021

Description

Fixing Bugs in Issue #813 #803 .

The global middleware is like a barrier between the actual endpoints logic and the wgsi application. It executes some logic in the middle and decides whether continue with the user request or throw an error. In this case, checks whether there exists an Initial Setup configured to continue with the user request. Otherwise, if the request is done on another resource other than POST /setup he is not allowed to access and the app raises 401 Not Allowed. This way the app is like 'sleeping' until it's configured through POST /setup and all other api calls are blocked

Flow and expected behaviour

  1. Spin up a domain.
  2. Call any API endpoint except POST /setup. You should get 401 and the following message "error": "This app is in sleep mode. Please undergo the initial setup first"
  3. Call POST /setup to configure the domain and create the owner account. Once you get a 200, the domain has been successfully configured. For your request to go through you'd need to add the setup verification token 9G9MJ06OQH via POST parameters. For now, this is hardcoded in the environment for development purposes.
POST /setup
{
    "email": "owner@openmined.org",
    "password": "12345",
    "domain_name": "Openmined",
    "token":"9G9MJ06OQH"
}

How has this been tested?

Locally tested

Checklist

@victorperezc victorperezc changed the base branch from pygrid_0.4.0 to dev April 19, 2021 13:52
@victorperezc victorperezc self-assigned this Apr 19, 2021
@victorperezc victorperezc added the Status: In Progress 🌟 This is actively being worked on label Apr 19, 2021
Copy link
Member

@IonesioJunior IonesioJunior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @victorperezc!

@IonesioJunior IonesioJunior merged commit aaa1b99 into dev Apr 21, 2021
@IonesioJunior IonesioJunior deleted the fix/813 branch April 21, 2021 12:18
AmrMKayid added a commit that referenced this pull request Apr 23, 2021
* dev:
  Minor improvements
  Update dataset creation return to follow get/get_all pattern
  Update README.md
  Update /setup unit tests
  Minor fixes
  minor fixes
  Datasets refactory (#839)
  Fix/813 (#829)
  Update pre-commit to include checks of documentation (#834)
  Remove outdated notebook examples
  Update readme example (#837)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: In Progress 🌟 This is actively being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants