◐ Shell
clean mode source ↗

chore: add authentication type to GitlabAuthenticationError by JohnVillalovos · Pull Request #1793 · python-gitlab/python-gitlab

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could actually reuse self.headers and pass it (or just the dict keys) to the exception to infer the auth type, without adding custom variables here.

http_username/http_password is basically dead code as HTTP Basic auth has been out of GitLab since version 10 so we don't need to worry about that (I actually have a local draft that performs password-based OAuth login from that). So we're left with Private-Token, Job-Token, and Authorization (OAuth bearer) from headers. We could probably just pass the keys from the headers dict to not leak stuff accidentally.