Pope Pius XII
Divino Afflante Spiritu §26
Divino Afflante Spiritu: On Promoting Biblical Studies
26 For what was said and done in the Old Testament was ordained and disposed by God with such consummate wisdom, that things past prefigured in a spiritual way those that were to come under the new dispensation of grace. Wherefore the exegete, just as he must search out and expound the literal meaning of the words, intended and expressed by the sacred writer, so also must he do likewise for the spiritual sense, provided it is clearly intended by God. For God alone could have known this spiritual meaning and have revealed it to us. Now Our Divine Savior Himself points out to us and teaches us this same sense in the Holy Gospel; the Apostles also, following the example of the Master, profess it in their spoken and written words; the unchanging tradition of the Church approves it; and finally the most ancient usage of the liturgy proclaims it, wherever may be rightly applied the well-known principle: "The rule of prayer is the rule of faith."
Source: Divino Afflante Spiritu (Vatican.va)