mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
use the account.id as ocis userid, tests
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -81,7 +81,7 @@ Feature: auth
|
||||
| endpoint |
|
||||
| /ocs/v1.php/cloud/users |
|
||||
| /ocs/v2.php/cloud/users |
|
||||
Then the HTTP status code of responses on all endpoints should be "200"
|
||||
Then the HTTP status code of responses on all endpoints should be "401"
|
||||
And the OCS status code of responses on all endpoints should be "997"
|
||||
When the user "Alice" requests these endpoints with "GET" with basic auth
|
||||
| endpoint |
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: auth
|
||||
| /ocs/v1.php/privatedata/setattribute/testing/test |
|
||||
| /ocs/v2.php/privatedata/setattribute/testing/test |
|
||||
Then the HTTP status code of responses on all endpoints should be "401"
|
||||
And the OCS status code of responses on all endpoints should be "997"
|
||||
And the OCS status code of responses on all endpoints should be "notset"
|
||||
|
||||
# after fixing all issues delete this Scenario and use the one from oC10 core
|
||||
Scenario: send POST requests to OCS endpoints as normal user with wrong password
|
||||
|
||||
@@ -10,7 +10,7 @@ Feature: auth
|
||||
| /ocs/v1.php/apps/files_sharing/api/v1/shares/123 |
|
||||
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 |
|
||||
Then the HTTP status code of responses on all endpoints should be "401"
|
||||
And the OCS status code of responses on all endpoints should be "997"
|
||||
And the OCS status code of responses on all endpoints should be "notset"
|
||||
|
||||
@issue-ocis-reva-30
|
||||
@issue-ocis-ocs-26
|
||||
|
||||
@@ -55,7 +55,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.PreferredName,
|
||||
UserID: account.Id,
|
||||
DisplayName: account.DisplayName,
|
||||
LegacyDisplayName: account.DisplayName,
|
||||
Email: account.Mail,
|
||||
@@ -103,7 +103,7 @@ func (o Ocs) GetUser(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
d := &data.User{
|
||||
UserID: account.PreferredName,
|
||||
UserID: account.Id,
|
||||
DisplayName: account.DisplayName,
|
||||
LegacyDisplayName: account.DisplayName,
|
||||
Email: account.Mail,
|
||||
|
||||
@@ -99,11 +99,8 @@ func AccountUUID(opts ...Option) func(next http.Handler) http.Handler {
|
||||
Iss: opt.OIDCIss,
|
||||
}
|
||||
} else {
|
||||
// we are still forwarding the request, the service is responsible for rendering the error
|
||||
// TODO or render a full blown ocs xml / json error response
|
||||
next.ServeHTTP(w, r)
|
||||
// tell client to reauthenticate
|
||||
//w.WriteHeader(http.StatusUnauthorized)
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user