Module: SelfSDK
- Defined in:
- lib/acl.rb,
lib/log.rb,
lib/client.rb,
lib/crypto.rb,
lib/ntptime.rb,
lib/selfsdk.rb,
lib/sources.rb,
lib/messaging.rb,
lib/jwt_service.rb,
lib/authenticated.rb,
lib/messages/base.rb,
lib/messages/fact.rb,
lib/services/auth.rb,
lib/services/facts.rb,
lib/signature_graph.rb,
lib/messages/message.rb,
lib/services/identity.rb,
lib/services/messaging.rb,
lib/messages/attestation.rb,
lib/messages/fact_request.rb,
lib/messages/fact_response.rb,
lib/messages/authentication_req.rb,
lib/messages/authentication_resp.rb,
lib/messages/authentication_message.rb
Overview
Namespace for classes and modules that handle SelfSDK gem
Defined Under Namespace
Modules: Messages, Services
Classes: ACL, App, Authenticated, Crypto, JwtService, Key, MessagingClient, Operation, RestClient, SignatureGraph, Time
Constant Summary
collapse
- FACT_EMAIL =
"email_address"
- FACT_PHONE =
"phone_number"
- FACT_DISPLAY_NAME =
"display_name"
- FACT_DOCUMENT_NUMBER =
"document_number"
- FACT_GIVEN_NAMES =
"given_names"
- FACT_SURNAME =
"surname"
- FACT_SEX =
"sex"
- FACT_ISSUING_AUTHORITY =
"issuing_authority"
- FACT_NATIONALITY =
"nationality"
- FACT_ADDRESS =
"address"
- FACT_PLACE_OF_BIRTH =
"place_of_birth"
- FACT_DATE_OF_BIRTH =
"date_of_birth"
- FACT_DATE_OF_ISSUANCE =
"date_of_issuance"
- FACT_DATE_OF_EXPIRATION =
"date_of_expiration"
- SOURCE_USER_SPECIFIED =
"user_specified"
- SOURCE_PASSPORT =
"passport"
- SOURCE_DRIVING_LICENSE =
"driving_license"
- ACTION_ADD =
"key.add"
- ACTION_REVOKE =
"key.revoke"
- KEY_TYPE_DEVICE =
"device.key"
- KEY_TYPE_RECOVERY =
"recovery.key"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.logger ⇒ Object
9
10
11
12
13
|
# File 'lib/log.rb', line 9
def logger
@logger ||= ::Logger.new($stdout).tap do |log|
log.progname = name
end
end
|
Class Method Details
.fact_name(input) ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/sources.rb', line 43
def fact_name(input)
facts = { email_address: FACT_EMAIL,
phone_number: FACT_PHONE,
display_name: FACT_DISPLAY_NAME,
document_number: FACT_DOCUMENT_NUMBER,
given_names: FACT_GIVEN_NAMES,
surname: FACT_SURNAME,
sex: FACT_SEX,
issuing_authority: FACT_ISSUING_AUTHORITY,
nationality: FACT_NATIONALITY,
address: FACT_ADDRESS,
place_of_birth: FACT_PLACE_OF_BIRTH,
date_of_birth: FACT_DATE_OF_BIRTH,
date_of_issuance: FACT_DATE_OF_ISSUANCE,
date_of_expiration: FACT_DATE_OF_EXPIRATION }
get(facts, input, "fact")
end
|
.get(options, input, option_type) ⇒ Object
68
69
70
71
72
73
74
75
|
# File 'lib/sources.rb', line 68
def get(options, input, option_type)
if input.is_a? Symbol
raise "invalid #{option_type} '#{input.to_s}'" unless options.key? input
return options[input]
end
raise "invalid #{option_type} '#{input}'" unless options.values.include? input
input
end
|
.message_type(s) ⇒ Object
.operator(input) ⇒ Object
33
34
35
36
37
38
39
40
41
|
# File 'lib/sources.rb', line 33
def operator(input)
operators = { equals: '==',
different: '!=',
great_or_equal_than: '>=',
less_or_equal: '<=',
great_than: '>',
less_than: '<' }
get(operators, input, "operator")
end
|