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

[IOCOM-1178] FIMS OIdC flow #360

Merged
merged 39 commits into from
Jul 31, 2024
Merged

[IOCOM-1178] FIMS OIdC flow #360

merged 39 commits into from
Jul 31, 2024

Conversation

Vangaorth
Copy link
Contributor

@Vangaorth Vangaorth commented Apr 8, 2024

Short description

This PR adds a fake OIdC flow for FIMS, with both Relying Party and Provider support.

List of changes proposed in this pull request

  • relyingParty router that:
    • redirects to provider
    • handles the redirection router, checking for mandatory parameters (like nonce, state and lollipop-headers presence)
    • decodes and shows the signed idToken to display fake citizen informations
  • provider router that:
    • handles the OIdC flows, with proper and mandatory parameters
    • supports both Authorisation Code flow and Implicit Code Flow, like the real provider
    • sets and validates cookies, like the real provider (even the FIMS authorizasion cookie)
    • signs and generate the idToken
    • simulates the Fast Login expiration
  • history endpoint that generates and handles a fake paginated access history and simulates its export

All of the above is configurable with the config.ts file

How to test

Start the dev-server and type http://localhost:3000/fims/relyingParty/1/landingPage in your web-browser (or use something like cUrl to follow such link)

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 16.38796% with 500 lines in your changes missing coverage. Please review.

Project coverage is 64.37%. Comparing base (3a9aef1) to head (6c77821).
Report is 1 commits behind head on master.

Files Patch % Lines
src/features/fims/routers/providerRouter.ts 7.24% 231 Missing and 38 partials ⚠️
src/features/fims/routers/relyingPartyRouter.ts 14.40% 89 Missing and 12 partials ⚠️
src/features/fims/services/relyingPartyService.ts 13.23% 55 Missing and 4 partials ⚠️
src/features/fims/services/historyService.ts 16.66% 25 Missing and 5 partials ⚠️
src/features/fims/routers/historyRouter.ts 29.26% 24 Missing and 5 partials ⚠️
src/features/fims/services/providerService.ts 37.50% 9 Missing and 1 partial ⚠️
src/features/fims/services/configurationService.ts 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
- Coverage   69.63%   64.37%   -5.26%     
==========================================
  Files         159      167       +8     
  Lines        5068     5334     +266     
  Branches      616      725     +109     
==========================================
- Hits         3529     3434      -95     
- Misses       1459     1762     +303     
- Partials       80      138      +58     
Files Coverage Δ
src/config.ts 96.29% <100.00%> (+0.14%) ⬆️
src/features/fims/types/config.ts 100.00% <100.00%> (ø)
src/payloads/backend.ts 100.00% <100.00%> (ø)
src/payloads/session.ts 100.00% <100.00%> (ø)
src/persistence/sessionInfo.ts 73.91% <100.00%> (+0.57%) ⬆️
src/populate-persistence.ts 79.13% <ø> (-4.58%) ⬇️
src/server.ts 100.00% <100.00%> (ø)
src/types/config.ts 100.00% <100.00%> (ø)
src/types/httpResponseCode.ts 100.00% <100.00%> (ø)
src/utils/variables.ts 100.00% <100.00%> (ø)
... and 7 more

... and 88 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e981b8...6c77821. Read the comment docs.

Nuisance relying party cookie
RP Cookie
@Vangaorth Vangaorth marked this pull request as ready for review July 31, 2024 13:51
@Vangaorth Vangaorth requested a review from a team as a code owner July 31, 2024 13:51
@Vangaorth Vangaorth changed the title [IOCOM-1178] FIMS fake OIdC flow [IOCOM-1178] FIMS OIdC flow Jul 31, 2024
Copy link
Contributor

@forrest57 forrest57 left a comment

Choose a reason for hiding this comment

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

LGTM

@Vangaorth Vangaorth merged commit 8224e50 into master Jul 31, 2024
8 checks passed
@Vangaorth Vangaorth deleted the feature/fims branch July 31, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants