streem 0.1.0 → 0.1.1

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: 5f56ca936fa92efe7d634be3dcbb540c6922cff39761ba9089248e06f53fad64
4
- data.tar.gz: ed959b2683c58b9e009c4c633ceb012f9271ba66a74e30237b0f2a469daba410
3
+ metadata.gz: 475adb7a04700624e985e3bcb38048d5080f146da902db7b3d6c98aad52db0e6
4
+ data.tar.gz: 794f0ad981a74e8f862216d0751ddbd0d556bb8dec8390b9f1f4b95b4eb495a2
5
5
  SHA512:
6
- metadata.gz: ae9f107eb9581b9989bfe24a0bdd10b8c433f0c078c5b907c647faa9c6eac22b55b77c7886e74b1d4be39335337e0c43d9c3725ff57e09b3f043c99981186aee
7
- data.tar.gz: 2b9a6614017ef7569d28e700e9f970e3c05ed708030b01f73063f3a9e10bfeb2e73bf5b77a927a4c75f75b0d8116ab6d619a040d8fa719f9f8f0cc45b32ce647
6
+ metadata.gz: 78e144c0a1f65ea82a6879a6708174243044efddbd32066cd634c77abc2e0f614b3058746567c4bd7166419c66055279c87b28220a0e3645c8104e89dab62219
7
+ data.tar.gz: 837768f9e31bbdf6d052907b3e483a06c77f64454bde610da56990e27c100d5125f1db894e58841e255fb79de9d8ff5ecd384be505e02639240db58dacdac8e2
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Provides access to the Streem SDK. Start by calling Streem.init() with your API Key ID and Secret
4
4
  class Streem
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  @api_key_id = nil
7
7
  @api_key_secret = nil
8
8
  @api_environment = "prod-us"
@@ -7,10 +7,11 @@ class 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, :expiration_ms, :session_ms
10
+ attr_accessor :user_id, :name, :email, :avatar_url, :token_expiration_ms, :session_expiration_ms
11
11
 
12
12
  def initialize
13
- @expiration_ms = 60 * 60 * 1000 # one hour
13
+ @token_expiration_ms = 5 * 60 * 1000 # five minutes
14
+ @session_expiration_ms = 4 * 60 * 60 * 1000 # four hours
14
15
  end
15
16
 
16
17
  # Build the token using the configured attributes. Validation errors may be raised from this method
@@ -38,8 +39,8 @@ class Streem
38
39
  {
39
40
  iss: "streem:api:#{Streem.api_key_id}",
40
41
  sub: @user_id,
41
- exp: (Time.now + @expiration_ms).to_i,
42
- session_exp: @session_ms.nil? ? nil : (Time.now + @session_ms).to_i,
42
+ exp: Time.now.to_i + (@token_expiration_ms / 1000).to_i,
43
+ session_exp: Time.now.to_i + (@session_expiration_ms / 1000).to_i,
43
44
  iat: Time.now.to_i,
44
45
  aud: "https://api.#{Streem.api_environment}.streem.cloud/",
45
46
  name: @name,
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Streem Dev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2020-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jose
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.3
27
- description: Streem library to interact with the Streem API, and generate Embedded
27
+ description: Streem library to interact with the Streem API and generate Embedded
28
28
  SSO tokens
29
29
  email:
30
30
  - dev@streem.pro
@@ -33,7 +33,7 @@ extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
35
  - src/streem.rb
36
- - src/streem_token_builder.rb
36
+ - src/token_builder.rb
37
37
  homepage: https://streem.pro
38
38
  licenses: []
39
39
  metadata: