This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
Refactor User Type, Add Additional User Endpoints #61
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.
These changes are part of an effort to implement users in the Terraform Grafana provider - https://github.com/terraform-providers/terraform-provider-grafana/issues/51.
Refactor User Type
Additional fields were added to
User
to capture all available information from the API.The
UserSearch
type was added. This is structured after user objects returned from the search users API.User
andUserSearch
are modeled afterUserProfileDTO
andUserSearchHitDTO
in the Grafana codebase. Attempting to reuse a single type is going to lead to problems and workarounds like what's being removed from theUserByEmail
function (where a temporary/alternate struct is created and then cast to aUser
).Added Enpoints
User
implements the user by ID API.UserUpdate
implements the user update API.UpdateUserPassword
implements the password for user admin API for updating user passwords. This field cannot be updated withUserUpdate
.UpdateUserPermissions
implements the user permissions admin API for updating a user's IsAdmin property. This field also cannot be updated withUserUpdate
.