Changeset 88929 in webkit


Ignore:
Timestamp:
Jun 15, 2011 7:49:57 AM (13 years ago)
Author:
demarchi@webkit.org
Message:

2011-06-15 Kamil Blank <k.blank@samsung.com>

Reviewed by Kenneth Rohde Christiansen.

[EFL] Soup authentication feature implementation.
https://bugs.webkit.org/show_bug.cgi?id=54752

This implementation is based on GTK implementation.
During ewk initialization SoupSessionFeature is added which provides possibility to handle HTTP basic auth.

To support authentication we have to set function (callback) via ewk_auth_show_dialog_callback_set()
which will be responsible for session authentication.
If callback is set and authentication required - webkit pauses soup message, calls previously set callback
and waits for authentication data (username/password) which should be passed by ewk_auth_credentials_set().

  • CMakeListsEfl.txt:
  • ewk/ewk_auth.cpp: Added. (ewk_auth_show_dialog_callback_set): Setting callback which should be called when authentication is required. (ewk_auth_credentials_set): Passing authentication data.
  • ewk/ewk_auth.h: Added. Authentication API.
  • ewk/ewk_auth_soup.cpp: Added. Soup authentication implementation. (_Ewk_Auth_Data::ewk_auth_soup_dialog_class_init): (_Ewk_Auth_Data::ewk_auth_soup_dialog_init): (_Ewk_Auth_Data::ewk_auth_soup_dialog_session_feature_init): (_Ewk_Auth_Data::ewk_auth_soup_show_dialog_callback_set): (_Ewk_Auth_Data::ewk_auth_soup_credentials_set): (_Ewk_Auth_Data::session_authenticate): (_Ewk_Auth_Data::free_auth_data): (_Ewk_Auth_Data::attach): (_Ewk_Auth_Data::detach):
  • ewk/ewk_auth_soup.h: Added.
  • ewk/ewk_main.cpp: (_ewk_init_body): SoupSessionFeature responsible for authentication added to SoupSession.
Location:
trunk/Source/WebKit/efl
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/CMakeListsEfl.txt

    r85651 r88929  
    101101  LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${LIBSOUP24_INCLUDE_DIRS})
    102102  LIST(APPEND WebKit_LIBRARIES ${LIBSOUP24_LIBRARIES})
     103  LIST(APPEND WebKit_SOURCES
     104    efl/ewk/ewk_auth.cpp
     105    efl/ewk/ewk_auth_soup.cpp
     106  )
    103107ENDIF ()
    104108
  • trunk/Source/WebKit/efl/ChangeLog

    r88928 r88929  
     12011-06-15  Kamil Blank  <k.blank@samsung.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [EFL] Soup authentication feature implementation.
     6        https://bugs.webkit.org/show_bug.cgi?id=54752
     7
     8        This implementation is based on GTK implementation.
     9        During ewk initialization SoupSessionFeature is added which provides possibility to handle HTTP basic auth.
     10
     11        To support authentication we have to set function (callback) via ewk_auth_show_dialog_callback_set()
     12        which will be responsible for session authentication.
     13        If callback is set and authentication required - webkit pauses soup message, calls previously set callback
     14        and waits for authentication data (username/password) which should be passed by ewk_auth_credentials_set().
     15
     16        * CMakeListsEfl.txt:
     17        * ewk/ewk_auth.cpp: Added.
     18        (ewk_auth_show_dialog_callback_set): Setting callback which should be called when authentication is required.
     19        (ewk_auth_credentials_set): Passing authentication data.
     20        * ewk/ewk_auth.h: Added. Authentication API.
     21        * ewk/ewk_auth_soup.cpp: Added. Soup authentication implementation.
     22        (_Ewk_Auth_Data::ewk_auth_soup_dialog_class_init):
     23        (_Ewk_Auth_Data::ewk_auth_soup_dialog_init):
     24        (_Ewk_Auth_Data::ewk_auth_soup_dialog_session_feature_init):
     25        (_Ewk_Auth_Data::ewk_auth_soup_show_dialog_callback_set):
     26        (_Ewk_Auth_Data::ewk_auth_soup_credentials_set):
     27        (_Ewk_Auth_Data::session_authenticate):
     28        (_Ewk_Auth_Data::free_auth_data):
     29        (_Ewk_Auth_Data::attach):
     30        (_Ewk_Auth_Data::detach):
     31        * ewk/ewk_auth_soup.h: Added.
     32        * ewk/ewk_main.cpp:
     33        (_ewk_init_body): SoupSessionFeature responsible for authentication added to SoupSession.
     34
    1352011-06-15  Sheriff Bot  <webkit.review.bot@gmail.com>
    236
  • trunk/Source/WebKit/efl/ewk/ewk_main.cpp

    r88241 r88929  
    5454// REMOVE-ME: see todo below
    5555#include "ResourceHandle.h"
     56#include "ewk_auth_soup.h"
    5657#include <libsoup/soup.h>
    5758#endif
     
    211212        soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
    212213        soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER);
     214
     215        SoupSessionFeature* auth_dialog = static_cast<SoupSessionFeature*>(g_object_new(EWK_TYPE_SOUP_AUTH_DIALOG, 0));
     216        soup_session_add_feature(session, auth_dialog);
    213217    }
    214218#endif
     
    216220    return EINA_TRUE;
    217221}
    218 
Note: See TracChangeset for help on using the changeset viewer.