kaltura-client 18.15.0 → 18.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0eaecd7d435509d0dd9427be7147fa138969131df545edf84ae96280aae0215
4
- data.tar.gz: 547214a5f9e29c0e8bcb67a419b4be4cbe2dddcf7353f499e274970653c20a4d
3
+ metadata.gz: 98b959a733b1f4008544662b41833814f5f29e4faae68825ad5ef5fd4310e7ce
4
+ data.tar.gz: c89ca7c196c4c54e138885ff0aa611558e5630126c39f18294f33def9b9ad7c5
5
5
  SHA512:
6
- metadata.gz: 6ac27a46d1e670d168f34d2489e45e140549927e59aff93491bfba4848695a182555b7adb677c269453339e7c31fb234cde46c57bd76835f358cf09e5a7f73b4
7
- data.tar.gz: db0f7472f222deac6a8713d920daeee5155178f08699306c34b7e8b72fbff6114bfbfcd05e513455888304558c7744b7f82e7c73b4ab949cbf117ed36d5a6743
6
+ metadata.gz: c6aafaa8e5f69c33dbaf29648d682d63d66ac99e0cdb960390f5e6384d249403a456b2d0cdf3f13a7d42d834ab9268cbdbe61ecde5db41b460414e55cc658514
7
+ data.tar.gz: bff415412057af8714b23449b51211a96460e6d9a0b80f02409c5cb4f607611b97777e1bfec6c3e07c92ed424f8330478a106545adbe2d09da88ba7cea3dc399
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
  Kaltura Ruby API Client Library.
2
- Compatible with Kaltura server version 18.15.0 and above.
2
+ Compatible with Kaltura server version 18.17.0 and above.
3
3
 
4
4
  This source contains:
5
5
  - The Kaltura client library (kaltura_client_base.rb)
@@ -6382,8 +6382,8 @@ module Kaltura
6382
6382
 
6383
6383
  def initialize(client)
6384
6384
  super(client)
6385
- self.client_tag = 'ruby:22-10-03'
6386
- self.api_version = '18.15.0'
6385
+ self.client_tag = 'ruby:22-11-08'
6386
+ self.api_version = '18.17.0'
6387
6387
  end
6388
6388
 
6389
6389
  def client_tag=(value)
@@ -36,11 +36,18 @@ require 'digest/sha1'
36
36
  require 'base64'
37
37
  require 'date'
38
38
  require 'yaml'
39
+ require 'uri'
39
40
 
40
41
  module Kaltura
41
42
  class KalturaNotImplemented; end
42
43
 
43
44
  class KalturaClientBase
45
+
46
+ # KS V2 constants
47
+ FIELD_EXPIRY = '_e';
48
+ FIELD_TYPE = '_t';
49
+ FIELD_USER = '_u';
50
+
44
51
  attr_accessor :config
45
52
  attr_reader :is_multirequest
46
53
  attr_reader :responseHeaders
@@ -387,6 +394,62 @@ module Kaltura
387
394
 
388
395
  self.ks = cleaned
389
396
  end
397
+
398
+ def generate_session_v2(admin_secret, user_id, kaltura_session_type, partner_id, expiry=86400, privileges=nil)
399
+ fields = {}
400
+ if privileges !=nil
401
+ privileges.split(',').each do |privilege|
402
+ privilege.strip!
403
+ if !privilege
404
+ next
405
+ end
406
+ if (privilege == '*')
407
+ privilege = 'all:*'
408
+ end
409
+ splitted_privilege = privilege.split(':', 2)
410
+ if (splitted_privilege.count > 1)
411
+ fields[splitted_privilege[0]] = splitted_privilege[1]
412
+ else
413
+ fields[splitted_privilege[0]] = ''
414
+ end
415
+ end
416
+ end
417
+ fields[KalturaClientBase::FIELD_EXPIRY] = (Time.now.to_i + expiry.to_i)
418
+ fields[KalturaClientBase::FIELD_TYPE] = kaltura_session_type
419
+ fields[KalturaClientBase::FIELD_USER] = user_id
420
+
421
+ # build fields string
422
+ fields_str = URI.encode_www_form(fields)
423
+ rand = ''
424
+ for i in 0..15 do
425
+ rand += rand(0..0xff).chr
426
+ end
427
+ fields_str = rand + fields_str
428
+ fields_str = Digest::SHA1.digest(fields_str) + fields_str
429
+
430
+ # encrypt and encode
431
+ encrypted_fields = aes_encrypt(admin_secret, fields_str)
432
+ decoded_ks = "v2|#{partner_id}|" + encrypted_fields
433
+ # in other clients, we do not set the ks on the client object here, only return it; however, because
434
+ # this was done in generate_session(), I added it for compatibility reasons.
435
+ self.ks = Base64.urlsafe_encode64(decoded_ks).gsub('+','-').gsub('/','_')
436
+ return self.ks
437
+ end
438
+
439
+ def aes_encrypt(key, data)
440
+ iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" # no need for an IV since we add a random string to the message anyway
441
+ key = Digest::SHA1.digest(key)[0..15]
442
+ cipher = OpenSSL::Cipher::AES.new(128, :CBC)
443
+ cipher.encrypt
444
+
445
+ cipher.padding = 0 # we must disable native padding.
446
+ cipher.key = key
447
+ cipher.iv = iv
448
+ block_size = cipher.block_size
449
+ # this is needed to maintain compatibility with the legacy mcrypt extension, see https://github.com/kaltura/server/blob/Rigel-18.16.0/infra/general/KCryptoWrapper.class.php#L79
450
+ data = data + "\0" * (block_size - data.bytesize % block_size)
451
+ return cipher.update(data) + cipher.final
452
+ end
390
453
  end
