Obviously, it could only have at best been written by Joshua.
Moses received the Torah, and perhaps a confirmation of the oral and written history that had pervaded/preceded the culture of Israel. Then someone else would have to write it down.
Otherwise, the ending passage of Deuteronomy was also written by Moses? How could a dead Moses have written his own obit ?? I am trying to keep the original non-finite tense, and converting it to past participle when it makes sense with the conversive vav:
So he dies there Mosheh servant of the LORD in the land Moav, according to the LORD.
And He buries him in the valley/ravine in the land of Moav, opposite Bet-Peor (House/city of big gap).
And not a man knows of his tomb till this day.
Mosheh was hundred and twenty years at his death. Not dimmed his eye, his vigour not having abandoned him.
Mourning they the children of Israel for Mosheh in the plains of Moav, thirty days, and so ends the days of weeping of mourning Mosheh.
Joshua son of Nun filled with spirit of wisdom that Mosheh had enjoyed at his hands on him (i.e. Mosheh had the privilege of being supported by Joshua's wisdom)
Would listen to him they sons of Israel. They would do that which the LORD instructs Mosheh.
Not arisen a prophet any more in Israel like Mosheh, whom the LORD knew face to face.
Look at verse 34:9. Ignore the traditional translations. It says in Hebrew, that the wisdom of Joshua supported Moses, with his hand on him. So Joshua was Moses' assistant and possibly scribe.
Verse 34:5 says according to the description by the LORD, Moses died. Could it be logical that Moses dies, and nobody knew, and then the LORD came to Israel to inform them the bad news, and then Moses wrote about it while buried?
Like today, many theses are titled as authored by a professor, where the actual verification and data entry were performed by his/her students. The professor was functioning as the Lead Engineer/Architect, designing all the experiments and interpreting the results.