[Jeb/EC] Made secret-key paramater optionally a function which takes request