Add WIP profile ownership

This commit is contained in:
Theodor S. Midtlien
2026-09-03 11:50:21 +02:00
parent 34f78b5119
commit 1f262ba044
6 changed files with 116 additions and 17 deletions
+5 -1
View File
@@ -2286,7 +2286,11 @@ func (s *Server) AddProfile(ctx context.Context, msg *proto.AddProfileRequest) (
return nil, gstatus.Errorf(codes.InvalidArgument, "profile name and username must be provided")
}
created, err := s.profileManager.AddProfile(msg.ProfileName, msg.Username)
callerId, ok := ipcauth.CallerIdentity(ctx)
if !ok {
return nil, fmt.Errorf("failed to get identity from context")
}
created, err := s.profileManager.AddProfile(msg.ProfileName, msg.Username, callerId)
if err != nil {
log.Errorf("failed to create profile: %v", err)
return nil, fmt.Errorf("failed to create profile: %w", err)