securenative 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -14
- data/.github/workflows/publish.yml +1 -1
- data/README.md +4 -4
- data/VERSION +1 -1
- data/lib/securenative/event_manager.rb +1 -0
- data/lib/securenative/event_options_builder.rb +11 -2
- data/lib/securenative/models/user_traits.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01eee863c8dda0e4bf97b91bc69c577d7720f44266e447f27493d270768ea200
|
4
|
+
data.tar.gz: 981056596af0d2595d5119fe27655b757ff6a1afc057dd6ee567e2a4b51dd2ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaec6f599e8d4ba3efc0d645d6d84704b8fba065c430a206563bcbd547e6de281d946eb97fc173c7d1d9ce09b3ff4f7b0ea7abfdb98f9b3f4d9bfa9fa0e71d28
|
7
|
+
data.tar.gz: 87b602345c3ff2566f36b9b6f47a66abdda7907f3f2fd9d0797a9ee1b3ac2d0443283f0e53d4f3cf7131e50fdf08bbc8f673ebfe42b1c8b6c3f032c0137cc921
|
data/.github/workflows/ci.yml
CHANGED
@@ -8,21 +8,10 @@ on:
|
|
8
8
|
- dev-*
|
9
9
|
|
10
10
|
jobs:
|
11
|
-
|
12
|
-
runs-on: ubuntu-latest
|
11
|
+
test:
|
13
12
|
name: CI
|
13
|
+
runs-on: ubuntu-18.04
|
14
14
|
steps:
|
15
|
-
- name: Notify slack success
|
16
|
-
if: success()
|
17
|
-
id: slack # IMPORTANT: reference this step ID value in future Slack steps
|
18
|
-
env:
|
19
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
20
|
-
uses: voxmedia/github-action-slack-notify-build@v1.1.1
|
21
|
-
with:
|
22
|
-
channel: github-actions
|
23
|
-
status: STARTING
|
24
|
-
color: warning
|
25
|
-
|
26
15
|
- uses: actions/checkout@v1
|
27
16
|
- uses: actions/setup-ruby@v1
|
28
17
|
with:
|
@@ -54,4 +43,4 @@ jobs:
|
|
54
43
|
message_id: ${{ steps.slack.outputs.message_id }}
|
55
44
|
channel: github-actions
|
56
45
|
status: FAILED
|
57
|
-
color: danger
|
46
|
+
color: danger
|
data/README.md
CHANGED
@@ -100,7 +100,7 @@ context = securenative.context_builder(ip = '127.0.0.1', client_token = 'SECURED
|
|
100
100
|
headers = { 'user-agent' => 'Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405' })
|
101
101
|
|
102
102
|
event_options = EventOptionsBuilder(event_type = EventTypes::LOG_IN,
|
103
|
-
user_id = '
|
103
|
+
user_id = '1234', user_traits = UserTraits('Your Name', 'name@gmail.com', '+1234567890'),
|
104
104
|
context = context, properties = {prop1 => 'CUSTOM_PARAM_VALUE', prop2 => true, prop3 => 3}).build
|
105
105
|
|
106
106
|
securenative.track(event_options)
|
@@ -120,7 +120,7 @@ def track(request)
|
|
120
120
|
context = SecureNative.context_builder.from_http_request(request).build
|
121
121
|
|
122
122
|
event_options = EventOptionsBuilder(event_type = EventTypes::LOG_IN,
|
123
|
-
user_id = '
|
123
|
+
user_id = '1234', user_traits = UserTraits('Your Name', 'name@gmail.com', '+1234567890'),
|
124
124
|
context = context, properties = {prop1 => 'CUSTOM_PARAM_VALUE', prop2 => true, prop3 => 3}).build
|
125
125
|
|
126
126
|
securenative.track(event_options)
|
@@ -138,12 +138,12 @@ require 'securenative/event_options_builder'
|
|
138
138
|
require 'securenative/models/user_traits'
|
139
139
|
|
140
140
|
|
141
|
-
def
|
141
|
+
def verify(request)
|
142
142
|
securenative = SecureNative.instance
|
143
143
|
context = SecureNative.context_builder.from_http_request(request).build
|
144
144
|
|
145
145
|
event_options = EventOptionsBuilder(event_type = EventTypes::LOG_IN,
|
146
|
-
user_id = '
|
146
|
+
user_id = '1234', user_traits = UserTraits('Your Name', 'name@gmail.com', '+1234567890'),
|
147
147
|
context = context, properties = {prop1 => 'CUSTOM_PARAM_VALUE', prop2 => true, prop3 => 3}).build
|
148
148
|
|
149
149
|
verify_result = securenative.verify(event_options)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.17
|
@@ -1,11 +1,20 @@
|
|
1
1
|
class EventOptionsBuilder
|
2
2
|
MAX_PROPERTIES_SIZE = 10
|
3
3
|
|
4
|
-
def initialize(event_type, user_id, user_traits, user_name, email, created_at, context, properties, timestamp)
|
4
|
+
def initialize(event_type, user_id, user_traits, user_name, email, phone, created_at, context, properties, timestamp)
|
5
|
+
traits = UserTraits(user_name)
|
6
|
+
if user_name && email && phone && created_at
|
7
|
+
traits = UserTraits(user_name, email, phone, created_at)
|
8
|
+
elsif user_name && email && phone
|
9
|
+
traits = UserTraits(user_name, email, phone)
|
10
|
+
elsif user_name && email
|
11
|
+
traits = UserTraits(user_name, email)
|
12
|
+
end
|
13
|
+
|
5
14
|
@event_options = EventOptions(event_type)
|
6
15
|
@event_options.user_id = user_id
|
7
16
|
@event_options.user_traits = user_traits if user_traits
|
8
|
-
@event_options.user_traits =
|
17
|
+
@event_options.user_traits = traits
|
9
18
|
@event_options.context = context
|
10
19
|
@event_options.properties = properties
|
11
20
|
@event_options.timestamp = timestamp
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class UserTraits
|
2
|
-
attr_reader :name, :email, :created_at
|
3
|
-
attr_writer :name, :email, :created_at
|
2
|
+
attr_reader :name, :email, :phone, :created_at
|
3
|
+
attr_writer :name, :email, :phone, :created_at
|
4
4
|
|
5
|
-
def initialize(name = nil, email = nil, created_at = nil)
|
5
|
+
def initialize(name = nil, email = nil, phone = nil, created_at = nil)
|
6
6
|
@name = name
|
7
7
|
@email = email
|
8
8
|
@created_at = created_at
|
9
|
+
@phone = phone
|
9
10
|
end
|
10
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: securenative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SecureNative
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|