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

[Feature] add new config to enforce public link password #7547

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

micbar
Copy link
Contributor

@micbar micbar commented Oct 20, 2023

Description

Enhancement: Add config to enforce passwords on readable links

We added the config OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD to enforce passwords on "Viewer" public shares.

For Reviewers

  • This adds the capability
  • Thanks to @2403905 the reva part is already implemented
  • API tests added

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

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:

@micbar micbar requested review from 2403905, kobergj and rhafer October 20, 2023 07:03
@micbar micbar self-assigned this Oct 20, 2023
@2403905
Copy link
Contributor

2403905 commented Oct 20, 2023

@micbar if the cfg.OCS.ReadablePublicShareMustHavePassword is true we have to force the fg.OCS.WriteablePublicShareMustHavePassword to be true because a user can change permission from can view to can edit and after that remove a password as well.

@micbar micbar force-pushed the readable-share-enforce-password branch from b942fd9 to 8b6fa44 Compare October 20, 2023 11:29
@micbar
Copy link
Contributor Author

micbar commented Oct 20, 2023

@2403905 @ScharfViktor I changed the name of the variable.

env:"OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD;FRONTEND_OCS_PUBLIC_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on all public shares."`

env:"OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD;FRONTEND_OCS_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on Uploader, Editor or Contributor shares."`

@tbsbdr This assumes that we will never have the use case to enforce passwords on readable links and do not enforce on writable links.

@micbar
Copy link
Contributor Author

micbar commented Oct 20, 2023

@ScharfViktor I added two API tests.

@micbar micbar requested a review from ScharfViktor October 20, 2023 11:35
2403905
2403905 previously approved these changes Oct 20, 2023
@2403905 2403905 dismissed their stale review October 20, 2023 11:45

let me check the reva part

@micbar micbar force-pushed the readable-share-enforce-password branch from 0093c4a to a9f44aa Compare October 20, 2023 12:37
@micbar micbar requested a review from ScharfViktor October 20, 2023 12:48
@sonarqubecloud
Copy link

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@2403905 2403905 merged commit 3c7bae4 into master Oct 20, 2023
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the readable-share-enforce-password branch October 20, 2023 15:55
ownclouders pushed a commit that referenced this pull request Oct 20, 2023
* add new config to enforce public link password

* add api test
nabim777 pushed a commit that referenced this pull request Oct 26, 2023
* add new config to enforce public link password

* add api test
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.

Enforce password for Read-Only Links
3 participants