391
454
 
392
455
  class KalturaServiceActionCall
data/lib/kaltura_enums.rb CHANGED
@@ -3874,6 +3874,8 @@ module Kaltura
3874
3874
  end
3875
3875
 
3876
3876
  class KalturaUserEntryExtendedStatus
3877
+ SYNC_STATUS_ERROR = "quiz.SYNC_STATUS_ERROR"
3878
+ SYNC_STATUS_SUCCESS = "quiz.SYNC_STATUS_SUCCESS"
3877
3879
  PLAYBACK_COMPLETE = "viewHistory.PLAYBACK_COMPLETE"
3878
3880
  PLAYBACK_STARTED = "viewHistory.PLAYBACK_STARTED"
3879
3881
  VIEWED = "viewHistory.VIEWED"
@@ -81,6 +81,7 @@ module Kaltura
81
81
  USER_ROLE = "UserRole"
82
82
  ACCESS_CONTROL = "accessControl"
83
83
  CATEGORY = "category"
84
+ CATEGORY_ENTRY = "categoryEntry"
84
85
  CONVERSION_PROFILE_2 = "conversionProfile2"
85
86
  ENTRY = "entry"
86
87
  FLAVOR_ASSET = "flavorAsset"
@@ -224,7 +224,7 @@ module Kaltura
224
224
  attr_accessor :conversion_profile_id
225
225
  attr_accessor :dc
226
226
  attr_accessor :path
227
- # The ammount of time, in seconds, that should pass so that a file with no change in size we'll be treated as "finished uploading to folder"
227
+ # The amount of time, in seconds, that should pass so that a file with no change in size will be treated as "finished uploading to folder"
228
228
  attr_accessor :file_size_check_interval
229
229
  attr_accessor :file_delete_policy
230
230
  attr_accessor :file_delete_regex
data/lib/kaltura_types.rb CHANGED
@@ -2016,11 +2016,13 @@ module Kaltura
2016
2016
  attr_accessor :max_login_attempts
2017
2017
  attr_accessor :login_block_period
2018
2018
  attr_accessor :num_prev_pass_to_keep
2019
+ attr_accessor :allow_default_password_restrictions
2019
2020
  attr_accessor :two_factor_authentication_mode
2020
2021
  attr_accessor :is_self_serve
2021
2022
  attr_accessor :allowed_domains
2022
2023
  attr_accessor :excluded_admin_role_name
2023
2024
  attr_accessor :event_platform_allowed_templates
2025
+ attr_accessor :vertical_classification_id
2024
2026
 
2025
2027
  def id=(val)
2026
2028
  @id = val.to_i
@@ -2130,12 +2132,18 @@ module Kaltura
2130
2132
  def num_prev_pass_to_keep=(val)
2131
2133
  @num_prev_pass_to_keep = val.to_i
2132
2134
  end
2135
+ def allow_default_password_restrictions=(val)
2136
+ @allow_default_password_restrictions = to_b(val)
2137
+ end
2133
2138
  def two_factor_authentication_mode=(val)
2134
2139
  @two_factor_authentication_mode = val.to_i
2135
2140
  end
2136
2141
  def is_self_serve=(val)
2137
2142
  @is_self_serve = to_b(val)
2138
2143
  end
2144
+ def vertical_classification_id=(val)
2145
+ @vertical_classification_id = val.to_i
2146
+ end
2139
2147
 
2140
2148
  def from_xml(xml_element)
2141
2149
  super
@@ -2361,6 +2369,9 @@ module Kaltura
2361
2369
  if xml_element.elements['numPrevPassToKeep'] != nil
2362
2370
  self.num_prev_pass_to_keep = xml_element.elements['numPrevPassToKeep'].text
2363
2371
  end
2372
+ if xml_element.elements['allowDefaultPasswordRestrictions'] != nil
2373
+ self.allow_default_password_restrictions = xml_element.elements['allowDefaultPasswordRestrictions'].text
2374
+ end
2364
2375
  if xml_element.elements['twoFactorAuthenticationMode'] != nil
2365
2376
  self.two_factor_authentication_mode = xml_element.elements['twoFactorAuthenticationMode'].text
