项目作者: atudor2

项目描述 :
Pwned Passwords for ABAP
高级语言: ABAP
项目地址: git://github.com/atudor2/abap-pwnedpasswords.git
创建时间: 2019-01-21T08:16:52Z
项目社区:https://github.com/atudor2/abap-pwnedpasswords

开源协议:MIT License

下载


abap-pwnedpasswords

Pwned Passwords implementation for ABAP

abap package version

Built and tested with ABAP 7.52 SP01, but should work with any releases >= 7.50

Overview

Simple ABAP wrapper for the Pwned Passwords API V2 REST API provided by Troy Hunt.

Setup SSL

The SSL Certificates for https://api.pwnedpasswords.com/ must be added to STRUST before the API can be called.

The abapGit SSL Setup Guide provides the steps to do this.

Use the certificate from https://api.pwnedpasswords.com/ instead of GitHub

Usage

  1. DATA(pwn_passwords) = zcl_pwned_passwords=>create( ).
  2. " Check if password has been Pwned:
  3. DATA(password) = ||.
  4. cl_demo_input=>request(
  5. EXPORTING text = 'Enter Password:'
  6. CHANGING field = password ).
  7. DATA(is_pwned) = pwn_passwords->is_password_pwned( i_password = password ).
  8. cl_demo_output=>display(
  9. EXPORTING
  10. data = |{ COND #( WHEN is_pwned = abap_true THEN 'Password is PWNED' ELSE 'Password is safe...for now' ) }|
  11. name = 'IS_PWNED' ).
  12. " Check if password has been Pwned and get details:
  13. DATA(pwned_password_details) = pwn_passwords->get_password_status( i_password = password ).
  14. cl_demo_output=>display(
  15. EXPORTING
  16. data = pwned_password_details
  17. name = 'PWNED_PASSWORD_DETAILS' ).