That is the question, isn't it. It is an interesting study to examine how the Catholic Church has evolved its "authority" from the original instructions of Christ. Perhaps you can offer a reference to where Christ leaves it to the Catholic church to determine what God did and didn't author. And with regard to Matthew 18... who is "you" in the following verse:
"And if your brother sins, go and reprove him in private; if he listens to you, you have won your brother."
You are correct about Luther not claiming infallibility. Luther was fully aware of the fact that he was merely human. Infallibilty is one of those evolved authorities the Catholic Church now enjoys.
In Isaiah 22, we see the existence of the historical office of the vice-regent (king) of the kingdom of David. In the king's absence, the vice-regent held full plenary authority. As a sign of his authority, the vice-regent wore a pouch around his neck which contained a key --the key to the kingdom.
In the passage from Isaiah, we see this office being transferred from Shebna to Eliakim:
Isaiah 22:20-23Jesus is the eternal king of the House of David who is the power behind the keys."In that day I will summon my servant, Eliakim son of Hilkiah. I will clothe him with your robe and fasten your sash around him and hand your authority over to him. He will be a father to those who live in Jerusalem and to the house of Judah. I will place on his shoulder the key to the house of David; what he opens no one can shut, and what he shuts no one can open. I will drive him like a peg into a firm place; he will be a seat of honor for the house of his father.
Revelation 3:7When Jesus gives Peter the "keys to the kingdom," he is placing Peter in the office of vice-regent of the eternal House of David, Christ's Church:These are the words of him who is holy and true [Jesus], who holds the key of David. What he opens no one can shut, and what he shuts no one can open.
Matthew 16:18-19Elsewhere in Scripture we see that the Church is "the pillar and foundation of truth" (1 Timothy 3:15) and that anyone who doesn't listen to the church should be treated as "a pagan or tax collector." (Matthew 18:17)I tell you that you are Rock (Peter), and on this rock I will build my church, and the gates of Hades will not overcome it. I will give you the keys of the kingdom of heaven; whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven.
Clearly Christ's Church has the authority to determine the canon of Scripture.