Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backend] Ground Truth Integration #16

Open
dli357 opened this issue Oct 1, 2019 · 0 comments
Open

[Backend] Ground Truth Integration #16

dli357 opened this issue Oct 1, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dli357
Copy link
Collaborator

dli357 commented Oct 1, 2019

Endpoints to modify

Endpoint Description Request Type Input Output
/user THIS MUST BE DELETED. PUT {email: <string>, password: <string>, sponsorName: <string>, apiKey: <string>} {status: <int>, message: <string>}
/user/login Login - must take the ground truth token, verify it, retrieve user details (email probably), and add a new user if necessary. POST {ground_truth_token: <string>} {jwt: <string>, sponsor_name: <string>, logo_url: <string>}

Endpoints to add

Endpoint Description Request Type Input Output
/user/sponsor/set Sets the sponsor for the current user (must be authenticated) POST {sponsor_token: <256-bit hex string>} {status: <int>, message: <string>}

The middleware should verify that the user has a valid sponsor set when visiting particular authenticated pages. This can be changed in verify.ts. If the JWT authenticates but does not have a sponsor, return a 403 forbidden. NOTE: the user/sponsor/set endpoint cannot go through the middleware in this case because it must allow the user without a sponsor to access it.

Finally, the following database schemas for Sportal must also be changed:

sponsor: {
  name text PRIMARY KEY,
  sponsor_key text NOT NULL,
  logo_url text NOT NULL
}
user: {
  ground_truth_id PRIMARY KEY,
  email TEXT UNIQUE NOT NULL,
  sponsor_name TEXT REFERENCES sponsor(name)
}
@dli357 dli357 added the enhancement New feature or request label Oct 1, 2019
@dli357 dli357 changed the title Ground Truth Integration [Backend] Ground Truth Integration Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants