I would check that key and role are defined and throw an `Error` if not