I had my Samsung phone repaired at an authorized shop recently. They required the password for my phone in order to run tests that Samsung requires as part of the authorized repair process. Likely the same for Apple?
I made a quick backup of everything important and wiped my phone before handing it over. Give anyone 30 seconds with your phone and they can drain your bank account and get you fired from your job. Not gonna trust anyone with that level of power, but everyone else at the shop was fine with it.