Skip to content

EIN-4955: Remove ip-client dependency#644

Open
gne wants to merge 8 commits intomainfrom
EIN-4955-fjerne-ip-sender-avhengigheit
Open

EIN-4955: Remove ip-client dependency#644
gne wants to merge 8 commits intomainfrom
EIN-4955-fjerne-ip-sender-avhengigheit

Conversation

@gne
Copy link
Copy Markdown
Collaborator

@gne gne commented Mar 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 14:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the external ip-client dependency by replacing it with an in-house Spring service for sending innsynskrav to Integrasjonspunkt, and updates the surrounding sender logic/tests accordingly. It also reduces dependency surface by centralizing SHA-256 hashing and removing JetBrains @NotNull annotations.

Changes:

  • Replace no.einnsyn.clients.ip usage with a new IntegrasjonspunktInnsynskravClient that posts the multipart request directly.
  • Update InnsynskravSenderService and affected controller/scheduler tests to use the new client signature and exceptions.
  • Introduce HashUtils and migrate SHA-256 hashing call sites away from DigestUtils/ad-hoc MessageDigest code.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/no/einnsyn/backend/entities/innsynskravbestilling/IntegrasjonspunktInnsynskravClient.java New in-house client that builds SBD JSON and sends multipart request to Integrasjonspunkt via RestTemplate.
src/test/java/no/einnsyn/backend/entities/innsynskravbestilling/IntegrasjonspunktInnsynskravClientTest.java New unit test verifying multipart request structure, headers, and SBD content.
src/main/java/no/einnsyn/backend/entities/innsynskravbestilling/InnsynskravSenderService.java Switch sender service from IPSender to new client; modernize date formatting to thread-safe formatters.
src/test/java/no/einnsyn/backend/entities/innsynskravbestilling/InnsynskravBestillingSchedulerTest.java Update mocks/verifications to new client API and NetworkException.
src/test/java/no/einnsyn/backend/entities/innsynskravbestilling/InnsynskravBestillingControllerTest.java Update mocks/verifications to new client API; replace IOUtils resource reads.
src/test/java/no/einnsyn/backend/EinnsynTestBase.java Use HashUtils for hashing API key secrets in tests.
src/main/java/no/einnsyn/backend/utils/HashUtils.java New shared SHA-256 hex helper to reduce dependencies and duplication.
src/main/java/no/einnsyn/backend/entities/apikey/ApiKeyService.java Migrate API key hashing to HashUtils.
src/main/java/no/einnsyn/backend/common/search/SearchService.java Migrate query hashing to HashUtils and keep fallback behavior.
src/main/java/no/einnsyn/backend/error/EInnsynExceptionHandler.java Replace JetBrains @NotNull import with Jakarta validation annotation.
src/main/java/no/einnsyn/backend/entities/base/BaseRepository.java Replace JetBrains @NotNull import with Jakarta validation annotation.
src/main/java/no/einnsyn/backend/EinnsynControllerTestBase.java Update mocked sender type to IntegrasjonspunktInnsynskravClient.
src/main/java/no/einnsyn/backend/configuration/IntegrasjonspunktConfiguration.java Remove configuration that existed only to support ip-client’s ApiClient.
pom.xml Remove ip-client dependency and related build plugin execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 26, 2026

Pull Request Test Coverage Report for Build 23647875241

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 18 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.1%) to 85.263%

Files with Coverage Reduction New Missed Lines %
no/einnsyn/backend/entities/innsynskravbestilling/InnsynskravSenderService.java 7 92.22%
no/einnsyn/backend/common/search/SearchService.java 11 88.16%
Totals Coverage Status
Change from base Build 23586825993: 0.1%
Covered Lines: 7983
Relevant Lines: 8907

💛 - Coveralls

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants