It is sometimes claimed by Protestants that the identification of the Woman of the Apocalypse as Mary is a Medieval invention (I’ve heard the 12th century mentioned). But this just isn’t true.
In the Apocalypse of the apostle John it is written that the dragon stood in full view of the woman about to give birth, in order that when she gave birth, he would eat the child born [of her]. Let none of you ignore [the fact] that the dragon is the devil; know that the virgin signifies Mary, the chaste one, who gave birth to our chaste head. She also embodied in herself a figure of the holy church: namely, how, while bearing a son, she remained a virgin, so that the church throughout time bears her members, yet she does not lose her virginity.
Quodvultdeus of Carthage, Third Homily On the Creed, circa 440 AD
Who is this guy? He was a disciple and correspondent of St. Augustine’s who became bishop of nearby Carthage four years after Augustine’s death. This interpretation of the Woman of the Apocalypse is present in the very earliest days of the Augustinian tradition.