An application should not let a caller choose a weaker storage scheme or revive a retired key. Those are server policy decisions. A key rotation may still need a short approved overlap, so refusing every key except one can break data that remains within policy.
Repair the metadata policy without claiming to encrypt anything. Require the approved authenticated-encryption profile and resolve key references through the active set. The fixture supplies no cryptographic implementation, secure random source or key manager. Production code needs all three, plus a nonce strategy appropriate to its chosen algorithm. Keep key material out of requests, logs and source files, and follow the maintained library's documented requirements.
Read the fixed handler, then apply the same idea to each exercise.