I've never seen/used xargs (/export) like:
export $(sudo cat <protected_credentials_file> | xargs)
Is that the same as sudo cat f | xargs export?If so, I think an important difference is that mine won't hide the exit code, and you can then answer a sibling commenter (on forgetting without checking) with 'I omitted set -e at the top'.