VII. God is not under any moral duty outwardly because he is a debtor to no one, and there is no cause out of him which can place him under obligation. Yet he can be under obligation inwardly because he is a debtor to himself and cannot deny himself. As the Son, in divine thins, is obliged to work by the Father, and the Father is obliged to love the Son, so in external acts (supposing the creature to be produced), God cannot but command him and give him just and holy precepts. [Francis Turretin, Institutes of Elenctic Theology, 1.3.XVIII.7]
God is "ex lex" (outside the law), externally. But God is not some arbitrary person, but God has/ is His own nature. Therefore, while God is externally not under obligation, yet internally He cannot but will according to His own nature.
Therefore, heretics like Vincent Cheung are in error because, in calling God the "author of sin," one of his errors is in divorcing God's will from his nature. Cheung is an extreme nominalist, and that is why his god can be the author of sin and yet totally exonerated from the guilt of sinning.