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

feat(auth-api): Adding legal representative #16161

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Conversation

saevarma
Copy link
Member

What

Adding legal representative type to production

Why

We need to get this to production before 1st of October due to the termination of the old authentication service.

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

saevarma and others added 2 commits September 26, 2024 10:07
* Use syslumenn api to verify delegation.

* Fix api error case.

* Fix config.

* chore: nx format:write update dirty files

* Handle error in api.

* Fix typo in name.

* Refactor mock.

* Update infra.

* Update host in infra.

* Add syslumenn infra to other auth apis.

* Also return empty array if error.

* Use post.

* Fix tests.

* Single delegation type.

* Remove infra config from pr public.

* Fix type.

* Refactor error handling in check for scopes.

* Openapi fix.

* Refactor verification error handling.

* Fix status code.

* Decrease syslumenn api timeout to 3s.

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: Valur Einarsson <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@saevarma saevarma requested review from a team as code owners September 26, 2024 10:10
Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@saevarma saevarma removed the request for review from throsturg77 September 26, 2024 10:10
#16069)

* Add missing translation for legal representation delegation type in IDS Admin

* Refactor delegation type filtering from client and scope creation to account for LegalRepresentative as superuser only.

* Update patch super user delegation type check.
Add tests.

* Handle legal representative in scope patch.
Add tests.

* Hide it from the UI.

* Fix duplicated message id

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
valurefugl
valurefugl previously approved these changes Sep 26, 2024
GunnlaugurG
GunnlaugurG previously approved these changes Sep 26, 2024
Copy link
Member

@GunnlaugurG GunnlaugurG left a comment

Choose a reason for hiding this comment

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

🚀

@saevarma saevarma added the automerge Merge this PR as soon as all checks pass label Sep 26, 2024
lodmfjord
lodmfjord previously approved these changes Sep 26, 2024
Copy link
Member

@lodmfjord lodmfjord left a comment

Choose a reason for hiding this comment

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

lgtm

@andes-it andes-it dismissed stale reviews from lodmfjord, GunnlaugurG, and valurefugl via c05f966 September 26, 2024 10:24
@datadog-island-is
Copy link

datadog-island-is bot commented Sep 26, 2024

Datadog Report

All test runs a0f2ba2 🔗

18 Total Test Services: 0 Failed, 18 Passed
🔻 Test Sessions change in coverage: 6 decreased, 8 increased, 24 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.58s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 11.77s 1 increased (+1.06%) Link
api-domains-mortgage-certificate 0 0 0 5 0 16.56s 1 no change Link
application-api-files 0 0 0 12 0 6.22s 1 decreased (-0.05%) Link
application-system-api 0 0 0 111 2 3m 4.96s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 55.99s 1 decreased (-0.15%) Link
application-ui-shell 0 0 0 74 0 36.25s 1 increased (+0.6%) Link
auth-api-lib 0 0 0 20 0 33.52s 1 no change Link
clients-syslumenn 0 0 0 27 0 15.29s 1 no change Link
portals-admin-ids-admin 0 0 0 2 0 7.74s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (6)

This report shows up to 5 code coverage decreases.

  • services-auth-admin-api - jest 46.45% (-0.91%) - Details
  • application-template-api-modules - jest 25.56% (-0.15%) - Details
  • services-auth-ids-api - jest 44.87% (-0.13%) - Details
  • services-auth-public-api - jest 45.74% (-0.12%) - Details
  • application-api-files - jest 61.42% (-0.05%) - Details

@GunnlaugurG GunnlaugurG self-requested a review September 26, 2024 10:28
Copy link
Member

@GunnlaugurG GunnlaugurG left a comment

Choose a reason for hiding this comment

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

🚀

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 91.42857% with 12 lines in your changes missing coverage. Please review.

Project coverage is 36.76%. Comparing base (3d4afbb) to head (c05f966).
Report is 1 commits behind head on release/31.3.0.

Files with missing lines Patch % Lines
...ients/syslumenn/src/lib/syslumennClient.service.ts 46.15% 7 Missing ⚠️
...ib/src/lib/delegations/delegation-scope.service.ts 77.77% 4 Missing ⚠️
...rc/lib/delegations/delegations-incoming.service.ts 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           release/31.3.0   #16161      +/-   ##
==================================================
+ Coverage           36.74%   36.76%   +0.02%     
==================================================
  Files                6736     6739       +3     
  Lines              138206   138277      +71     
  Branches            39279    39291      +12     
==================================================
+ Hits                50783    50843      +60     
- Misses              87423    87434      +11     
Flag Coverage Δ
api 3.39% <ø> (ø)
api-domains-auth-admin 49.89% <ø> (ø)
api-domains-mortgage-certificate 35.64% <46.15%> (-0.09%) ⬇️
application-api-files 57.54% <ø> (ø)
application-system-api 41.66% <46.15%> (-0.01%) ⬇️
application-template-api-modules 23.44% <46.15%> (-0.03%) ⬇️
application-templates-estate 12.57% <ø> (ø)
application-templates-inheritance-report 6.45% <ø> (ø)
application-ui-shell 21.75% <ø> (ø)
clients-syslumenn 49.62% <46.15%> (-0.14%) ⬇️
services-auth-admin-api 50.53% <70.58%> (-2.34%) ⬇️
services-auth-delegation-api 58.17% <54.73%> (-3.21%) ⬇️
services-auth-ids-api 51.88% <77.87%> (-2.14%) ⬇️
services-auth-personal-representative 45.76% <59.04%> (-2.23%) ⬇️
services-auth-personal-representative-public 41.83% <53.76%> (-2.04%) ⬇️
services-auth-public-api 49.23% <55.67%> (-2.58%) ⬇️
services-user-notification 47.62% <ø> (ø)
services-user-profile 62.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apps/services/auth/admin-api/src/app/app.module.ts 100.00% <100.00%> (ø)
...services/auth/delegation-api/src/app/app.module.ts 100.00% <100.00%> (ø)
apps/services/auth/ids-api/src/app/app.module.ts 100.00% <100.00%> (ø)
.../delegations/delegation-verification-result.dto.ts 100.00% <100.00%> (ø)
...src/app/delegations/delegation-verification.dto.ts 100.00% <100.00%> (ø)
...-api/src/app/delegations/delegations.controller.ts 82.50% <100.00%> (+4.37%) ⬆️
...auth/personal-representative/src/app/app.module.ts 100.00% <100.00%> (ø)
...pps/services/auth/public-api/src/app/app.module.ts 100.00% <100.00%> (ø)
libs/auth-api-lib/src/index.ts 100.00% <100.00%> (ø)
...lib/src/lib/clients/admin/admin-clients.service.ts 86.86% <100.00%> (+0.84%) ⬆️
... and 11 more

... and 2 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 3d4afbb...c05f966. Read the comment docs.

@kodiakhq kodiakhq bot merged commit d6f7986 into release/31.3.0 Sep 26, 2024
62 checks passed
@kodiakhq kodiakhq bot deleted the hotfix/legal-rep branch September 26, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants