KiCad PCB EDA Suite
Loading...
Searching...
No Matches
OAUTH_LOOPBACK_SERVER Class Reference

#include <oauth_loopback_server.h>

Inheritance diagram for OAUTH_LOOPBACK_SERVER:

Public Member Functions

 OAUTH_LOOPBACK_SERVER (wxEvtHandler *aOwner, const wxString &aCallbackPath, const wxString &aExpectedState)
 
 ~OAUTH_LOOPBACK_SERVER () override
 
bool Start ()
 
unsigned short GetPort () const
 
wxString GetRedirectUri () const
 

Static Public Member Functions

static bool ParseAuthorizationResponse (const wxString &aRequestLine, const wxString &aExpectedPath, const wxString &aExpectedState, OAUTH_AUTHORIZATION_RESPONSE &aResponse, wxString &aError)
 

Private Member Functions

void OnSocketEvent (wxSocketEvent &aEvent)
 
void OnTimeout (wxTimerEvent &aEvent)
 
void HandleClient (wxSocketBase *aClient)
 
void SendHttpResponse (wxSocketBase *aClient, bool aSuccess)
 
void Finish (bool aSuccess)
 
void Shutdown ()
 

Private Attributes

wxEvtHandler * m_owner
 
wxString m_callbackPath
 
wxString m_expectedState
 
std::unique_ptr< wxSocketServer > m_server
 
wxTimer m_timeout
 
unsigned short m_port
 
bool m_done
 
std::optional< OAUTH_AUTHORIZATION_RESPONSEm_response
 

Detailed Description

Definition at line 45 of file oauth_loopback_server.h.

Constructor & Destructor Documentation

◆ OAUTH_LOOPBACK_SERVER()

OAUTH_LOOPBACK_SERVER::OAUTH_LOOPBACK_SERVER ( wxEvtHandler * aOwner,
const wxString & aCallbackPath,
const wxString & aExpectedState )

◆ ~OAUTH_LOOPBACK_SERVER()

OAUTH_LOOPBACK_SERVER::~OAUTH_LOOPBACK_SERVER ( )
override

Definition at line 69 of file oauth_loopback_server.cpp.

References m_timeout, OnSocketEvent(), OnTimeout(), and Shutdown().

Member Function Documentation

◆ Finish()

void OAUTH_LOOPBACK_SERVER::Finish ( bool aSuccess)
private

Definition at line 268 of file oauth_loopback_server.cpp.

References m_done, m_owner, m_response, m_timeout, and Shutdown().

Referenced by HandleClient(), and OnTimeout().

◆ GetPort()

unsigned short OAUTH_LOOPBACK_SERVER::GetPort ( ) const
inline

Definition at line 53 of file oauth_loopback_server.h.

References m_port.

◆ GetRedirectUri()

wxString OAUTH_LOOPBACK_SERVER::GetRedirectUri ( ) const

Definition at line 107 of file oauth_loopback_server.cpp.

References m_callbackPath, and m_port.

Referenced by BOOST_AUTO_TEST_CASE().

◆ HandleClient()

void OAUTH_LOOPBACK_SERVER::HandleClient ( wxSocketBase * aClient)
private

◆ OnSocketEvent()

void OAUTH_LOOPBACK_SERVER::OnSocketEvent ( wxSocketEvent & aEvent)
private

Definition at line 179 of file oauth_loopback_server.cpp.

References HandleClient(), and m_server.

Referenced by Start(), and ~OAUTH_LOOPBACK_SERVER().

◆ OnTimeout()

void OAUTH_LOOPBACK_SERVER::OnTimeout ( wxTimerEvent & aEvent)
private

Definition at line 191 of file oauth_loopback_server.cpp.

References Finish().

Referenced by OAUTH_LOOPBACK_SERVER(), and ~OAUTH_LOOPBACK_SERVER().

◆ ParseAuthorizationResponse()

bool OAUTH_LOOPBACK_SERVER::ParseAuthorizationResponse ( const wxString & aRequestLine,
const wxString & aExpectedPath,
const wxString & aExpectedState,
OAUTH_AUTHORIZATION_RESPONSE & aResponse,
wxString & aError )
static

◆ SendHttpResponse()

void OAUTH_LOOPBACK_SERVER::SendHttpResponse ( wxSocketBase * aClient,
bool aSuccess )
private

Definition at line 244 of file oauth_loopback_server.cpp.

Referenced by HandleClient().

◆ Shutdown()

void OAUTH_LOOPBACK_SERVER::Shutdown ( )
private

Definition at line 291 of file oauth_loopback_server.cpp.

References m_server.

Referenced by Finish(), and ~OAUTH_LOOPBACK_SERVER().

◆ Start()

bool OAUTH_LOOPBACK_SERVER::Start ( )

Definition at line 79 of file oauth_loopback_server.cpp.

References m_port, m_server, m_timeout, and OnSocketEvent().

Referenced by BOOST_AUTO_TEST_CASE().

Member Data Documentation

◆ m_callbackPath

wxString OAUTH_LOOPBACK_SERVER::m_callbackPath
private

Definition at line 71 of file oauth_loopback_server.h.

Referenced by GetRedirectUri(), HandleClient(), and OAUTH_LOOPBACK_SERVER().

◆ m_done

bool OAUTH_LOOPBACK_SERVER::m_done
private

Definition at line 76 of file oauth_loopback_server.h.

Referenced by Finish(), and OAUTH_LOOPBACK_SERVER().

◆ m_expectedState

wxString OAUTH_LOOPBACK_SERVER::m_expectedState
private

Definition at line 72 of file oauth_loopback_server.h.

Referenced by HandleClient(), and OAUTH_LOOPBACK_SERVER().

◆ m_owner

wxEvtHandler* OAUTH_LOOPBACK_SERVER::m_owner
private

Definition at line 70 of file oauth_loopback_server.h.

Referenced by Finish(), and OAUTH_LOOPBACK_SERVER().

◆ m_port

unsigned short OAUTH_LOOPBACK_SERVER::m_port
private

Definition at line 75 of file oauth_loopback_server.h.

Referenced by GetPort(), GetRedirectUri(), OAUTH_LOOPBACK_SERVER(), and Start().

◆ m_response

std::optional<OAUTH_AUTHORIZATION_RESPONSE> OAUTH_LOOPBACK_SERVER::m_response
private

Definition at line 77 of file oauth_loopback_server.h.

Referenced by Finish(), and HandleClient().

◆ m_server

std::unique_ptr<wxSocketServer> OAUTH_LOOPBACK_SERVER::m_server
private

Definition at line 73 of file oauth_loopback_server.h.

Referenced by OnSocketEvent(), Shutdown(), and Start().

◆ m_timeout

wxTimer OAUTH_LOOPBACK_SERVER::m_timeout
private

The documentation for this class was generated from the following files: