def assert_headers(self): """Asserts that the current request contains the appropriate headers.""" if self.username_header not in request.headers: raise errors.UserUnknownError('No username header in request') if self.email_header not in request.headers: raise errors.UserUnknownError('No email header in request')
def _current_saml_session_id(self): if 'saml_data' in session: return session['saml_data']['session_index'] else: raise errors.UserUnknownError('No SAML user data in session')
def _current_user_nameid(self): """Get the SAML name_id of the currently logged in user.""" if 'saml_data' in session: return session['saml_data']['nameid'] else: raise errors.UserUnknownError('No SAML user data in session')