Gaza has a legal right to be militarized and a legal right to attack the Occupying Power over any Palestinian territory.
Israel has no legal right to illegally acquire ANY territory by war, illegally annex any territory, illegally settle any territory. Israel has no legal right to demand recognition, no legal right to demand other folks territory for its defense, no legal right to have more defensible borders than its neighbours. No legal right to demand the Palestinians be demilitarized.
Why should Israel expect peace if it refuses to withdraw from ALL non-Israeli territory, taking its illegal settlers when it goes, as required by law.