-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add coderd_user data source #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dc475b4
feat: add coderd_user data source
ethanndickson 70fcc08
fixup
ethanndickson 93f239c
fixup
ethanndickson 0edeff0
comment out
ethanndickson cc62729
review
ethanndickson 8e8e8c4
review
ethanndickson c2c2e07
Merge branch 'main' into ethan/user-data
ethanndickson c31e0d0
extra fields
ethanndickson 162a744
review
ethanndickson 6155b85
login type
ethanndickson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,29 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "coderd_user Data Source - coderd" | ||
subcategory: "" | ||
description: |- | ||
An existing user on the coder deployment | ||
--- | ||
|
||
# coderd_user (Data Source) | ||
|
||
An existing user on the coder deployment | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `id` (String) The ID of the user to retrieve. This field will be populated if a username is supplied. | ||
- `username` (String) The username of the user to retrieve. This field will be populated if an ID is supplied. | ||
|
||
### Read-Only | ||
|
||
- `email` (String) Email of the user. | ||
- `login_type` (String) Type of login for the user. Valid types are 'none', 'password', 'github', and 'oidc'. | ||
- `name` (String) Display name of the user. Defaults to username. | ||
- `roles` (Set of String) Roles assigned to the user. Valid roles are 'owner', 'template-admin', 'user-admin', and 'auditor'. | ||
- `suspended` (Boolean) Whether the user is suspended. |
This file contains hidden or 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 |
---|---|---|
|
@@ -49,10 +49,24 @@ func TestIntegration(t *testing.T) { | |
|
||
for _, tt := range []struct { | ||
name string | ||
preF func(testing.TB, *codersdk.Client) | ||
assertF func(testing.TB, *codersdk.Client) | ||
}{ | ||
{ | ||
name: "user-test", | ||
preF: func(t testing.TB, c *codersdk.Client) { | ||
me, err := c.User(ctx, codersdk.Me) | ||
assert.NoError(t, err) | ||
_, err = c.CreateUser(ctx, codersdk.CreateUserRequest{ | ||
Email: "[email protected]", | ||
Username: "ethan", | ||
Password: "SomeSecurePassword!", | ||
UserLoginType: "password", | ||
DisableLogin: false, | ||
OrganizationID: me.OrganizationIDs[0], | ||
}) | ||
assert.NoError(t, err) | ||
}, | ||
assertF: func(t testing.TB, c *codersdk.Client) { | ||
// Check user fields. | ||
user, err := c.User(ctx, "dean") | ||
|
@@ -102,6 +116,7 @@ func TestIntegration(t *testing.T) { | |
var buf bytes.Buffer | ||
tfCmd.Stdout = &buf | ||
tfCmd.Stderr = &buf | ||
tt.preF(t, client) | ||
if err := tfCmd.Run(); !assert.NoError(t, err) { | ||
t.Logf(buf.String()) | ||
} | ||
|
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.