def logout(self): logout_args = collections.namedtuple('logout_args', ['token', 'username', 'host']) args = logout_args(self.tok, self.username, self.host) self.tok = '' self.password = '' self.sm.current = 'LogInScreen' api.logout(args)
def parse_data(username, r): for p in ALPHABET: ans = api.auth(r, username, p).decode() if "Invalid" in ans: continue print(api.get_private_data(r)) api.logout(r) return
def logout(request): if 'auth_token' in request.session: # call api to invalidate auth token (logout) api.logout(request) # delete auth token from session del request.session['auth_token'] # delete user from session del request.session['auth_user'] # redirect to / return HTTPFound(location='/')
def check(*args): host = args[0] r = connect(host) try: name = api.get_rand_str(8) pas = api.get_rand_str(16) # Authorisation api.auth(r, name, pas) # Logout and exit api.logout(r) verdict(OK) except Exception as e: r.close() verdict(MUMBLE, "Check error", str(e))
def logout(): """ Deletes user's session key :return: response object with JWT """ return api.logout()
def main(): print("Hello World!") # Load settings print("Loading settings... ", end="") settings = get_settings() print("Loaded!") # Log in PronoteApi print("Login to PronoteAPI... ", end="") session = login(settings.api_url, settings.pronote_credentials) print(f"Logged!\nConnected to {settings.api_url} (PronoteAPI).") user = get_userinfo(session) print(f"Logged as {user[0]} ({user[1]}).") # Load DB print("Loading DB...", end=" ") notify, db = load_db() print("Loaded!") # Get timetable print("Itering lessons...") timetable = get_daytimetable(session) for l in timetable: print(str(l), end=" ") if l.to_hash() in db.lessons: print("(known)") else: db.lessons.append(l.to_hash()) if not notify and not l.has_status(): print("(new / ignored)") else: notify_lesson(settings.webhook, l) print("(new)") print("Ended!") # Save DB print("Saving DB...", end=" ") save_db(db) print("Saved!") # Log out print("Logout... ", end="") logout(session) print("Logged out!")
def get(*args): host, flag_id, flag = args[:3] name, password, data = flag_id.strip().split(":") r = connect(host) encflag = api.encrypt_flag(flag) try: # Authorisation api.auth(r, name, password) # Check public data api.check_public(r, name, data.encode()) # Check private data api.check_private(r, flag) # Logout and exit api.logout(r) r.close() verdict(OK) except Exception as e: r.close() verdict(MUMBLE, "Get error", str(e))
def logout(apikey=None): """ End the current API session. If API key is supplied, tries to end the corresponding session. Otherwise tries the API key in the saved ~/.usgs_api_key file. """ logger.info('Calling logout().') response = api.logout(apikey) logger.debug("Received response:\n{}".format(json.dumps(response, indent=4))) if response['errorCode'] is None: logger.info("API session successfully ended. Key file removed.")
def put(*args): host, flag_id, flag = args[:3] r = connect(host) encflag = api.encrypt_flag(flag) data = api.gen_file(encflag) try: name = api.get_rand_str(12) password = api.get_rand_str(16) # Authorisation api.auth(r, name, password) # Load public data api.load_public(r, data) # Load private data api.load_private(r, flag) # Logout and exit api.logout(r) flag_id = f"{name}:{password}:{data.decode()}" verdict(OK, private=flag_id) except Exception as e: r.close() verdict(MUMBLE, "Put error", str(e))
def logout(): api.logout() return render_template('index.html')
def process_logout(): api.logout()
def logout(): api.logout() flash('logout successful') return redirect("/login")
def parse_data(username, r): for p in ALPHABET: ans = api.auth(r, username, p).decode() if "Invalid" in ans: continue print(api.get_private_data(r)) api.logout(r) return host = sys.argv[1] name = api.get_rand_str(12) password = api.get_rand_str(16) r = connect(host) regx = re.compile("[A-Z, 0-9]{16}") api.reg_auth(r, name, password) public_data = api.get_public_data(r).decode().split('\x00') api.logout(r) data_count = 0 for username in public_data[::-1]: if data_count >= DATA_LIMIT: exit() if re.match(r"[A-Z, 0-9]{12}", username): data_count += 1; parse_data(username[:-1], r)
def process_logout(): session['user'] = -1 api.logout() login = False return "Success"
def logout(): api.logout() flaskSession.clear() return "Success"
def process_logout(): session["user"] = -1 api.logout() login = False return "Success"
def logout(): return api.logout()