2366
2377
  end
@@ -2376,6 +2387,9 @@ module Kaltura
2376
2387
  if xml_element.elements['eventPlatformAllowedTemplates'] != nil
2377
2388
  self.event_platform_allowed_templates = xml_element.elements['eventPlatformAllowedTemplates'].text
2378
2389
  end
2390
+ if xml_element.elements['verticalClassificationId'] != nil
2391
+ self.vertical_classification_id = xml_element.elements['verticalClassificationId'].text
2392
+ end
2379
2393
  end
2380
2394
 
2381
2395
  end
@@ -14164,6 +14178,7 @@ module Kaltura
14164
14178
  attr_accessor :recording_info
14165
14179
  attr_accessor :is_playable_user
14166
14180
  attr_accessor :view_mode
14181
+ attr_accessor :features_updated_at
14167
14182
 
14168
14183
  def is_playable_user=(val)
14169
14184
  @is_playable_user = to_b(val)
@@ -14171,6 +14186,9 @@ module Kaltura
14171
14186
  def view_mode=(val)
14172
14187
  @view_mode = val.to_i
14173
14188
  end
14189
+ def features_updated_at=(val)
14190
+ @features_updated_at = val.to_i
14191
+ end
14174
14192
 
14175
14193
  def from_xml(xml_element)
14176
14194
  super
@@ -14186,6 +14204,9 @@ module Kaltura
14186
14204
  if xml_element.elements['viewMode'] != nil
14187
14205
  self.view_mode = xml_element.elements['viewMode'].text
14188
14206
  end
14207
+ if xml_element.elements['featuresUpdatedAt'] != nil
14208
+ self.features_updated_at = xml_element.elements['featuresUpdatedAt'].text
14209
+ end
14189
14210
  end
14190
14211
 
14191
14212
  end
@@ -64,10 +64,10 @@ class ConfigurationTest < Test::Unit::TestCase
64
64
  config.logger = Logger.new(STDOUT)
65
65
  config.timeout = timeout
66
66
 
67
- @client = Kaltura::KalturaClient.new( config )
67
+ @client = Kaltura::KalturaClient.new(config)
68
68
  assert_equal @client.ks, Kaltura::KalturaNotImplemented
69
69
 
70
- session = @client.session_service.start( administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
70
+ session = @client.generate_session_v2(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
71
71
  @client.ks = session
72
72
 
73
73
  assert_not_nil @client.ks
@@ -86,10 +86,10 @@ class ConfigurationTest < Test::Unit::TestCase
86
86
  config.service_url = service_url
87
87
  config.logger = Logger.new(STDOUT)
88
88
 
89
- @client = Kaltura::KalturaClient.new( config )
89
+ @client = Kaltura::KalturaClient.new(config)
90
90
 
91
91
  assert_raise Kaltura::KalturaAPIError do
92
- session = @client.session_service.start( administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
92
+ session = @client.session_service.start(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
93
93
  end
94
94
  end
95
95
 
@@ -105,10 +105,10 @@ class ConfigurationTest < Test::Unit::TestCase
105
105
  config.service_url = service_url
106
106
  config.logger = Logger.new(STDOUT)
107
107
 
108
- @client = Kaltura::KalturaClient.new( config )
108
+ @client = Kaltura::KalturaClient.new(config)
109
109
 
110
110
  assert_raise Kaltura::KalturaAPIError do
111
- session = @client.session_service.start( "invalid_administrator_secret", '', Kaltura::KalturaSessionType::ADMIN, partner_id)
111
+ session = @client.session_service.start("invalid_administrator_secret", '', Kaltura::KalturaSessionType::ADMIN, partner_id)
112
112
  @client.ks = session
113
113
  end
114
114
 
@@ -130,11 +130,11 @@ class ConfigurationTest < Test::Unit::TestCase
130
130
  config.logger = Logger.new(STDOUT)
131
131
  config.timeout = timeout
132
132
 
133
- @client = Kaltura::KalturaClient.new( config )
133
+ @client = Kaltura::KalturaClient.new(config)
134
134
 
135
135
  assert_equal @client.ks, Kaltura::KalturaNotImplemented
136
136
 
137
- @client.generate_session(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
137
+ @client.generate_session_v2(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
138
138
 
139
139
  assert_not_nil @client.ks
140
140
 
data/test/test_helper.rb CHANGED
@@ -54,8 +54,8 @@ class Test::Unit::TestCase
54
54
  config.logger = Logger.new(STDOUT)
55
55
  config.timeout = timeout
56
56
 
57
- @client = Kaltura::KalturaClient.new( config )
58
- @client.generate_session(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id )
57
+ @client = Kaltura::KalturaClient.new(config)
58
+ @client.generate_session_v2(administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, partner_id)
59
59
  end
60
60
 
61
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaltura-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.15.0
4
+ version: 18.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaltura Inc.