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(admin): validating bpn before adding to companyUser #902

Merged
merged 10 commits into from
Sep 11, 2024

Conversation

Phil91
Copy link
Member

@Phil91 Phil91 commented Aug 6, 2024

Description

validating bpn before adding to companyUser

Why

Added validation for BPN before adding to it companyUser

Issue

Refs : #901

Corresponding Portal PR

eclipse-tractusx/portal#426

Checklist

  • I have followed the contributing guidelines
  • I have performed IP checks for added or updated 3rd party libraries
  • I have created and linked IP issues or requested their creation by a committer
  • I have performed a self-review of my own code
  • I have successfully tested my changes locally
  • I have added tests that prove my changes work
  • I have checked that new and existing tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

@Phil91 Phil91 marked this pull request as draft August 6, 2024 11:39
@Phil91 Phil91 force-pushed the feature/CPLP-3639-bpnCheck branch 2 times, most recently from d0ea516 to 7b79f70 Compare August 6, 2024 13:39
@Phil91 Phil91 marked this pull request as ready for review August 6, 2024 14:03
@ntruchsess ntruchsess force-pushed the feature/CPLP-3639-bpnCheck branch 2 times, most recently from 4105609 to 32399ec Compare August 13, 2024 16:25
src/externalsystems/Bpdm.Library/BpnAccess.cs Outdated Show resolved Hide resolved
{
private readonly HttpClient _httpClient;
private readonly HttpClient _httpClient = httpFactory.CreateClient(nameof(BpnAccess));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether storing a reference to a factory-generated http-client in a member is advisable. According to https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines (section recommendet use httpclient-instances that were created by IHttpClientFactory should be short-lived objects. As http-client also implements IDisposable creating a new instance within FetchLegalEntityByBpn using the 'using'-keyword to dispose when it goes out of scope should be the correct way.

Copy link
Member Author

Choose a reason for hiding this comment

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

adjusted.

Copy link
Contributor

@evegufy evegufy left a comment

Choose a reason for hiding this comment

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

image

@evegufy evegufy added this to the Release 24.12 milestone Aug 14, 2024
@Phil91
Copy link
Member Author

Phil91 commented Aug 14, 2024

image

fixed

ntruchsess
ntruchsess previously approved these changes Sep 10, 2024
Copy link

sonarcloud bot commented Sep 11, 2024

@Phil91 Phil91 merged commit c9f32b2 into main Sep 11, 2024
11 checks passed
@Phil91 Phil91 deleted the feature/CPLP-3639-bpnCheck branch September 11, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: USER READY
Development

Successfully merging this pull request may close these issues.

4 participants