Skip to content

[tests-only][full-ci]Extend tests coverage for different role capability for group - #5742

Merged
amrita-shrestha merged 3 commits into
masterfrom
extendTestsCoverageForDifferentUserRoleInGroup
Mar 28, 2023
Merged

amrita-shrestha merged 3 commits into
masterfrom
extendTestsCoverageForDifferentUserRoleInGroup

Conversation

@amrita-shrestha

@amrita-shrestha amrita-shrestha commented Mar 7, 2023 •

Copy link
Copy Markdown
Contributor

Description

This PR extends tests coverage for different role user capability over group manipulation
rename group will be implemented in ocis owncloud/web#7947.
As Viktor Scharf told 403 Forbidden vs 401 Unauthorized. I would be expect 403 code. But we definitely have chaos here and often for developers - 401 ok. in case non-existent - 404 or 403. looking at witch checking is first.

Related Issue

Motivation and Context

How Has This Been Tested?

  • Locally

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@amrita-shrestha amrita-shrestha self-assigned this Mar 7, 2023
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch 5 times, most recently from facb79e to 103c5b3 Compare March 16, 2023 09:13
@amrita-shrestha
amrita-shrestha marked this pull request as ready for review March 16, 2023 09:15
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch from 103c5b3 to 91215e5 Compare March 16, 2023 09:16
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch from 528862c to 1d8a19b Compare March 17, 2023 09:16
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch 2 times, most recently from d9befb3 to 1599800 Compare March 20, 2023 06:46
@amrita-shrestha
amrita-shrestha requested a review from saw-jan March 20, 2023 06:46

@grgprarup grgprarup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch from 1599800 to b2da969 Compare March 21, 2023 11:30
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch 2 times, most recently from c91cda9 to 1c2aa82 Compare March 23, 2023 09:59
@ownclouders

Copy link
Copy Markdown
Contributor

@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch 2 times, most recently from bad5dab to 1432522 Compare March 23, 2023 11:11
@micbar

micbar commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

@rhafer @butonic I think graph response codes are a real mess. we need to clean that up before we do more manifestations in covering that with tests.

@butonic

butonic commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

In general here is a list of error codes returned by the ms graph api: https://learn.microsoft.com/en-us/graph/errors

Now the 401 Unauthorized vs 403 Forbidden vs 404 Not Found status code may look tricky, but hara are the guidelines:

  • we don't want to expose existence of resources if a user has no access to them, so we return a 404 Not Found instead of a 403 Forbidden.
  • when a user has access to a resource but tries to execute an action that he does not have enough permissions for, e.g. when he tries to write to a read only share, we return a 403 Forbidden

@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch from d124e56 to 57b221a Compare March 27, 2023 10:28
@amrita-shrestha
amrita-shrestha force-pushed the extendTestsCoverageForDifferentUserRoleInGroup branch from 57b221a to a28444d Compare March 27, 2023 10:51
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@amrita-shrestha
amrita-shrestha merged commit 63ba561 into master Mar 28, 2023
@delete-merged-branch
delete-merged-branch Bot deleted the extendTestsCoverageForDifferentUserRoleInGroup branch March 28, 2023 03:24
amrita-shrestha added a commit that referenced this pull request Mar 28, 2023
…ity for group (#5742)

* Extend tests coverage for different role capability for group

* Remove unwanted scenario

* Change http status code
amrita-shrestha added a commit that referenced this pull request Mar 29, 2023
…ity for group (#5742)

* Extend tests coverage for different role capability for group

* Remove unwanted scenario

* Change http status code
amrita-shrestha added a commit that referenced this pull request Mar 29, 2023
…ity for group (#5742)

* Extend tests coverage for different role capability for group

* Remove unwanted scenario

* Change http status code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants