/dataset/publish endpoint is dependent on auth.get_username right now. So it expects it to be called by a programmatic client that has users with a username and a password. And it's working right now because it's mostly being called by an user with username and password.
But when I tested publishing using a service client (that doesn't have a username and password, for example airflow), it threw an error because auth.get_username errors out of course.
So this PR switches the dependency to auth.validated_token instead which just validates the token and doesn't care if the client is a programmatic or service client.
Description
/dataset/publish
endpoint is dependent onauth.get_username
right now. So it expects it to be called by a programmatic client that has users with a username and a password. And it's working right now because it's mostly being called by an user with username and password.But when I tested publishing using a service client (that doesn't have a username and password, for example airflow), it threw an error because
auth.get_username
errors out of course.So this PR switches the dependency to
auth.validated_token
instead which just validates the token and doesn't care if the client is a programmatic or service client.