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

RestLayerPrivilegesEvaluator must have 100% branch code coverage #2929

Closed
Tracked by #2590
peternied opened this issue Jul 3, 2023 · 6 comments · Fixed by #3218
Closed
Tracked by #2590

RestLayerPrivilegesEvaluator must have 100% branch code coverage #2929

peternied opened this issue Jul 3, 2023 · 6 comments · Fixed by #3218
Assignees
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@peternied
Copy link
Member

peternied commented Jul 3, 2023

Coverage should be enhanced to 100% these areas

  • RestLayerPrivilegesEvaluator.java 82%
  • SecurityRestFilter.java 62%
@github-actions github-actions bot added the untriaged Require the attention of the repository maintainers and may need to be prioritized label Jul 3, 2023
@DarshitChanpura
Copy link
Member

The tests are already added as part of #2753.

@stephen-crawford
Copy link
Contributor

Closing as completed.

@peternied
Copy link
Member Author

peternied commented Jul 10, 2023

@scrawfor99 can you close this after we have verified this state?

@peternied peternied reopened this Jul 10, 2023
@peternied
Copy link
Member Author

peternied commented Jul 10, 2023

Coverage should be enhanced in this areas (Adding to the description)

  • RestLayerPrivilegesEvaluator.java 82%
  • SecurityRestFilter.java 62%

@stephen-crawford
Copy link
Contributor

Hi @peternied, of course. Sorry I thought it was completed since the associated PR was merged. My bad.

@peternied peternied added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. and removed untriaged Require the attention of the repository maintainers and may need to be prioritized labels Jul 17, 2023
@stephen-crawford
Copy link
Contributor

In RestLayerPrivilegeEvaluator, I am not going to add code coverage for:

 if (isDebugEnabled) {
            log.debug("Evaluate permissions for {} on {}", user, clusterService.localNode().getName());
            log.debug("Action: {}", actions);
            log.debug("Mapped roles: {}", mappedRoles.toString());

or

 if (isDebugEnabled) {
                    log.debug("Allowed because we have permissions for {}", actions);
                }

in SecurityRestFilter, I am not going to add coverage for:

 if (pres.isAllowed()) {
                log.debug("Request has been granted");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants