CreateDirectory implements RuntimeService.
(ctx context.Context, req *runtimev1.CreateDirectoryRequest)
| 146 | |
| 147 | // CreateDirectory implements RuntimeService. |
| 148 | func (s *Server) CreateDirectory(ctx context.Context, req *runtimev1.CreateDirectoryRequest) (*runtimev1.CreateDirectoryResponse, error) { |
| 149 | observability.AddRequestAttributes(ctx, |
| 150 | attribute.String("args.instance_id", req.InstanceId), |
| 151 | attribute.String("args.path", req.Path), |
| 152 | ) |
| 153 | |
| 154 | s.addInstanceRequestAttributes(ctx, req.InstanceId) |
| 155 | |
| 156 | if !auth.GetClaims(ctx, req.InstanceId).Can(runtime.EditRepo) { |
| 157 | return nil, ErrForbidden |
| 158 | } |
| 159 | |
| 160 | err := s.runtime.MkdirAll(ctx, req.InstanceId, req.Path) |
| 161 | if err != nil { |
| 162 | return nil, mapGRPCErrorWithFallback(err, codes.InvalidArgument) |
| 163 | } |
| 164 | |
| 165 | return &runtimev1.CreateDirectoryResponse{}, nil |
| 166 | } |
| 167 | |
| 168 | // DeleteFile implements RuntimeService. |
| 169 | func (s *Server) DeleteFile(ctx context.Context, req *runtimev1.DeleteFileRequest) (*runtimev1.DeleteFileResponse, error) { |
nothing calls this directly
no test coverage detected