streem 0.1.4 → 0.2.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: c8e4d6a1e944bbadd1613ef4afa4077b4bd084bf1369b75f1ffa6bfff5f436a0
4
- data.tar.gz: d9e245ba374b6744177ae04f6602a7b3731cd10956e635d7a3d22dc056328c6c
3
+ metadata.gz: 5683aa842f56703314163e91e1715746af3b5402c87b044c756cfef766c3f993
4
+ data.tar.gz: 1f7e2254cf1d5d45b2d6985b62fe3e9e9d2d5b72c8970370bd1dbbf2d73703ff
5
5
  SHA512:
6
- metadata.gz: 0bdd1963103b201fb5a9edce3b6ec64f8294f4891c5907e11627282aab5c8cd8660d9b62d74d63f2a49ee89ad75494c014997caf6be1fd700567db48ff56100a
7
- data.tar.gz: a06216c3ae22561e98d653710d03428eca1816d6754fec8b1d0add03a6997b3d94de58a5957e5a16b933a08a588052b162eb23fffb7566c396f98bd1b8fa13a1
6
+ metadata.gz: fad99515ed47382e0b13bb80fb08fb2349d5ee8455e14512fa4c3130a5751394448e525a08eb11c601cb102185316d4f212f0f3c98189cefe80da720a5a8e399
7
+ data.tar.gz: 61aaefd4e89135f154ab581d2cab63b844ad3df50d135047a76fcb80a27f40d2ae1baef301cb38c00237986a56e72041b9c37c1d5c60a451c87d405b103d13bb
@@ -7,7 +7,7 @@ module Streem
7
7
  # Class for building Streem Tokens. Configure the token using the available setter methods, and finalize the token
8
8
  # by calling `builder.token`. This returns a string representation of the token, that can be provided to the client.
9
9
  class TokenBuilder
10
- attr_accessor :user_id, :name, :email, :avatar_url, :token_expiration_ms, :session_expiration_ms
10
+ attr_accessor :user_id, :name, :email, :avatar_url, :token_expiration_ms, :session_expiration_ms, :reservation_sid
11
11
 
12
12
  def initialize
13
13
  @token_expiration_ms = 5 * 60 * 1000 # five minutes
@@ -22,6 +22,7 @@ module Streem
22
22
  jwk = JOSE::JWK.from(key_as_json)
23
23
 
24
24
  claim = token_claims
25
+ claim['streem:reservation_sid'] = @reservation_sid if @reservation_sid
25
26
 
26
27
  # noinspection RubyStringKeysInHashInspection
27
28
  signed_token = JOSE::JWS.sign(jwk, claim.to_json, { "alg" => "ES256" })
@@ -32,7 +33,7 @@ module Streem
32
33
 
33
34
  def validate_token
34
35
  raise "Must call Streem.init first" if Streem.api_key_id.nil? || Streem.api_key_secret.nil?
35
- raise "user_id is required" if @user_id.nil?
36
+ raise "Cannot build token: user_id is required" if @user_id.nil?
36
37
  end
37
38
 
38
39
  def token_claims
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Streem
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Streem Dev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-18 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jose
@@ -39,7 +39,9 @@ homepage: https://streem.pro
39
39
  licenses: []
40
40
  metadata:
41
41
  homepage_uri: https://streem.pro
42
- post_install_message:
42
+ source_code_uri: https://github.com/streem/streem-sdk-ruby
43
+ changelog_uri: https://github.com/streem/streem-sdk-ruby/blob/main/CHANGELOG.md
44
+ post_install_message:
43
45
  rdoc_options: []
44
46
  require_paths:
45
47
  - src
@@ -54,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
56
  - !ruby/object:Gem::Version
55
57
  version: '0'
56
58
  requirements: []
57
- rubygems_version: 3.0.6
58
- signing_key:
59
+ rubygems_version: 3.0.9
60
+ signing_key:
59
61
  specification_version: 4
60
62
  summary: Streem SDK
61
63
  test_files: []