Test Cleanup. Alphabetize handler path test and add several paths that were missed (targets and sessions for example) (#534)
This commit is contained in:
1 parent
73872c5a7e
commit
e19d68dcf0
2 files changed
+53
-36
No files matched your search
@@ -93,16 +93,12 @@ func TestHandleImplementedPaths(t *testing.T) {
|
||||
|
||||
for verb, paths := range map[string][]string{
|
||||
"GET": {
|
||||
"v1/sessions/",
|
||||
"v1/sessions/someid",
|
||||
"v1/scopes",
|
||||
"v1/scopes/someid",
|
||||
"v1/auth-tokens",
|
||||
"v1/auth-tokens/someid",
|
||||
"v1/auth-methods",
|
||||
"v1/auth-methods/someid",
|
||||
"v1/accounts",
|
||||
"v1/accounts/someid",
|
||||
"v1/auth-methods",
|
||||
"v1/auth-methods/someid",
|
||||
"v1/auth-tokens",
|
||||
"v1/auth-tokens/someid",
|
||||
"v1/groups",
|
||||
"v1/groups/someid",
|
||||
"v1/host-catalogs",
|
||||
@@ -113,62 +109,77 @@ func TestHandleImplementedPaths(t *testing.T) {
|
||||
"v1/hosts/someid",
|
||||
"v1/roles",
|
||||
"v1/roles/someid",
|
||||
"v1/users",
|
||||
"v1/users/someid",
|
||||
"v1/scopes",
|
||||
"v1/scopes/someid",
|
||||
"v1/sessions/",
|
||||
"v1/sessions/someid",
|
||||
"v1/targets",
|
||||
"v1/targets/someid",
|
||||
"v1/users",
|
||||
"v1/users/someid",
|
||||
},
|
||||
"POST": {
|
||||
// Creation end points
|
||||
"v1/scopes",
|
||||
"v1/groups",
|
||||
"v1/roles",
|
||||
"v1/users",
|
||||
"v1/auth-methods",
|
||||
"v1/accounts",
|
||||
"v1/auth-methods",
|
||||
"v1/groups",
|
||||
"v1/host-catalogs",
|
||||
"v1/host-sets",
|
||||
"v1/hosts",
|
||||
"v1/roles",
|
||||
"v1/scopes",
|
||||
"v1/targets",
|
||||
"v1/users",
|
||||
|
||||
// custom methods
|
||||
"v1/sessions/someid:cancel",
|
||||
"v1/auth-methods/someid:authenticate",
|
||||
"v1/accounts/someid:set-password",
|
||||
"v1/accounts/someid:change-password",
|
||||
"v1/roles/someid:add-principals",
|
||||
"v1/roles/someid:set-principals",
|
||||
"v1/roles/someid:remove-principals",
|
||||
"v1/roles/someid:add-grants",
|
||||
"v1/roles/someid:set-grants",
|
||||
"v1/roles/someid:remove-grants",
|
||||
"v1/auth-methods/someid:authenticate",
|
||||
"v1/groups/someid:add-members",
|
||||
"v1/groups/someid:set-members",
|
||||
"v1/groups/someid:remove-members",
|
||||
"v1/host-sets/someid:add-hosts",
|
||||
"v1/host-sets/someid:remove-hosts",
|
||||
"v1/host-sets/someid:set-hosts",
|
||||
"v1/roles/someid:add-grants",
|
||||
"v1/roles/someid:set-grants",
|
||||
"v1/roles/someid:remove-grants",
|
||||
"v1/roles/someid:add-principals",
|
||||
"v1/roles/someid:set-principals",
|
||||
"v1/roles/someid:remove-principals",
|
||||
"v1/sessions/someid:cancel",
|
||||
"v1/targets/someid:authorize-session",
|
||||
"v1/targets/someid:add-host-sets",
|
||||
"v1/targets/someid:set-host-sets",
|
||||
"v1/targets/someid:remove-host-sets",
|
||||
"v1/users/someid:add-accounts",
|
||||
"v1/users/someid:set-accounts",
|
||||
"v1/users/someid:remove-accounts",
|
||||
},
|
||||
"DELETE": {
|
||||
"v1/scopes/someid",
|
||||
"v1/users/someid",
|
||||
"v1/roles/someid",
|
||||
"v1/groups/someid",
|
||||
"v1/auth-tokens/someid",
|
||||
"v1/auth-methods/someid",
|
||||
"v1/accounts/someid",
|
||||
"v1/auth-methods/someid",
|
||||
"v1/auth-tokens/someid",
|
||||
"v1/groups/someid",
|
||||
"v1/host-catalogs/someid",
|
||||
"v1/host-sets/someid",
|
||||
"v1/hosts/someid",
|
||||
"v1/roles/someid",
|
||||
"v1/scopes/someid",
|
||||
"v1/targets/someid",
|
||||
"v1/users/someid",
|
||||
},
|
||||
"PATCH": {
|
||||
"v1/scopes/someid",
|
||||
"v1/users/someid",
|
||||
"v1/roles/someid",
|
||||
"v1/groups/someid",
|
||||
"v1/accounts/someid",
|
||||
"v1/auth-methods/someid",
|
||||
"v1/groups/someid",
|
||||
"v1/host-catalogs/someid",
|
||||
"v1/host-sets/someid",
|
||||
"v1/hosts/someid",
|
||||
"v1/roles/someid",
|
||||
"v1/scopes/someid",
|
||||
"v1/targets/someid",
|
||||
"v1/users/someid",
|
||||
},
|
||||
} {
|
||||
for _, p := range paths {
|
||||
|
||||
Reference in new issue
Block a user