Rois 1 11:38 Halakha : Mishneh Torah, Kings and Wars

וְהָיָ֗ה אִם־תִּשְׁמַע֮ אֶת־כָּל־אֲשֶׁ֣ר אֲצַוֶּךָ֒ וְהָלַכְתָּ֣ בִדְרָכַ֗י וְעָשִׂ֨יתָ הַיָּשָׁ֤ר בְּעֵינַי֙ לִשְׁמ֤וֹר חֻקּוֹתַי֙ וּמִצְוֺתַ֔י כַּאֲשֶׁ֥ר עָשָׂ֖ה דָּוִ֣ד עַבְדִּ֑י וְהָיִ֣יתִי עִמָּ֗ךְ וּבָנִ֨יתִי לְךָ֤ בַֽיִת־נֶאֱמָן֙ כַּאֲשֶׁ֣ר בָּנִ֣יתִי לְדָוִ֔ד וְנָתַתִּ֥י לְךָ֖ אֶת־יִשְׂרָאֵֽל׃

Or, si tu obéis à tout ce que je t’ordonnerai, si tu marches dans mes voies, et si tu fais ce qui est droit à mes yeux, en observant mes lois et mes préceptes, comme a fait mon serviteur David, je serai avec toi et je t’édifierai une maison durable comme j’en ai édifié pour David, et je te donnerai Israël.

Mishneh Torah, Kings and Wars

Should a prophet install a king from any of the other Tribes of Israel, and that king follows in the ways of the Torah and observes the Commandments, and fights the Wars of G-d, he, too, is a king and all the Commandments of the King are applicable to him. This, even though the “essential” monarchy belongs to David and from his children there will be kings. For we see that Achiya the Shilonite appointed Jeraboam and said to him, “And it will be, if you listen to all that I command you…and I shall build for you a sure house as I built for David…” (I Kings 11:38). And Achiya said to him, “And to his son, I shall give one tribe, so that it shall be a remembrance for David my servant for all days before me in Jerusalem” (I Kings 11:39).