-
Notifications
You must be signed in to change notification settings - Fork 26
FLPATH-237: notification-service: add User or Group validation to NotificationMessage creation #325
FLPATH-237: notification-service: add User or Group validation to NotificationMessage creation #325
Conversation
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nirarg: This pull request references FLPATH-237 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
public boolean isValid(NotificationMessageCreateRequestDTO notificationMessage, | ||
ConstraintValidatorContext context) { | ||
if (notificationMessage == null) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we do not check whether usernames nor groupnames are empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to return false
/lgtm |
...com/redhat/parodos/notification/validation/ValidNotificationMessageUserOrGroupValidator.java
Outdated
Show resolved
Hide resolved
...redhat/parodos/notification/validation/ValidNotificationMessageUserOrGroupValidatorTest.java
Show resolved
Hide resolved
...tion-tests/src/test/java/com/redhat/parodos/integration/notification/NotificationRecord.java
Outdated
Show resolved
Hide resolved
...tion-tests/src/test/java/com/redhat/parodos/integration/notification/NotificationRecord.java
Outdated
Show resolved
Hide resolved
...tion-tests/src/test/java/com/redhat/parodos/integration/notification/NotificationRecord.java
Show resolved
Hide resolved
...tion-tests/src/test/java/com/redhat/parodos/integration/notification/NotificationRecord.java
Show resolved
Hide resolved
…sage creation When NotificationMessage is created, user must be assigned to it, this can be done by indicating GroupName (all users under this group are assigned to the Notification) Therefore, create API must include validation that there are users or groups added to the request
Add more integration tests to validate that: 1. Auth works as expected in the API 2. NotificationMessage User or Group validation in create API
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rgolangh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
When NotificationMessage is created, user must be assigned to it, this can be done by indicating
GroupName (all users under this group are assigned to the Notification)
Therefore, create API must include validation that there are users or groups added to the request
There is still open issue when creating NotificationMessage with GroupName
Opened another jira ticket for this (FLPATH-353)
Which issue(s) this PR fixes:
Fixes #FLPATH-237
Change type
Impacted services
Checklist