<#5213 [Housekeeping] flytekit's AuthUnaryIntercep...
# flyte-github
a
#5213 [Housekeeping] flytekit's AuthUnaryInterceptor should not have to try to refresh credentials on grpc.StatusCode.UNKNOWN Issue created by fg91 ### Describe the issue Currently, flytekit's
AuthUnaryInterceptor
lazily tries to refresh credentials, not only when a call to flyteadmin fails with 401 or grpc status 16 (UNAUTHENTICATED) but also grpc status 2 (UNKOWN): class AuthUnaryInterceptor(grpc.UnaryUnaryClientInterceptor, grpc.UnaryStreamClientInterceptor): def intercept_unary_unary( ... ): if e.code() == grpc.StatusCode.UNAUTHENTICATED or e.code() == grpc.StatusCode.UNKNOWN: self._authenticator.refresh_credentials() The reason is that the python grpc client does not correctly map status codes if the server responds with a content-type other than
application/grpc
. We reported the issue here. ### What if we do not do this? Uncleanliness. This is a housekeeping note that this can be removed in the future if the underlying issue is fixed in the grpc python client. ### Related component(s) flytekit ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte