mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 13:03:01 +08:00
parent
b92ec952ab
commit
24c9d03edc
|
@ -1,4 +1,4 @@
|
||||||
"! Default <em>LIF_2FA-AUTHENTICATOR</em> implememtation
|
"! Default {@link ZIF_ABAPGIT_2FA_AUTHENTICATOR} implementation
|
||||||
CLASS zcl_abapgit_2fa_auth_base DEFINITION
|
CLASS zcl_abapgit_2fa_auth_base DEFINITION
|
||||||
PUBLIC
|
PUBLIC
|
||||||
ABSTRACT
|
ABSTRACT
|
||||||
|
@ -17,7 +17,7 @@ CLASS zcl_abapgit_2fa_auth_base DEFINITION
|
||||||
METHODS:
|
METHODS:
|
||||||
"! @parameter iv_supported_url_regex | Regular expression to check if a repository url is
|
"! @parameter iv_supported_url_regex | Regular expression to check if a repository url is
|
||||||
"! supported, used for default implementation of
|
"! supported, used for default implementation of
|
||||||
"! <em>SUPPORTS_URL</em>
|
"! {@link .METH:supports_url}
|
||||||
constructor IMPORTING iv_supported_url_regex TYPE clike.
|
constructor IMPORTING iv_supported_url_regex TYPE clike.
|
||||||
PROTECTED SECTION.
|
PROTECTED SECTION.
|
||||||
CLASS-METHODS:
|
CLASS-METHODS:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
"! Static registry class to find <em>LIF_2FA_AUTHENTICATOR</em> instances
|
"! Static registry class to find {@link ZIF_ABAPGIT_2FA_AUTHENTICATOR} instances
|
||||||
CLASS zcl_abapgit_2fa_auth_registry DEFINITION
|
CLASS zcl_abapgit_2fa_auth_registry DEFINITION
|
||||||
PUBLIC
|
PUBLIC
|
||||||
FINAL
|
FINAL
|
||||||
|
@ -9,8 +9,8 @@ CLASS zcl_abapgit_2fa_auth_registry DEFINITION
|
||||||
class_constructor,
|
class_constructor,
|
||||||
"! Retrieve an authenticator instance by url
|
"! Retrieve an authenticator instance by url
|
||||||
"! @parameter iv_url | Url of the repository / service
|
"! @parameter iv_url | Url of the repository / service
|
||||||
"! @parameter ro_authenticator | Found authenticator instance
|
"! @parameter ri_authenticator | Found authenticator instance
|
||||||
"! @raising lcx_2fa_unsupported | No authenticator found that supports the service
|
"! @raising zcx_abapgit_2fa_unsupported | No authenticator found that supports the service
|
||||||
get_authenticator_for_url IMPORTING iv_url TYPE string
|
get_authenticator_for_url IMPORTING iv_url TYPE string
|
||||||
RETURNING VALUE(ri_authenticator) TYPE REF TO zif_abapgit_2fa_authenticator
|
RETURNING VALUE(ri_authenticator) TYPE REF TO zif_abapgit_2fa_authenticator
|
||||||
RAISING zcx_abapgit_2fa_unsupported,
|
RAISING zcx_abapgit_2fa_unsupported,
|
||||||
|
|
|
@ -6,27 +6,26 @@
|
||||||
"! implementation of the git http api, just like the "normal" password would.
|
"! implementation of the git http api, just like the "normal" password would.
|
||||||
"! </p>
|
"! </p>
|
||||||
"! <p>
|
"! <p>
|
||||||
"! <em>LCL_2FA_AUTHENTICATOR_REGISTRY</em> can be used to find a suitable implementation for a given
|
"! {@link ZCL_ABAPGIT_2FA_AUTH_REGISTRY} can be used to find a suitable implementation for a
|
||||||
"! repository.
|
"! given repository.
|
||||||
"! </p>
|
"! </p>
|
||||||
"! <p>
|
"! <p>
|
||||||
"! Using the <em>begin</em> and <em>end</em> methods an internal session can be started and
|
"! Using the {@link zif_abapgit_2fa_authenticator.METH:begin} and
|
||||||
|
"! {@link zif_abapgit_2fa_authenticator.METH.end} methods an internal session can be started and
|
||||||
"! completed in which internal state necessary for multiple methods will be cached. This can be
|
"! completed in which internal state necessary for multiple methods will be cached. This can be
|
||||||
"! used to avoid having multiple http sessions between <em>authenticate</em> and
|
"! used to avoid having multiple http sessions between
|
||||||
"! <em>delete_access_tokens</em>.
|
"! {@link zif_abapgit_2fa_authenticator.METH:authenticate} and
|
||||||
|
"! {@link zif_abapgit_2fa_authenticator.METH:delete_access_tokens}.
|
||||||
"! </p>
|
"! </p>
|
||||||
INTERFACE zif_abapgit_2fa_authenticator
|
INTERFACE zif_abapgit_2fa_authenticator PUBLIC.
|
||||||
PUBLIC .
|
|
||||||
|
|
||||||
|
|
||||||
"! Generate an access token
|
"! Generate an access token
|
||||||
"! @parameter iv_url | Repository url
|
"! @parameter iv_url | Repository url
|
||||||
"! @parameter iv_username | Username
|
"! @parameter iv_username | Username
|
||||||
"! @parameter iv_password | Password
|
"! @parameter iv_password | Password
|
||||||
"! @parameter iv_2fa_token | Two factor token
|
"! @parameter iv_2fa_token | Two factor token
|
||||||
"! @parameter rv_access_token | Generated access token
|
"! @parameter rv_access_token | Generated access token
|
||||||
"! @raising lcx_2fa_auth_failed | Authentication failed
|
"! @raising zcx_abapgit_2fa_auth_failed | Authentication failed
|
||||||
"! @raising lcx_2fa_token_gen_failed | Token generation failed
|
"! @raising zcx_abapgit_2fa_gen_failed | Token generation failed
|
||||||
METHODS authenticate
|
METHODS authenticate
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_url TYPE string
|
!iv_url TYPE string
|
||||||
|
@ -39,7 +38,7 @@ INTERFACE zif_abapgit_2fa_authenticator
|
||||||
zcx_abapgit_2fa_auth_failed
|
zcx_abapgit_2fa_auth_failed
|
||||||
zcx_abapgit_2fa_gen_failed
|
zcx_abapgit_2fa_gen_failed
|
||||||
zcx_abapgit_2fa_comm_error .
|
zcx_abapgit_2fa_comm_error .
|
||||||
"! Check if this authenticator instance supports the give repository url
|
"! Check if this authenticator instance supports the given repository url
|
||||||
"! @parameter iv_url | Repository url
|
"! @parameter iv_url | Repository url
|
||||||
"! @parameter rv_supported | Is supported
|
"! @parameter rv_supported | Is supported
|
||||||
METHODS supports_url
|
METHODS supports_url
|
||||||
|
@ -66,8 +65,8 @@ INTERFACE zif_abapgit_2fa_authenticator
|
||||||
"! @parameter iv_username | Username
|
"! @parameter iv_username | Username
|
||||||
"! @parameter iv_password | Password
|
"! @parameter iv_password | Password
|
||||||
"! @parameter iv_2fa_token | Two factor token
|
"! @parameter iv_2fa_token | Two factor token
|
||||||
"! @raising lcx_2fa_token_del_failed | Token deletion failed
|
"! @raising zcx_abapgit_2fa_del_failed | Token deletion failed
|
||||||
"! @raising lcx_2fa_auth_failed | Authentication failed
|
"! @raising zcx_abapgit_2fa_auth_failed | Authentication failed
|
||||||
METHODS delete_access_tokens
|
METHODS delete_access_tokens
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_url TYPE string
|
!iv_url TYPE string
|
||||||
|
@ -79,12 +78,12 @@ INTERFACE zif_abapgit_2fa_authenticator
|
||||||
zcx_abapgit_2fa_comm_error
|
zcx_abapgit_2fa_comm_error
|
||||||
zcx_abapgit_2fa_auth_failed .
|
zcx_abapgit_2fa_auth_failed .
|
||||||
"! Begin an authenticator session that uses internal caching for authorizations
|
"! Begin an authenticator session that uses internal caching for authorizations
|
||||||
"! @raising lcx_2fa_illegal_state | Session already started
|
"! @raising zcx_abapgit_2fa_illegal_state | Session already started
|
||||||
METHODS begin
|
METHODS begin
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_2fa_illegal_state .
|
zcx_abapgit_2fa_illegal_state .
|
||||||
"! End an authenticator session and clear internal caches
|
"! End an authenticator session and clear internal caches
|
||||||
"! @raising lcx_2fa_illegal_state | Session not running
|
"! @raising zcx_abapgit_2fa_illegal_state | Session not running
|
||||||
METHODS end
|
METHODS end
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_2fa_illegal_state .
|
zcx_abapgit_2fa_illegal_state .
|
||||||
|
|
Loading…
Reference in New Issue
Block a user