Skip to content
Snippets Groups Projects
Commit f0d4d76d authored by Fabian Seidl's avatar Fabian Seidl
Browse files

updated some todo comments

parent 4f572e10
No related branches found
No related tags found
1 merge request!287Implement data persisting for user management
......@@ -102,7 +102,7 @@ func getChangesByType(cType pnd.ChangeState) []prompt.Suggest {
}
func createContextWithAuthorization() context.Context {
//TODO(faseid): try to get token string first, if "" return err, followed by print in cli about required login
//TODO: try to get token string first, if "" return err, followed by print in cli about required login
md := metadata.Pairs("authorize", userToken)
return metadata.NewOutgoingContext(context.Background(), md)
}
......@@ -53,7 +53,6 @@ func (s Auth) Login(ctx context.Context, request *apb.LoginRequest) (*apb.LoginR
return nil, err
}
//TODO: add session handling here, update user with token
userToUpdate, err := userc.Get(store.Query{Name: user.UserName})
if err != nil {
return nil, err
......@@ -94,7 +93,7 @@ func (s Auth) CreateUsers(ctx context.Context, request *apb.CreateUsersRequest)
start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
// TODO(faseid): implement check if user is allowed to create users with this role
// TODO: implement check if user is allowed to create users with this role
// e.g. non-admin shouldn't be allowed to create admin users
for _, u := range request.User {
roles := map[string]string{}
......@@ -126,7 +125,7 @@ func (s Auth) GetUser(ctx context.Context, request *apb.GetUserRequest) (*apb.Ge
start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
// TODO(faseid): implement check if user is allowed to get this user data; only their own if not admin
// TODO: implement check if user is allowed to get this user data; only their own if not admin
userData, err := userc.Get(store.Query{Name: request.Name})
if err != nil {
return nil, err
......@@ -178,7 +177,7 @@ func (s Auth) UpdateUsers(ctx context.Context, request *apb.UpdateUsersRequest)
start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
// TODO(faseid): check if current user is allowed to update the user they try to update; only their own if not admin
// TODO: check if current user is allowed to update the user they try to update; only their own if not admin
for _, u := range request.User {
uid, err := uuid.Parse(u.Id)
if err != nil {
......@@ -323,7 +322,7 @@ func (s Auth) UpdateRoles(ctx context.Context, request *apb.UpdateRolesRequest)
start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
// TODO(faseid): check if current user is allowed to update the role they try to update; only their own if not admin
// TODO: check if current user is allowed to update the role they try to update; only their own if not admin
for _, r := range request.Roles {
rid, err := uuid.Parse(r.Id)
if err != nil {
......@@ -373,7 +372,6 @@ func (s Auth) DeletePermissionsForRole(ctx context.Context, request *apb.DeleteP
break
}
}
if nonFound {
return nil, status.Errorf(codes.Canceled, "no fitting permissions")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment