History

fix: disallow newer policies, users & groups with space characters (#14845)

space characters at the beginning or at the end can lead to confusion under various UI elements in differentiating the actual name of "policy, user or group" - to avoid this behavior this PR onwards we shall reject such inputs for newer entries. existing saved entries will behave as is and are going to be operable until they are removed/renamed to something more meaningful.

Harshavardhana committed 4 years ago

Commit 16bc11e1 parent 2719f1e5 files · +49 −8Browse files

Showing the changes to cmd/api-errors.go (1 of 5 files). Show all

Unified · Split

cmd/api-errors.go+6−0
@@ -383,6 +383,7 @@ const ( · 382 unmodified lines
383383 ErrAdminProfilerNotEnabled
384384 ErrInvalidDecompressedSize
385385 ErrAddUserInvalidArgument
386+ ErrAdminResourceInvalidArgument
386387 ErrAdminAccountNotEligible
387388 ErrAccountNotEligible
388389 ErrAdminServiceAccountNotFound
@@ -1825,6 +1826,11 @@ var errorCodes = errorCodeMap{ · 1436 unmodified lines
18251826 Description: "User is not allowed to be same as admin access key",
18261827 HTTPStatusCode: http.StatusForbidden,
18271828 },
1829+ ErrAdminResourceInvalidArgument: {
1830+ Code: "XMinioInvalidResource",
1831+ Description: "Policy, user or group names are not allowed to begin or end with space characters",
1832+ HTTPStatusCode: http.StatusBadRequest,
1833+ },
18281834 ErrAdminAccountNotEligible: {
18291835 Code: "XMinioInvalidIAMCredentials",
18301836 Description: "The administrator key is not eligible for this operation",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t