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

Backport of https://github.com/cs3org/reva/pull/4603 #4607

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile.revad-ceph
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM quay.io/ceph/ceph:v18

# replace repo url with one that allows downloading the repo metadata
# if http://download.ceph.com/rpm-reef/el8/x86_64/repodata/repomd.xml works again this can be dropped
RUN sed -i 's/download.ceph.com/de.ceph.com/' /etc/yum.repos.d/ceph.repo
RUN sed -i 's/download.ceph.com/fr.ceph.com/' /etc/yum.repos.d/ceph.repo
RUN mkdir -p /etc/selinux/config

RUN dnf update --exclude=ceph-iscsi,chrony -y && dnf install -y \
Expand Down
8 changes: 8 additions & 0 deletions changelog/unreleased/mask-user-email-in-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Mask user email in output

We have fixed a bug where the user email was not masked in the output and the user emails could be enumerated through
the sharee search.

https://github.com/cs3org/reva/pull/4607
https://github.com/cs3org/reva/pull/4603
https://github.com/owncloud/ocis/issues/8726
1 change: 1 addition & 0 deletions internal/http/services/owncloud/ocs/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Config struct {
ListOCMShares bool `mapstructure:"list_ocm_shares"`
Notifications map[string]interface{} `mapstructure:"notifications"`
IncludeOCMSharees bool `mapstructure:"include_ocm_sharees"`
ShowEmailInResults bool `mapstructure:"show_email_in_results"`
}

// Init sets sane defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ type Handler struct {
gatewayAddr string
additionalInfoAttribute string
includeOCMSharees bool
showUserEmailInResults bool
}

// Init initializes this and any contained handlers
func (h *Handler) Init(c *config.Config) {
h.gatewayAddr = c.GatewaySvc
h.additionalInfoAttribute = c.AdditionalInfoAttribute
h.includeOCMSharees = c.IncludeOCMSharees
h.showUserEmailInResults = c.ShowEmailInResults
}

// FindSharees implements the /apps/files_sharing/api/v1/sharees endpoint
Expand Down Expand Up @@ -123,6 +125,21 @@ func (h *Handler) FindSharees(w http.ResponseWriter, r *http.Request) {
}
}

if !h.showUserEmailInResults {
for _, m := range userMatches {
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
}
for _, m := range exactUserMatches {
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
}
for _, m := range groupMatches {
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
}
for _, m := range exactGroupMatches {
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
}
}

response.WriteOCSSuccess(w, r, &conversions.ShareeData{
Exact: &conversions.ExactMatchesData{
Users: exactUserMatches,
Expand Down
Loading