strongmind-platform-sdk 3.7.1 → 3.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31db31f4d8ace1dbe04d12513c4e1c927504fc9348a942980b64f6d4043e3d22
4
- data.tar.gz: '09821f67491111fbc62854115f0c9b27f41a1c7d47157a7960881dc5d16f4db3'
3
+ metadata.gz: aa0d49b2e71864d99e40e2c22f3e51c13ecf4d08401e5d5016b38157f744565f
4
+ data.tar.gz: a1c5ee3dbda9573aace61600486c4e1ef8adaf09fdea124b1049cfe6a1324d13
5
5
  SHA512:
6
- metadata.gz: 798ce1c9821925695b39a280edef2bc021cee9d2805b94c71a674966232d3244c825519e0343312d72b47890a895494bba4e3c960a6b2c20fff01456101d3514
7
- data.tar.gz: f6dba455341de18ad13c33734883b8abd5731f9897a62991317ff390e3862ed03556a336f8c079dd43f64bc5308c7a33032f56f04435bb405d6700aeeb7fae0d
6
+ metadata.gz: f09f54549c72ec4b130b8c758e171ecfc4dc5f97ed2ebedb1f893da37eef6b9d254f9262fe06e90c859f0149d0108bfe50e1a48685d3203f8b2c84a310c0a4b1
7
+ data.tar.gz: 2eb5e48a44c97adc37a159c8255162d5a8926f09700cf7782094b4068159758a2c1a4f97fd2af66b0c0e393b40958952521dae62bdb6bfc67dac924bf7b36627
data/Gemfile CHANGED
@@ -13,6 +13,8 @@ gem "faker"
13
13
  gem "faraday"
14
14
  gem "faraday-retry"
15
15
  gem "jwt", "~> 1.5", ">= 1.5.4"
16
+ gem "learnosity-sdk", "~> 0.2.2"
16
17
  gem "rake", "~> 13.0"
17
18
  gem "rspec", "~> 3.6", ">= 3.6.0"
18
19
  gem "rubocop"
20
+ gem 'sentry-ruby'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.7.1)
4
+ strongmind-platform-sdk (3.9.0)
5
5
  aws-sdk-secretsmanager (~> 1.66)
6
6
  devise
7
7
  faraday (~> 2.5, >= 2.5.2)
@@ -10,6 +10,7 @@ PATH
10
10
  omniauth
11
11
  omniauth-rails_csrf_protection
12
12
  omniauth_openid_connect
13
+ sentry-ruby
13
14
  strongmind-oneroster-client (~> 2.0.1)
14
15
  uri
15
16
 
@@ -40,14 +41,14 @@ GEM
40
41
  ast (2.4.2)
41
42
  attr_required (1.0.2)
42
43
  aws-eventstream (1.3.0)
43
- aws-partitions (1.876.0)
44
- aws-sdk-core (3.190.1)
44
+ aws-partitions (1.884.0)
45
+ aws-sdk-core (3.191.0)
45
46
  aws-eventstream (~> 1, >= 1.3.0)
46
47
  aws-partitions (~> 1, >= 1.651.0)
47
48
  aws-sigv4 (~> 1.8)
48
49
  jmespath (~> 1, >= 1.6.1)
49
- aws-sdk-secretsmanager (1.88.0)
50
- aws-sdk-core (~> 3, >= 3.188.0)
50
+ aws-sdk-secretsmanager (1.90.0)
51
+ aws-sdk-core (~> 3, >= 3.191.0)
51
52
  aws-sigv4 (~> 1.1)
52
53
  aws-sigv4 (1.8.0)
53
54
  aws-eventstream (~> 1, >= 1.0.2)
@@ -96,6 +97,8 @@ GEM
96
97
  faraday (~> 2.0)
97
98
  faraday-follow_redirects
98
99
  jwt (1.5.6)
100
+ learnosity-sdk (0.2.2)
101
+ sys-uname (>= 1.0)
99
102
  loofah (2.22.0)
100
103
  crass (~> 1.0.2)
101
104
  nokogiri (>= 1.12.0)
@@ -108,18 +111,22 @@ GEM
108
111
  mini_mime (1.1.5)
109
112
  mini_portile2 (2.8.5)
110
113
  minitest (5.18.0)
111
- net-imap (0.4.9)
114
+ net-imap (0.4.9.1)
112
115
  date
113
116
  net-protocol
114
117
  net-pop (0.1.2)
