-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forbid empty password on user creation
- Loading branch information
Showing
4 changed files
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Bugfix: Don't allow empty password | ||
|
||
It was allowed to create users with empty or spaces-only password. This is fixed | ||
|
||
https://github.com/owncloud/product/issues/197 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,8 @@ var formats = []string{"json", "xml"} | |
|
||
var dataPath = createTmpDir() | ||
|
||
var defaultPassword = "Testing123" | ||
|
||
var defaultUsers = []string{ | ||
userEinstein, | ||
userIDP, | ||
|
@@ -708,6 +710,10 @@ func getService() svc.Service { | |
} | ||
|
||
func createUser(u User) error { | ||
// add default password if not set differently | ||
if u.Password == "" { | ||
u.Password = defaultPassword | ||
} | ||
_, err := sendRequest( | ||
"POST", | ||
userProvisioningEndPoint, | ||
|
@@ -767,17 +773,6 @@ func TestCreateUser(t *testing.T) { | |
}, | ||
nil, | ||
}, | ||
// https://github.com/owncloud/ocis-ocs/issues/50 | ||
{ | ||
"User without password", | ||
User{ | ||
Enabled: "true", | ||
ID: "john", | ||
Email: "[email protected]", | ||
Displayname: "John Dalton", | ||
}, | ||
nil, | ||
}, | ||
// https://github.com/owncloud/ocis-ocs/issues/49 | ||
{ | ||
"User with special character in userid", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters