Skip to content

Commit

Permalink
docs: API users (#5620)
Browse files Browse the repository at this point in the history
* docs: audit, deploymentconfig, files, parameters

* Swagger comments in workspacebuilds.go

* structs in workspacebuilds.go

* workspaceagents: instance identity

* workspaceagents.go in progress

* workspaceagents.go in progress

* Agents

* workspacebuilds.go

* /workspaces

* templates.go, templateversions.go

* templateversion.go in progress

* cancel

* templateversions

* wip

* Merge

* x-apidocgen

* NullTime hack not needed anymore

* Fix: x-apidocgen

* Members

* Fixes

* Fix

* WIP

* WIP

* Users

* Logout

* User profile

* Status suspend activate

* User roles

* User tokens

* Keys

* SSH key

* All

* Typo

* Fix

* Fix

* Fix: LoginWithPasswordRequest
  • Loading branch information
mtojek committed Jan 11, 2023
1 parent 8412076 commit 8e9cbdd
Show file tree
Hide file tree
Showing 27 changed files with 4,513 additions and 157 deletions.
6 changes: 3 additions & 3 deletions cli/userstatus_test.go
Expand Up @@ -33,7 +33,7 @@ func TestUserStatus(t *testing.T) {
})

t.Run("StatusOther", func(t *testing.T) {
require.Equal(t, otherUser.Status, codersdk.UserStatusActive, "start as active")
require.Equal(t, codersdk.UserStatusActive, otherUser.Status, "start as active")

cmd, root := clitest.New(t, "users", "suspend", otherUser.Username)
clitest.SetupConfig(t, client, root)
Expand All @@ -45,7 +45,7 @@ func TestUserStatus(t *testing.T) {
// Check the user status
otherUser, err = client.User(context.Background(), otherUser.Username)
require.NoError(t, err, "fetch suspended user")
require.Equal(t, otherUser.Status, codersdk.UserStatusSuspended, "suspended user")
require.Equal(t, codersdk.UserStatusSuspended, otherUser.Status, "suspended user")

// Set back to active. Try using a uuid as well
cmd, root = clitest.New(t, "users", "activate", otherUser.ID.String())
Expand All @@ -58,6 +58,6 @@ func TestUserStatus(t *testing.T) {
// Check the user status
otherUser, err = client.User(context.Background(), otherUser.ID.String())
require.NoError(t, err, "fetch active user")
require.Equal(t, otherUser.Status, codersdk.UserStatusActive, "active user")
require.Equal(t, codersdk.UserStatusActive, otherUser.Status, "active user")
})
}

0 comments on commit 8e9cbdd

Please sign in to comment.