115
118
  net-protocol
116
119
  net-protocol (0.2.2)
117
120
  timeout
118
- net-smtp (0.4.0)
121
+ net-smtp (0.4.0.1)
119
122
  net-protocol
120
123
  nokogiri (1.16.0)
121
124
  mini_portile2 (~> 2.8.2)
122
125
  racc (~> 1.4)
126
+ nokogiri (1.16.0-x86_64-darwin)
127
+ racc (~> 1.4)
128
+ nokogiri (1.16.0-x86_64-linux)
129
+ racc (~> 1.4)
123
130
  omniauth (2.1.2)
124
131
  hashie (>= 3.4.6)
125
132
  rack (>= 2.2.3)
@@ -210,6 +217,8 @@ GEM
210
217
  parser (>= 3.2.1.0)
211
218
  ruby-progressbar (1.13.0)
212
219
  ruby2_keywords (0.0.5)
220
+ sentry-ruby (5.16.1)
221
+ concurrent-ruby (~> 1.0, >= 1.0.2)
213
222
  strongmind-oneroster-client (2.0.3)
214
223
  json (~> 2.1, >= 2.1.0)
215
224
  typhoeus (~> 1.0, >= 1.0.1)
@@ -218,6 +227,8 @@ GEM
218
227
  attr_required (>= 0.0.5)
219
228
  faraday (~> 2.0)
220
229
  faraday-follow_redirects
230
+ sys-uname (1.2.3)
231
+ ffi (~> 1.1)
221
232
  thor (1.3.0)
222
233
  timeout (0.4.1)
223
234
  typhoeus (1.4.0)
@@ -248,9 +259,11 @@ DEPENDENCIES
248
259
  faraday
249
260
  faraday-retry
250
261
  jwt (~> 1.5, >= 1.5.4)
262
+ learnosity-sdk (~> 0.2.2)
251
263
  rake (~> 13.0)
252
264
  rspec (~> 3.6, >= 3.6.0)
253
265
  rubocop
266
+ sentry-ruby
254
267
  strongmind-oneroster-client (~> 2.0.3)
255
268
  strongmind-platform-sdk!
256
269
 
data/README.md CHANGED
@@ -11,7 +11,7 @@ First [configure your GitHub credentials](#configure-github-credentials)
11
11
  Install the gem and add to the application's Gemfile by executing:
12
12
 
13
13
  ```
14
- gem "strongmind-platform-sdk", "~> 3.7.1"
14
+ gem "strongmind-platform-sdk", "~> 3.9.0"
15
15
  ```
16
16
 
17
17
  If bundler is not being used to manage dependencies, install the gem by executing:
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ require "learnosity/sdk/request/init"
3
+ require "securerandom"
4
+ require "net/http"
5
+
6
+ module PlatformSdk
7
+ module LearnosityApi
8
+ # Learnosity::Client
9
+ class Client
10
+ attr_reader :credentials, :security
11
+
12
+ def initialize(credentials)
13
+ @credentials = credentials
14
+
15
+ raise ArgumentError, "learnosity_host is required" if @credentials[:learnosity_host].nil?
16
+ raise ArgumentError, "service is required" if @credentials[:service].nil?
17
+ raise ArgumentError, "consumer_key is required" if @credentials[:consumer_key].nil?
18
+ raise ArgumentError, "consumer_secret is required" if @credentials[:consumer_secret].nil?
19
+ raise ArgumentError, "organisation_id is required" if @credentials[:organisation_id].nil?
20
+ raise ArgumentError, "domain is required" if @credentials[:domain].nil?
21
+
22
+ @security = {
23
+ "consumer_key" => @credentials[:consumer_key],
24
+ "user_id" => SecureRandom.uuid,
25
+ "domain" => @credentials[:domain]
26
+ }
27
+
28
+ end
29
+
30
+ def sign(request)
31
+ init = Learnosity::Sdk::Request::Init.new(
32
+ @credentials[:service],
33
+ @security,
34
+ @credentials[:consumer_secret],
35
+ request
36
+ )
37
+ init.generate
38
+ end
39
+
40
+ def post(path, request)
41
+ uri = URI("https://#{@credentials[:learnosity_host]}/#{path}")
42
+ Net::HTTP.post_form(uri, sign(request))
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faraday"
4
+ require "faraday/net_http"
5
+ require "faraday/retry"
6
+ require "platform_sdk/learnosity_api/client"
7
+
8
+ module PlatformSdk
9
+ module LearnosityApi
10
+ class Error < StandardError; end
11
+
12
+
13
+ end
14
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PlatformSdk
4
+ module Sentry
5
+ def sentry_ignored(event, ignored_urls = sentry_ignored_urls)
6
+ return true if ignored_urls.any? { |url| event.url.match?(url) }
7
+
8
+ false
9
+ end
10
+
11
+ def sentry_ignored_urls
12
+ [
13
+ %r{/up$}i,
14
+ %r{/health_check$}i,
15
+ %r{/favicon\.ico$}i,
16
+ %r{/robots\.txt$}i,
17
+ %r{/nuclei.svg$}i,
18
+ %r{/wp-admin}i,
19
+ %r{/cgi-bin}i,
20
+ %r{/jmx-console}i,
21
+ %r{/manager/html}i,
22
+ %r{/phpmyadmin}i,
23
+ /.+\.php$/i,
24
+ /.+\.ini$/i,
25
+ /.+\.env$/i,
26
+ /.+\.txt$/i,
27
+ /.+\.jsp$/i,
28
+ /.+\.do$/i,
29
+ /.+\.srf$/i,
30
+ /.+\.bak$/i,
31
+ /.+\.cfml?$/i,
32
+ /.+\.cgi$/i,
33
+ ]
34
+ end
35
+
36
+ end
37
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = "3.7.1"
4
+ VERSION = "3.9.0"
5
5
  end
data/lib/platform_sdk.rb CHANGED
@@ -10,8 +10,10 @@ require "platform_sdk/edkey"
10
10
  require "platform_sdk/data_pipeline"
11
11
  require "platform_sdk/pencil_spaces"
12
12
  require "platform_sdk/edfi"
13
+ require "platform_sdk/sentry"
13
14
 
14
15
  module PlatformSdk
15
16
  class Error < StandardError; end
17
+
16
18
  # Your code goes here...
17
19
  end
@@ -0,0 +1,30 @@
1
+ module PlatformSdk
2
+ module LearnosityApi
3
+
4
+ type credentials = {
5
+ learnosity_host: string,
6
+ services: string,
7
+ consumer_key: string,
8
+ consumer_secret: string,
9
+ organisation_id: string,
10
+ domain: string
11
+ }
12
+
13
+ type security = {
14
+ consumer_key: string,
15
+ user_id: string,
16
+ domain: string
17
+ }
18
+
19
+ class Client
20
+ attr_reader security: security
21
+ attr_reader credentials: credentials
22
+
23
+ def initialize: (credentials: credentials) -> void
24
+
25
+ def sign: (request: Hash[string, untyped]) -> Hash[string, untyped]
26
+
27
+ def post: (path: string, request: Hash[string, untyped]) -> Net::HTTPResponse
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -114,6 +114,20 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: sentry-ruby
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: omniauth
119
133
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +213,8 @@ files:
199
213
  - lib/platform_sdk/id_mapper/models/domain.rb
200
214
  - lib/platform_sdk/identity.rb
201
215
  - lib/platform_sdk/identity/clients.rb
216
+ - lib/platform_sdk/learnosity_api.rb
217
+ - lib/platform_sdk/learnosity_api/client.rb
202
218
  - lib/platform_sdk/one_roster.rb
203
219
  - lib/platform_sdk/one_roster/client.rb
204
220
  - lib/platform_sdk/ops_genie.rb
@@ -211,8 +227,10 @@ files:
211
227
  - lib/platform_sdk/power_school.rb
212
228
  - lib/platform_sdk/power_school/client.rb
213
229
  - lib/platform_sdk/power_school/special_program.rb
230
+ - lib/platform_sdk/sentry.rb
214
231
  - lib/platform_sdk/version.rb
215
232
  - sig/platform_sdk/identity/auth_client.rbs
233
+ - sig/platform_sdk/learnosity_api/client.rbs
216
234
  - sig/platform_sdk/ops_genie/client.rbs
217
235
  - sig/platform_sdk/platform_sdk.rbs
218
236
  homepage: https://github.com/StrongMind/platform-ruby-sdk
@@ -238,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
256
  - !ruby/object:Gem::Version
239
257
  version: '0'
240
258
  requirements: []
241
- rubygems_version: 3.3.26
259
+ rubygems_version: 3.4.10
242
260
  signing_key:
243
261
  specification_version: 4
244
262
  summary: This gem is intended to provide clients and models for accessing the Platform