Skip to content

Commit

Permalink
hide account.id in ocs api, use username
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Nov 6, 2020
1 parent 1719862 commit 1456715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/ocs-map-userid-to-username.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ service. The userid in OCS requests is in fact the username, not our internal ac
as our internal account id though, because the account id is part of various `path` formats.

https://github.com/owncloud/ocis/pull/709
https://github.com/owncloud/ocis/pull/816
6 changes: 3 additions & 3 deletions ocs/pkg/service/v0/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (o Ocs) GetSelf(w http.ResponseWriter, r *http.Request) {
o.logger.Debug().Interface("account", account).Msg("got user")

d := &data.User{
UserID: account.Id,
UserID: account.OnPremisesSamAccountName,
DisplayName: account.DisplayName,
LegacyDisplayName: account.DisplayName,
Email: account.Mail,
Expand Down Expand Up @@ -104,7 +104,7 @@ func (o Ocs) GetUser(w http.ResponseWriter, r *http.Request) {
}

d := &data.User{
UserID: account.Id,
UserID: account.OnPremisesSamAccountName,
DisplayName: account.DisplayName,
LegacyDisplayName: account.DisplayName,
Email: account.Mail,
Expand Down Expand Up @@ -218,7 +218,7 @@ func (o Ocs) AddUser(w http.ResponseWriter, r *http.Request) {
enabled = "false"
}
render.Render(w, r, response.DataRender(&data.User{
UserID: account.Id,
UserID: account.OnPremisesSamAccountName,
DisplayName: account.DisplayName,
LegacyDisplayName: account.DisplayName,
Email: account.Mail,
Expand Down

0 comments on commit 1456715

Please sign in to comment.