项目作者: 18F

项目描述 :
delegate ID proofing to vendors
高级语言: Ruby
项目地址: git://github.com/18F/identity-proofer-gem.git
创建时间: 2016-06-07T21:24:23Z
项目社区:https://github.com/18F/identity-proofer-gem

开源协议:Other

下载


Identity Proofer Ruby Gem

Build Status
security

Example proofing session

  1. # Create a proofer subclass:
  2. class FooProofer < Proofer::Base
  3. vendor_name 'foo:resolution'
  4. attributes :uuid,
  5. :first_name,
  6. :last_name,
  7. :ssn,
  8. :dob
  9. stage :resolution
  10. proof :foo_proof # this also takes a block
  11. def foo_proof(applicant, result)
  12. resolution = get_resolution # resolve the identity
  13. # if something isn't verified, add an error
  14. result.add_error(:first_name, 'Does not match')
  15. # if something goes wrong, raise an error
  16. raise 'failed to auth with the proofing vendor'
  17. end
  18. end
  19. # Use a vendor subclass
  20. result = FooProofer.new.proof(
  21. uuid: '1234-asdf-5678-qwerty',
  22. first_name: 'Bob',
  23. last_name: 'Roberts',
  24. ssn: '123456789',
  25. dob: '01/01/1980'
  26. )
  27. result.success? # returns true or false
  28. result.failed? # returns true or false
  29. result.errors # returns a hash of errors, e.g. { first_name: ['Does not match'] }
  30. result.exception # returns any object that was raised during the `#proof` call

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0
dedication. By submitting a pull request, you are agreeing to comply
with this waiver of copyright interest.