streem 0.1.0 → 0.1.1
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/src/streem.rb +1 -1
- data/src/{streem_token_builder.rb → token_builder.rb} +5 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 475adb7a04700624e985e3bcb38048d5080f146da902db7b3d6c98aad52db0e6
|
4
|
+
data.tar.gz: 794f0ad981a74e8f862216d0751ddbd0d556bb8dec8390b9f1f4b95b4eb495a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e144c0a1f65ea82a6879a6708174243044efddbd32066cd634c77abc2e0f614b3058746567c4bd7166419c66055279c87b28220a0e3645c8104e89dab62219
|
7
|
+
data.tar.gz: 837768f9e31bbdf6d052907b3e483a06c77f64454bde610da56990e27c100d5125f1db894e58841e255fb79de9d8ff5ecd384be505e02639240db58dacdac8e2
|
data/src/streem.rb
CHANGED
@@ -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, :
|
10
|
+
attr_accessor :user_id, :name, :email, :avatar_url, :token_expiration_ms, :session_expiration_ms
|
11
11
|
|
12
12
|
def initialize
|
13
|
-
@
|
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:
|
42
|
-
session_exp:
|
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.
|
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-
|
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
|
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/
|
36
|
+
- src/token_builder.rb
|
37
37
|
homepage: https://streem.pro
|
38
38
|
licenses: []
|
39
39
|
metadata:
|