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

[IDM-161] - feat: IAM Middleware #582

Closed
wants to merge 56 commits into from
Closed

Conversation

kiremitrov123
Copy link
Collaborator

Description

This PR sets up the initial project structure for the Access Bridge service.
A service that facilitates seamless communication between SIMS (Subscriber Identity Management System) and Access Control services. It provides endpoints to generate and refresh access passports for authenticated viewers, ensuring secure and efficient access management.

Create Initial Project Structure

  • Set up the project structure following the service and controller patterns.
  • Installed necessary dependencies and added the required configurations.

Generate Passport

  • Implemented the endpoint to generate a new passport.
  • Created the corresponding controller and service logic.

Refresh Passport

  • Implemented the endpoint to refresh an existing passport, generating a new expiry and refresh token.
  • Created the corresponding controller and service logic.

Add Tests

  • Added unit tests for the small functionalities as well as util helper functions.
  • Added integration tests for the generate passport and refresh passport functionalities to ensure proper behavior and stability.

Design document: AC - Sims Integration

Related Jira cards:

Note:
There will be follow up PRs related to this one, that will include the Stripe logic needed for fetching Stripe products metadata, as well as payment initiation.

Steps completed:

According to our definition of done, I have completed the following steps:

  • Acceptance criteria met
  • Unit tests added
  • Docs updated (including config and env variables)
  • Translations added
  • UX tested
  • Browsers / platforms tested
  • Rebased & ready to merge without conflicts
  • Reviewed own code

Copy link

github-actions bot commented Jul 22, 2024

Visit the preview URL for this PR (updated for commit 72a186a):

https://ottwebapp--pr582-idm-161-iam-middlewa-to3b0v49.web.app

(expires Sat, 12 Oct 2024 12:24:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529

@ChristiaanScheermeijer
Copy link
Collaborator

Nice PR @kiremitrov123! I haven't looked much into what is needed, but I assume this middleware is needed for the frontend. Just in case, are you really sure that we can't fetch the offers from the public Stripe APIs?

Perhaps we can discuss the following here:

  • Should we use a lightweight HTTP framework (https://fastify.dev/)?
  • Should we consider this a platform or create a new packages folder called api or backend?
  • Should we use Inversify to make it easier to replace the Stripe services with a different integration?

I will review the code more thoroughly soon 😄

@kiremitrov123
Copy link
Collaborator Author

Nice PR @kiremitrov123! I haven't looked much into what is needed, but I assume this middleware is needed for the frontend. Just in case, are you really sure that we can't fetch the offers from the public Stripe APIs?

Perhaps we can discuss the following here:

  • Should we use a lightweight HTTP framework (https://fastify.dev/)?
  • Should we consider this a platform or create a new packages folder called api or backend?
  • Should we use Inversify to make it easier to replace the Stripe services with a different integration?

I will review the code more thoroughly soon 😄

@ChristiaanScheermeijer thanks for the input!

Yes, right! This middleware (access-bridge) will be used by the frontend to connect with both the SIMS and Access Control systems. It will generate/refresh passports, list Stripe products, and handle Stripe checkout sessions.

Key Points:

  1. Stripe Products and Checkout Sessions: Accessing Stripe products requires a secret key, as detailed here. The secret key is also necessary for Stripe checkout sessions, which will be addressed in a subsequent PR.
  2. Framework Usage: While I initially aimed to keep it simple with minimal libraries, I’m open to using a framework if the team agrees.
  3. Platform vs. Package: After discussing with @dbudzins, it seems more logical to treat this as a platform, given that it will need to be deployed on Firebase alongside the web (as a POC), otherwise, it will serve as a starting point for the customers, where they can either just replace keys and host it somewhere on their side or add additional logic as they require. Feels more like a platform than a package I guess 😄 .
  4. Integration and Replaceability: The goal is not to make Stripe replaceable but to add more integrations as needed. However, if it makes sense, we can consider making it more flexible. 😄

Copy link
Contributor

@dbudzins dbudzins left a comment

Choose a reason for hiding this comment

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

A few small comments on the latest, but nothing blocking or that's not an easy fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants