User response - job position (#208)
* add job role to user reponses * add test user job role
This commit is contained in:
@@ -86,6 +86,7 @@ the way that the kolide server works.
|
||||
username = "admin"
|
||||
password = "admin"
|
||||
email = "admin@kolide.co"
|
||||
position = "Head of Security"
|
||||
enabled = true
|
||||
isAdmin = true
|
||||
)
|
||||
@@ -95,6 +96,7 @@ the way that the kolide server works.
|
||||
Password: &password,
|
||||
Email: &email,
|
||||
Enabled: &enabled,
|
||||
Position: &position,
|
||||
Admin: &isAdmin,
|
||||
}
|
||||
_, err := svc.NewUser(ctx, admin)
|
||||
|
||||
@@ -25,6 +25,7 @@ type loginResponse struct {
|
||||
Name string `json:"name"`
|
||||
Admin bool `json:"admin"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position string `json:"position,omitempty"`
|
||||
AdminForcedPasswordReset bool `json:"force_password_reset"`
|
||||
Err error `json:"error,omitempty"`
|
||||
}
|
||||
@@ -45,6 +46,7 @@ func makeLoginEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ type createUserResponse struct {
|
||||
Name string `json:"name"`
|
||||
Admin bool `json:"admin"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position string `json:"position,omitempty"`
|
||||
AdminForcedPasswordReset bool `json:"force_password_reset"`
|
||||
Err error `json:"error,omitempty"`
|
||||
}
|
||||
@@ -42,6 +43,7 @@ func makeCreateUserEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
}, nil
|
||||
}
|
||||
@@ -62,6 +64,7 @@ type getUserResponse struct {
|
||||
Name string `json:"name"`
|
||||
Admin bool `json:"admin"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position string `json:"position,omitempty"`
|
||||
AdminForcedPasswordReset bool `json:"force_password_reset"`
|
||||
Err error `json:"error,omitempty"`
|
||||
}
|
||||
@@ -81,6 +84,7 @@ func makeGetUserEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
}, nil
|
||||
}
|
||||
@@ -98,6 +102,7 @@ func makeGetSessionUserEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
}, nil
|
||||
}
|
||||
@@ -129,6 +134,7 @@ func makeListUsersEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
})
|
||||
}
|
||||
@@ -175,6 +181,7 @@ type modifyUserResponse struct {
|
||||
Name string `json:"name"`
|
||||
Admin bool `json:"admin"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position string `json:"position,omitempty"`
|
||||
AdminForcedPasswordReset bool `json:"force_password_reset"`
|
||||
Err error `json:"error,omitempty"`
|
||||
}
|
||||
@@ -195,6 +202,7 @@ func makeModifyUserEndpoint(svc kolide.Service) endpoint.Endpoint {
|
||||
Email: user.Email,
|
||||
Admin: user.Admin,
|
||||
Enabled: user.Enabled,
|
||||
Position: user.Position,
|
||||
AdminForcedPasswordReset: user.AdminForcedPasswordReset,
|
||||
Err: err,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user