aboutsummaryrefslogtreecommitdiff
path: root/weed/admin/dash/handler_admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/admin/dash/handler_admin.go')
-rw-r--r--weed/admin/dash/handler_admin.go43
1 files changed, 35 insertions, 8 deletions
diff --git a/weed/admin/dash/handler_admin.go b/weed/admin/dash/handler_admin.go
index a7a783aaf..ae218de75 100644
--- a/weed/admin/dash/handler_admin.go
+++ b/weed/admin/dash/handler_admin.go
@@ -27,14 +27,11 @@ type AdminData struct {
// Object Store Users management structures
type ObjectStoreUser struct {
- Username string `json:"username"`
- Email string `json:"email"`
- AccessKey string `json:"access_key"`
- SecretKey string `json:"secret_key"`
- Status string `json:"status"`
- CreatedAt time.Time `json:"created_at"`
- LastLogin time.Time `json:"last_login"`
- Permissions []string `json:"permissions"`
+ Username string `json:"username"`
+ Email string `json:"email"`
+ AccessKey string `json:"access_key"`
+ SecretKey string `json:"secret_key"`
+ Permissions []string `json:"permissions"`
}
type ObjectStoreUsersData struct {
@@ -44,6 +41,36 @@ type ObjectStoreUsersData struct {
LastUpdated time.Time `json:"last_updated"`
}
+// User management request structures
+type CreateUserRequest struct {
+ Username string `json:"username" binding:"required"`
+ Email string `json:"email"`
+ Actions []string `json:"actions"`
+ GenerateKey bool `json:"generate_key"`
+}
+
+type UpdateUserRequest struct {
+ Email string `json:"email"`
+ Actions []string `json:"actions"`
+}
+
+type UpdateUserPoliciesRequest struct {
+ Actions []string `json:"actions" binding:"required"`
+}
+
+type AccessKeyInfo struct {
+ AccessKey string `json:"access_key"`
+ SecretKey string `json:"secret_key"`
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type UserDetails struct {
+ Username string `json:"username"`
+ Email string `json:"email"`
+ Actions []string `json:"actions"`
+ AccessKeys []AccessKeyInfo `json:"access_keys"`
+}
+
type FilerNode struct {
Address string `json:"address"`
DataCenter string `json:"datacenter"`