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

Add EUA to keep gateway clean #40

Open
nithindv opened this issue Jun 15, 2021 · 0 comments
Open

Add EUA to keep gateway clean #40

nithindv opened this issue Jun 15, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nithindv
Copy link
Contributor

nithindv commented Jun 15, 2021

EUA to assist EkSaath / Stepone integrate with Gateway

Env Vars:

  • JWT_SECRET
  • DOMAIN
  • GATEWAY_DOMAIN

Middlewares

Auth middleware - Validate JWT - ensure signature valid, and not expired - ref,

verify(type: string, token: string) {

export const isAuthenticated = (req: Request, res: Response, next: NextFunction) => {

  1. In /search/service,
    • Forward the received token as is to the gateway
    • Authenticate with the gateway via username password and login
  2. In on_update/service
    • Validate the received authToken via configured JKS public key; allowed auth methods are RSA256, ex jwt.verify(token, publickey, { algorithms: ["RSA256"] });

Endpoints:

v1/on_update/service - Log request and respond with 200 for now
v1/search/service - Construct gateway URL from env var and move logic from gateway middleware - ref, https://github.com/Swasth-Digital-Health-Foundation/C19CareAssist/blob/feature/middleware-for-search-api/gateway/src/middleware/doctorConfirmation.ts

Deployment

Add dockerfile and ensure docker build works as expected - ref, https://github.com/Swasth-Digital-Health-Foundation/C19CareAssist/blob/main/o2-provider/Dockerfile

@yath-tw
@rameez25

@nithindv nithindv added the enhancement New feature or request label Jun 15, 2021
@nithindv nithindv assigned ghost Jun 15, 2021
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

1 participant