passbyme2fa-client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/passbyme2fa-client/http_error.rb +11 -0
- data/lib/passbyme2fa-client/json_helper.rb +5 -0
- data/lib/passbyme2fa-client/passbyme_error.rb +11 -0
- data/lib/passbyme2fa-client/recipient_status.rb +13 -0
- data/lib/passbyme2fa-client/session_info.rb +34 -0
- data/lib/passbyme2fa-client/truststore.pem +270 -0
- data/lib/passbyme2fa-client.rb +134 -0
- metadata +107 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f9f25bb079fb8d477b3f0c0229e3ebde10cfe4c7
|
4
|
+
data.tar.gz: 8e900eacbd2e8e6d0a8c5257a754bffe0561fcd0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 43848b29105de3b7668b308ff325c72aa1082a1f967e046338cffbce599716b08db8b9e7a25cb7079eb2ce3f454c8bfcde09c088a1ac1f1cbd45c10bd9621608
|
7
|
+
data.tar.gz: 6d6ceca96c4fb4d1ae036e3ae1eb346eea901836132eabb005579e5915ef7116d0a6a9b90edd495c04e1ce428f36cd73b0c0b1a42e8a8f76de6c46918db51abc
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'time'
|
2
|
+
require_relative 'json_helper'
|
3
|
+
require_relative 'recipient_status'
|
4
|
+
|
5
|
+
class SessionInfo
|
6
|
+
include JSONHelper
|
7
|
+
|
8
|
+
attr_reader :message_id, :expiration_date, :recipient_statuses
|
9
|
+
|
10
|
+
def initialize(json, pbm_client)
|
11
|
+
re_initialize(json)
|
12
|
+
@pbm_client = pbm_client
|
13
|
+
if !@pbm_client
|
14
|
+
raise ArgumentError.new("PassBy[ME] client is missing.")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def re_initialize(json)
|
19
|
+
@message_id = get_json_field(json, "messageId")
|
20
|
+
@expiration_date = Time.parse(get_json_field(json, "expirationDate"))
|
21
|
+
@recipient_statuses = get_json_field(json, "recipients").collect { |recipient|
|
22
|
+
RecipientStatus.new(recipient)
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def refresh
|
27
|
+
@pbm_client.track_message(self)
|
28
|
+
end
|
29
|
+
|
30
|
+
def cancel
|
31
|
+
@pbm_client.cancel_message(self)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,270 @@
|
|
1
|
+
Bag Attributes
|
2
|
+
friendlyName: test passbyme root ca v1
|
3
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
4
|
+
subject=/C=HU/L=Budapest/O=Microsec Ltd./OU=PassByMe IDP/CN=PassByMe Root CA v1
|
5
|
+
issuer=/C=HU/L=Budapest/O=Microsec Ltd./OU=PassByMe IDP/CN=PassByMe Root CA v1
|
6
|
+
-----BEGIN CERTIFICATE-----
|
7
|
+
MIIFvzCCA6egAwIBAgIIfDYY3J+IET8wDQYJKoZIhvcNAQELBQAwbTELMAkGA1UE
|
8
|
+
BhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRYwFAYDVQQKDA1NaWNyb3NlYyBMdGQu
|
9
|
+
MRUwEwYDVQQLDAxQYXNzQnlNZSBJRFAxHDAaBgNVBAMME1Bhc3NCeU1lIFJvb3Qg
|
10
|
+
Q0EgdjEwHhcNMTQwNzAzMTI0NzIyWhcNMzUxMjMxMTAwMDAwWjBtMQswCQYDVQQG
|
11
|
+
EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4x
|
12
|
+
FTATBgNVBAsMDFBhc3NCeU1lIElEUDEcMBoGA1UEAwwTUGFzc0J5TWUgUm9vdCBD
|
13
|
+
QSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALOcx9GZYg1L7aRG
|
14
|
+
fEWAfpx66hnWAmlJcz0ZgslKOi/ILhszuFxkKzgvCoTD/HfkFyKJc0w0tbMoFmC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ekwtGJsxO61bNx5bQyV4MBXV1CLQnPK
|
30
|
+
WdAO/h9euKQX/0jbqeqaohF4GtzcATqdnZLaCgOuVVkpKaEorefdwpUhXpXE5V5E
|
31
|
+
sdyuhySnR3rcXeE2KODtMk5VAR4T4uYLJZk2RiYJLcd2ikyAZNWlqILubeADxxk6
|
32
|
+
DWf5oo0fkjkG2R1ZLLuObnsUlNQvLAxg/yWHDKKz4kbJ0WPSHYj8cyc9Ifu9AZH/
|
33
|
+
zlwz1pF2XAVMVYzI2v6aOG1s45OFngNX1m/G9+q2BuXKHoIwhmcgTXG0Zoi3cwSC
|
34
|
+
D7pso2F4t1FK+/H8fYxDLSQ1iJjXNJmTeGYOlpJ15vuBtyqZYvExx9KoSt2PXX2R
|
35
|
+
umYZS1n1ryLV/OGvy0UVhAYFKnrPZ8kPpZIu7hwJZLN4WTnBL9gttqkX/YHAAsDJ
|
36
|
+
l2S6Kfex9pM90NuTbWfiL2H5FWkX4dIPq6ECDg69hEQnkgUpPmM/RE++mdLnEDcf
|
37
|
+
MOQqkF3YmY+RvSPLp2m/ATPW+xwzaCrwowD/1p2ZOh+ujNo=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
Bag Attributes
|
40
|
+
friendlyName: passbyme root ca 2015
|
41
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
42
|
+
subject=/C=HU/O=Microsec Ltd./CN=PassByME Root CA 2015
|
43
|
+
issuer=/C=HU/O=Microsec Ltd./CN=PassByME Root CA 2015
|
44
|
+
-----BEGIN CERTIFICATE-----
|
45
|
+
MIIFcDCCA1igAwIBAgIJAM66uknMIWYbMA0GCSqGSIb3DQEBDQUAMEUxCzAJBgNV
|
46
|
+
BAYTAkhVMRYwFAYDVQQKDA1NaWNyb3NlYyBMdGQuMR4wHAYDVQQDDBVQYXNzQnlN
|
47
|
+
RSBSb290IENBIDIwMTUwHhcNMTUwMTI0MjAyNjA0WhcNMzgwMTE4MjAyNjA0WjBF
|
48
|
+
MQswC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wDgYDVR0PAQH/BAQDAgEG
|
63
|
+
MA0GCSqGSIb3DQEBDQUAA4ICAQC8DIh1vp9Txb+sFhcRgfvNkrakNtwMLy54RGp/
|
64
|
+
ZQI4lB6NhanfsHVZQ5DpnW2L6/6NwjnYuK2aIfEV1pKRLzAhxVG7a7ANO4SKtJbm
|
65
|
+
60B3kuAhLtrmNvrjhyfZo48gHOql1UIaIun2AGxe2mmbyXHvtQUa5oBR0/ZfIWOC
|
66
|
+
PLYCIC5p/RSmB5aN/zYTF4lKeeL40SunSEk8z1890R4PRNduneYtjhrpr/m/t9ZT
|
67
|
+
pLl0vCyzwP5Fc8mByt63GoHvgXuj7OwiUWIOVhzf8bJK8+BxJASypHkAzh3z5now
|
68
|
+
D2KpV0R8uaWTvExwY7+FP9dd7FR0hj4TPtLCrT2AtGd+2arhgKyUxP64xqOkTJ6N
|
69
|
+
4rpVTK0hqJDCuxL+idLP3xR4QAqHTQdbohnzDHDfVc/P5JdK5hIisqoJx9v2+zdk
|
70
|
+
ldP69oEtvfEO5tQmvbJUISl3ffNJ2ojFk6WC7VNILN+ErK4LunTcWVM24z1MzPx1
|
71
|
+
sb7AZixKnosiX/s2jN3xPqTr70oFTXBpnXejQ2yivIx5P/C0gGd4neXmKb/dSsvB
|
72
|
+
u3P7LGjq+MGPtHfFc4MT91BMz+aYHSfU3Bf2LD2dujl7hNzJsSmekIlkXpJVqjw9
|
73
|
+
OS0YJWjisHZDw2RmaGq4s3zRw3Wjnw1py+fbL2YM0SNQk815lGcvQUeSaFu+GJEJ
|
74
|
+
8mIKnQ==
|
75
|
+
-----END CERTIFICATE-----
|
76
|
+
Bag Attributes
|
77
|
+
friendlyName: passbyme ca2 (passbyme root ca 2015)
|
78
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
79
|
+
subject=/C=HU/O=Microsec Ltd./CN=PassByME CA2
|
80
|
+
issuer=/C=HU/O=Microsec Ltd./CN=PassByME Root CA 2015
|
81
|
+
-----BEGIN CERTIF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
111
|
+
ho7RDabnxK3NNlVExkt54ZH4PfUrJ8cEvmj7BlePTbd+wPAKf1w6yTXr8W7yAr3H
|
112
|
+
5agg+mu9Pivmnxf7+dRZ/b2wpXAxVAqc61st9e1WwTrzCJxbi19Nj05d4PRFrUyB
|
113
|
+
jiK/GK2NYGFY05QbdxT7lD8Qcb8RCYEJaM4rbmR8CFTrMOYlgQvOQjoq1oqC+6tg
|
114
|
+
1nExQHa1MAmBUbiFG+7Cw1vQQTIJgaGHXb1rG5HTNBIttEpgSvnlX5ptAvahYOEH
|
115
|
+
M++fUlrbCDYEiEcOS6ZxRinMP1zxbCfpJ/h+huhgRxva13gmXidYklR1lBPoO1RI
|
116
|
+
SHgUM1uF9dNm5KGyrXCpgKbfDiuccti1D8Clugq6jWUd45zoNYLpem4CNGoH41od
|
117
|
+
GUWrF4GDCpqlKB4xwO30MCQPMJCu5DNa0/tW+7GVtcHzcOE67Gejj+exRMfxR7bt
|
118
|
+
tWeOgg==
|
119
|
+
-----END CERTIFICATE-----
|
120
|
+
Bag Attributes
|
121
|
+
friendlyName: passbyme ca1 (passbyme root ca 2015)
|
122
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
123
|
+
subject=/C=HU/O=Microsec Ltd./CN=PassByME CA1
|
124
|
+
issuer=/C=HU/O=Microsec Ltd./CN=PassByME Root CA 2015
|
125
|
+
-----BEGIN CERTIFICATE-----
|
126
|
+
MIIGwDCCBKigAwIBAgIMWLGF3JeUArF+mXIKMA0GCSqGSIb3DQEBCwUAMEUxCzAJ
|
127
|
+
BgNVBAYTAkhVMRYwFAYDVQQKDA1NaWNyb3NlYyBMdGQuMR4wHAYDVQQDDBVQYXNz
|
128
|
+
QnlNRSBSb290IENBIDIwMTUwHhcNMTUwMTI0MjI1MzE0WhcNMzgwMTEzMjI1MzE0
|
129
|
+
WjA8MQswCQYDVQQGEwJIVTEWMBQGA1UECgwNTWljcm9zZWMgTHRkLjEVMBMGA1UE
|
130
|
+
AwwMUGF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wJUrY7r8egIf+ey8KWAj7+zoqMWAye+EUTUP4
|
160
|
+
OAAIwCWxGcS3BOfSMB4ySEbpjGHNjY9Br2AGyySaPGunQsVJ9N2ZtOHsnNEFWyQS
|
161
|
+
b6yfrbXTRRZ2audtckbt0OqObInv0gCJEDXVIYHdchWL1l0bHOqdrNMJMxKmORgf
|
162
|
+
PeCKiA==
|
163
|
+
-----END CERTIFICATE-----
|
164
|
+
Bag Attributes
|
165
|
+
friendlyName: test passbyme ca1 (passbyme root ca v1)
|
166
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
167
|
+
subject=/C=HU/L=Budapest/O=Microsec Ltd./OU=PassByMe IDP/CN=PassByMe CA1
|
168
|
+
issuer=/C=HU/L=Budapest/O=Microsec Ltd./OU=PassByMe IDP/CN=PassByMe Root CA v1
|
169
|
+
-----BEGIN CERTIFICATE-----
|
170
|
+
MIIFVDCCAzygAwIBAgIIARc1L1fBPj8wDQYJKoZIhvcNAQELBQAwbTELMAkGA1UE
|
171
|
+
BhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRYwFAYDVQQKDA1NaWNyb3NlYyBMdGQu
|
172
|
+
MRUwEwYDVQQLDAxQYXNzQnlNZSBJRFAxHDAaBgNVBAMME1Bhc3NCeU1lIFJvb3Qg
|
173
|
+
Q0EgdjEwHhcNMTQwNzAzMTMwMzI0WhcNMzUxMjMwMTAwMDAwWjBmMQswCQYDVQQG
|
174
|
+
EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4x
|
175
|
+
FTATBgNVBAsMDFBhc3NCeU1lIElEUDEVMBMGA1UEAwwMUGFzc0J5TWUgQ0ExMIIB
|
176
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvw2icL+VhBMYpqY2TQlThW4p
|
177
|
+
pP8o4noUzF371CWpGyXjviyupnyEfYG4boGOzhPxAv5TtBl06WtKaI6jJK2do+Hy
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ATbZCSI16RWNycq3uCqabpmEvYSwuu9VrtpAn9XeU
|
193
|
+
f64k0Aw0dBpMufGpfWWZkeFdMOfvM0cjZq7rLT6qGaQ/kA4adeqKkNKGeLEJiKkl
|
194
|
+
J6MGOWipmgqCIii9ncAE+PW+KZKvQMsI58JZmHst56fcjuBnbCqlS2l9foPeA5KT
|
195
|
+
Gbp7vdn8YvMfNgXgbL7eeGIYl1gD41W1Ue9KTSWinTIuA34h2AL4iewQ//Iz/QQj
|
196
|
+
yR6V1JQ3XHOpHVxoQV4bkeMve5HmkByZuVoYvAt5bF+o3JSgg57wkz1zlsdhSlrb
|
197
|
+
f5uuGPvnJElM6foV5ulC+D3OifD3+kHhHLvPQ2fsKxyiJhi8ndSUtptIWmZvS46R
|
198
|
+
9fDYHR3h9Ycb71SESDufRAnrvGJ103+6
|
199
|
+
-----END CERTIFICATE-----
|
200
|
+
Bag Attributes
|
201
|
+
friendlyName: microsec e-szigno root ca 2009
|
202
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
203
|
+
subject=/C=HU/L=Budapest/O=Microsec Ltd./CN=Microsec e-Szigno Root CA 2009/emailAddress=info@e-szigno.hu
|
204
|
+
issuer=/C=HU/L=Budapest/O=Microsec Ltd./CN=Microsec e-Szigno Root CA 2009/emailAddress=info@e-szigno.hu
|
205
|
+
-----BEGIN CERTIFICATE-----
|
206
|
+
MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD
|
207
|
+
VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0
|
208
|
+
ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G
|
209
|
+
CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y
|
210
|
+
OTEyMzAxMTMwMThaMIGCMQsw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XITwfn4fs775
|
225
|
+
tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c
|
226
|
+
2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t
|
227
|
+
HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW
|
228
|
+
-----END CERTIFICATE-----
|
229
|
+
Bag Attributes
|
230
|
+
friendlyName: e-szigno ssl ca 2014 (microsec e-szigno root ca 2009)
|
231
|
+
2.16.840.1.113894.746875.1.1: <Unsupported tag 6>
|
232
|
+
subject=/C=HU/L=Budapest/O=Microsec Ltd./CN=e-Szigno SSL CA 2014/emailAddress=info@e-szigno.hu
|
233
|
+
issuer=/C=HU/L=Budapest/O=Microsec Ltd./CN=Microsec e-Szigno Root CA 2009/emailAddress=info@e-szigno.hu
|
234
|
+
-----BEGIN CERTIFICATE-----
|
235
|
+
MIIGXjCCBUagAwIBAgIMU1zSo6wT2dxKS4MKMA0GCSqGSIb3DQEBCwUAMIGCMQsw
|
236
|
+
CQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2Vj
|
237
|
+
IEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEf
|
238
|
+
MB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0xNDA3MDgxNDM1MjFa
|
239
|
+
Fw0yOTEyMjkxNDM1MjFaMHgxCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVz
|
240
|
+
dDEWMBQGA1UECgwNTWljcm9zZWMgTHRkLjEdMBsGA1UEAwwUZS1Temlnbm8gU1NM
|
241
|
+
IENBIDIwMTQxHzAdBgkqhkiG9w0BCQEWEGluZm9AZS1zemlnbm8uaHUwggEiMA0G
|
242
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggE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c3AxLmUtc3ppZ25vLmh1MC8GCCsGAQUFBzABhiNodHRwOi8vcm9vdGNhMjAw
|
258
|
+
OS1vY3NwMi5lLXN6aWduby5odTAvBggrBgEFBQcwAYYjaHR0cDovL3Jvb3RjYTIw
|
259
|
+
MDktb2NzcDMuZS1zemlnbm8uaHUwPAYIKwYBBQUHMAKGMGh0dHA6Ly9yb290Y2Ey
|
260
|
+
MDA5LWNhMS5lLXN6aWduby5odS9yb290Y2EyMDA5LmNydDA8BggrBgEFBQcwAoYw
|
261
|
+
aHR0cDovL3Jvb3RjYTIwMDktY2EyLmUtc3ppZ25vLmh1L3Jvb3RjYTIwMDkuY3J0
|
262
|
+
MDwGCCsGAQUFBzAChjBodHRwOi8vcm9vdGNhMjAwOS1jYTMuZS1zemlnbm8uaHUv
|
263
|
+
cm9vdGNhMjAwOS5jcnQwDQYJKoZIhvcNAQELBQADggEBALEgpxbV/mGh1vWAO8dx
|
264
|
+
ONwv+aP7Nb5dXTP0YjtrIE6a5zV+IpXK+inu+OJftAHV0an32ovpzpta2EvR5ci/
|
265
|
+
C7o9h8eyforkTxMDndPwZ97ey/5qaz48t7wdz6w6YXCs5LpMzU4BmG+ubTdGNZQv
|
266
|
+
w6cwlxRl3p2KZTZbyJj7t3fM5JcrKVwn8844bfFTKSQni90xzxiO8bz5LjFoDMii
|
267
|
+
vCKKMZXHpZMEi4QsyEKT6sqT+RXp8dsRrdJ/klSu8kUQu4xyWTTTMVs9cCG7ZxzR
|
268
|
+
VyNLg3Rc7vMcYCe5KOiP+H1y0pR9FRSGqMS7Rwa0A4J5nMlGKogQ5R/pp715cMbK
|
269
|
+
mpQ=
|
270
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'openssl'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
require_relative 'passbyme2fa-client/http_error'
|
6
|
+
require_relative 'passbyme2fa-client/passbyme_error'
|
7
|
+
require_relative 'passbyme2fa-client/session_info'
|
8
|
+
|
9
|
+
class PassByME2FAClient
|
10
|
+
|
11
|
+
VERSION = "1.0.0"
|
12
|
+
|
13
|
+
module MessageType
|
14
|
+
AUTHORIZATION = "authorization"
|
15
|
+
MESSAGE = "message"
|
16
|
+
ESIGN = "esign"
|
17
|
+
end
|
18
|
+
|
19
|
+
module MessageStatus
|
20
|
+
PENDING = "PENDING"
|
21
|
+
NOTIFIED = "NOTIFIED"
|
22
|
+
DOWNLOADED = "DOWNLOADED"
|
23
|
+
SEEN = "SEEN"
|
24
|
+
NOT_SEEN = "NOT_SEEN"
|
25
|
+
NOT_NOTIFIED = "NOT_NOTIFIED"
|
26
|
+
NOT_DOWNLOADED = "NOT_DOWNLOADED"
|
27
|
+
NO_DEVICE = "NO_DEVICE"
|
28
|
+
FAILED = "FAILED"
|
29
|
+
DISABLED = "DISABLED"
|
30
|
+
CANCELLED = "CANCELLED"
|
31
|
+
APPROVED = "APPROVED"
|
32
|
+
DENIED = "DENIED"
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(http_options)
|
36
|
+
if !http_options.include? :key or !http_options.include? :cert
|
37
|
+
raise ArgumentError.new("SSL key or certificate is missing!")
|
38
|
+
end
|
39
|
+
url = (http_options.include?(:address) ? http_options[:address] : "auth-sp.passbyme.com")
|
40
|
+
http_options.delete :address
|
41
|
+
@http = Net::HTTP.start(url, http_options.merge({
|
42
|
+
:use_ssl => true,
|
43
|
+
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
|
44
|
+
:ca_file => File.expand_path("../passbyme2fa-client/truststore.pem", __FILE__),
|
45
|
+
}))
|
46
|
+
end
|
47
|
+
|
48
|
+
def send_message(params)
|
49
|
+
recipients = params[:recipients]
|
50
|
+
subject = params[:subject]
|
51
|
+
body = params[:body]
|
52
|
+
availability = params[:availability]
|
53
|
+
type = params[:type]
|
54
|
+
callbackUrl = params[:callbackUrl]
|
55
|
+
|
56
|
+
if recipients.nil? or recipients.length == 0
|
57
|
+
raise ArgumentError.new("Missing recipients!")
|
58
|
+
end
|
59
|
+
|
60
|
+
availability = availability.to_i
|
61
|
+
if availability < 1
|
62
|
+
raise ArgumentError.new("Availability must be an integer greater than 0.")
|
63
|
+
end
|
64
|
+
|
65
|
+
raise ArgumentError.new("Invalid message type #{type}.") unless MessageType.constants.index { |ct|
|
66
|
+
MessageType.const_get(ct) == type
|
67
|
+
}
|
68
|
+
|
69
|
+
req = Net::HTTP::Post.new("/frontend/messages", "Content-Type" => "application/json")
|
70
|
+
req.body = {
|
71
|
+
:recipients => recipients,
|
72
|
+
:subject => subject,
|
73
|
+
:body => body,
|
74
|
+
:availability => availability,
|
75
|
+
:type => type,
|
76
|
+
:callbackUrl => callbackUrl
|
77
|
+
}.to_json
|
78
|
+
|
79
|
+
SessionInfo.new(JSON.parse(do_https(req)), self)
|
80
|
+
end
|
81
|
+
|
82
|
+
def track_message(message_id)
|
83
|
+
handle_existing_message(message_id, Net::HTTP::Get)
|
84
|
+
end
|
85
|
+
|
86
|
+
def cancel_message(message_id)
|
87
|
+
handle_existing_message(message_id, Net::HTTP::Delete)
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def handle_existing_message(message_id, net_http_class)
|
93
|
+
message_handle = nil
|
94
|
+
if message_id.is_a? Hash
|
95
|
+
message_id = message_id[:messageId]
|
96
|
+
end
|
97
|
+
if message_id.is_a? SessionInfo
|
98
|
+
message_handle = message_id
|
99
|
+
message_id = message_id.message_id
|
100
|
+
end
|
101
|
+
if message_id.nil? or message_id == ""
|
102
|
+
raise ArgumentError.new("Empty message id!")
|
103
|
+
end
|
104
|
+
|
105
|
+
req = net_http_class.new("/frontend/messages/#{message_id}")
|
106
|
+
|
107
|
+
json = JSON.parse(do_https(req))
|
108
|
+
|
109
|
+
if message_handle.nil?
|
110
|
+
message_handle = SessionInfo.new(json, self)
|
111
|
+
else
|
112
|
+
message_handle.re_initialize(json)
|
113
|
+
end
|
114
|
+
|
115
|
+
message_handle
|
116
|
+
end
|
117
|
+
|
118
|
+
def do_https(req)
|
119
|
+
req.add_field("X-PBM-API-VERSION", "1")
|
120
|
+
|
121
|
+
res = @http.request(req)
|
122
|
+
raise HTTPError.new(res) unless res.body
|
123
|
+
|
124
|
+
if res.code !~ /\A2..\z/
|
125
|
+
if res.code == "420"
|
126
|
+
raise PassByMEError.new(JSON.parse(res.body))
|
127
|
+
else
|
128
|
+
raise HTTPError.new(res)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
res.body
|
133
|
+
end
|
134
|
+
end
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: passbyme2fa-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Microsec ltd.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Messaging SDK for PassBy[ME] Mobile ID solution
|
70
|
+
email:
|
71
|
+
- development@passbyme.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- lib/passbyme2fa-client.rb
|
77
|
+
- lib/passbyme2fa-client/http_error.rb
|
78
|
+
- lib/passbyme2fa-client/json_helper.rb
|
79
|
+
- lib/passbyme2fa-client/passbyme_error.rb
|
80
|
+
- lib/passbyme2fa-client/recipient_status.rb
|
81
|
+
- lib/passbyme2fa-client/session_info.rb
|
82
|
+
- lib/passbyme2fa-client/truststore.pem
|
83
|
+
homepage: https://www.passbyme.com/
|
84
|
+
licenses:
|
85
|
+
- MIT
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.4.8
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: PassBy[ME] Mobile ID Client SDK
|
107
|
+
test_files: []
|