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

refactor: Prevent illegal updates with KnoraUserService #3098

Merged
merged 8 commits into from
Mar 6, 2024

Conversation

seakayone
Copy link
Collaborator

@seakayone seakayone commented Mar 6, 2024

  • Make UserChangeRequest private
  • Expose use cases like updating SystemAdmin and UserStatus with dedicated methods

Pull Request Checklist

Task Description/Number

Issue Number: DEV-

PR Type

  • build/chore: maintenance tasks (no production code change)
  • docs: documentation changes (no production code change)
  • feat: represents new features
  • fix: represents bug fixes
  • perf: performance improvements
  • refactor: represents production code refactoring
  • test: adding or refactoring tests (no production code change)

Basic requirements for bug fixes and features

  • Tests for the changes have been added
  • Docs have been added / updated

Does this PR introduce a breaking change?

  • Yes

Does this PR change client-test-data?

  • Yes

@seakayone seakayone self-assigned this Mar 6, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

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

Project coverage is 12.92%. Comparing base (eac5751) to head (04f6518).
Report is 113 commits behind head on main.

Files Patch % Lines
...api/slice/admin/api/service/UsersRestService.scala 0.00% 8 Missing ⚠️
.../slice/admin/domain/service/KnoraUserService.scala 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3098      +/-   ##
==========================================
+ Coverage   11.74%   12.92%   +1.18%     
==========================================
  Files         246      260      +14     
  Lines       22907    22339     -568     
==========================================
+ Hits         2690     2887     +197     
+ Misses      20217    19452     -765     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seakayone seakayone marked this pull request as ready for review March 6, 2024 11:37
Copy link
Collaborator

@mpro7 mpro7 left a comment

Choose a reason for hiding this comment

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

Just one minor suggestion:

lang: Option[LanguageCode] = None,
): Task[KnoraUser] = {
val theUpdate =
UserChangeRequest(username = username, email = email, givenName = givenName, familyName = familyName, lang = lang)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
UserChangeRequest(username = username, email = email, givenName = givenName, familyName = familyName, lang = lang)
UserChangeRequest(username, email, givenName, familyName, lang)

@seakayone seakayone enabled auto-merge (squash) March 6, 2024 15:26
@seakayone seakayone merged commit 4111312 into main Mar 6, 2024
12 checks passed
@seakayone seakayone deleted the refactor/disallow-update- branch March 6, 2024 20:15
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.

None yet

4 participants