def _login_password(self): """Login using username and password.""" username = self._conf.get("USERNAME") password = self._conf.get("PASSWORD") if not username: raise AuthenticationError("USERNAME is not set") self._hub.auth.login_password(username, password)
def login(self): """Login to the hub. If the hub is already logged in this method does not reattempt it. Raises: AuthenticationError when login fails. """ if not self.is_logged_in: self._login(force=True) if not self.is_logged_in: raise AuthenticationError("Login attempt failed.")
def _login_worker_key(self): """Login using worker key.""" worker_key = self._conf.get("WORKER_KEY") if not worker_key: raise AuthenticationError("WORKER_KEY is not set") self._hub.auth.login_worker_key(worker_key)