From e54cac4bdc4e6cc96bb4ea92a812c9ef9efd8cb3 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Sat, 9 Feb 2019 23:28:09 -0800 Subject: [PATCH] fix for user exit SSL ID (#2373) * fix for user exit SSL ID * also pass url to HTTP_CLIENT exit --- src/http/zcl_abapgit_http.clas.abap | 9 +++++--- src/zcl_abapgit_exit.clas.abap | 35 ++++++++++++++++------------- src/zif_abapgit_exit.intf.abap | 1 + 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/http/zcl_abapgit_http.clas.abap b/src/http/zcl_abapgit_http.clas.abap index 165132966..f52995290 100644 --- a/src/http/zcl_abapgit_http.clas.abap +++ b/src/http/zcl_abapgit_http.clas.abap @@ -198,10 +198,13 @@ CLASS ZCL_ABAPGIT_HTTP IMPLEMENTATION. " Disable internal auth dialog (due to its unclarity) li_client->propertytype_logon_popup = if_http_client=>co_disabled. - zcl_abapgit_login_manager=>load( iv_uri = iv_url - ii_client = li_client ). + zcl_abapgit_login_manager=>load( + iv_uri = iv_url + ii_client = li_client ). - zcl_abapgit_exit=>get_instance( )->http_client( li_client ). + zcl_abapgit_exit=>get_instance( )->http_client( + iv_url = iv_url + ii_client = li_client ). ro_client->send_receive( ). IF check_auth_requested( li_client ) = abap_true. diff --git a/src/zcl_abapgit_exit.clas.abap b/src/zcl_abapgit_exit.clas.abap index f0380df44..f9c23a7ee 100644 --- a/src/zcl_abapgit_exit.clas.abap +++ b/src/zcl_abapgit_exit.clas.abap @@ -23,7 +23,7 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. IF gi_exit IS INITIAL. TRY. CREATE OBJECT gi_exit TYPE ('ZCL_ABAPGIT_USER_EXIT'). - CATCH cx_sy_create_object_error. + CATCH cx_sy_create_object_error ##NO_HANDLER. ENDTRY. ENDIF. @@ -36,7 +36,7 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. rv_allowed = gi_exit->allow_sap_objects( ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -46,7 +46,7 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. gi_exit->change_local_host( CHANGING ct_hosts = ct_hosts ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -57,10 +57,10 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. gi_exit->change_proxy_authentication( EXPORTING - iv_repo_url = iv_repo_url + iv_repo_url = iv_repo_url CHANGING cv_proxy_authentication = cv_proxy_authentication ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -71,10 +71,10 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. gi_exit->change_proxy_port( EXPORTING - iv_repo_url = iv_repo_url + iv_repo_url = iv_repo_url CHANGING cv_proxy_port = cv_proxy_port ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -85,10 +85,10 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. gi_exit->change_proxy_url( EXPORTING - iv_repo_url = iv_repo_url + iv_repo_url = iv_repo_url CHANGING cv_proxy_url = cv_proxy_url ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -103,7 +103,7 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. io_log = io_log CHANGING ct_tadir = ct_tadir ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -113,7 +113,7 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. ri_client = gi_exit->create_http_client( iv_url ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. @@ -123,18 +123,23 @@ CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION. TRY. rv_ssl_id = gi_exit->get_ssl_id( ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. - rv_ssl_id = 'ANONYM'. + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. + IF rv_ssl_id IS INITIAL. + rv_ssl_id = 'ANONYM'. + ENDIF. + ENDMETHOD. METHOD zif_abapgit_exit~http_client. TRY. - gi_exit->http_client( ii_client ). - CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method. + gi_exit->http_client( + iv_url = iv_url + ii_client = ii_client ). + CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. diff --git a/src/zif_abapgit_exit.intf.abap b/src/zif_abapgit_exit.intf.abap index 8d13dc182..24491b794 100644 --- a/src/zif_abapgit_exit.intf.abap +++ b/src/zif_abapgit_exit.intf.abap @@ -35,6 +35,7 @@ INTERFACE zif_abapgit_exit zcx_abapgit_exception . METHODS http_client IMPORTING + !iv_url TYPE string !ii_client TYPE REF TO if_http_client . METHODS change_tadir IMPORTING