mumukit-auth 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/auth/permissions.rb +4 -0
- data/lib/mumukit/auth/token.rb +5 -1
- data/lib/mumukit/auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bed8166905e564a1dba63d8b2d5360d9a53d9885
|
4
|
+
data.tar.gz: 67891d8319dec63be952ba8d6460ab291de6f272
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43be1045c6041c315bf2dba475a93df6188ee5ede68cbf8e3bea9a21d204295a1940f1a4911dbd6042e97627d798d0822da5f0083f4f457088d4d22f690b4522
|
7
|
+
data.tar.gz: ce9947379341de7fc345cf60d5c1acedad17d77282288a96ac1df2b53e15d8c0d198dea29645a24a1254f235820682c52fa0918278d8860858629dfd3f803c2b
|
data/lib/mumukit/auth/token.rb
CHANGED
@@ -16,6 +16,10 @@ module Mumukit::Auth
|
|
16
16
|
raise Mumukit::Auth::InvalidTokenError.new('aud mismatch') if Mumukit::Auth.config.client_id != jwt['aud']
|
17
17
|
end
|
18
18
|
|
19
|
+
def encode
|
20
|
+
JWT.encode(jwt, self.class.decoded_secret)
|
21
|
+
end
|
22
|
+
|
19
23
|
def self.from_rack_env(env)
|
20
24
|
new(env.dig('omniauth.auth', 'extra', 'raw_info') || {})
|
21
25
|
end
|
@@ -25,7 +29,7 @@ module Mumukit::Auth
|
|
25
29
|
end
|
26
30
|
|
27
31
|
def self.encode(metadata)
|
28
|
-
|
32
|
+
new(aud: Mumukit::Auth.config.client_id, metadata: metadata).encode
|
29
33
|
end
|
30
34
|
|
31
35
|
def self.decode(encoded)
|
data/lib/mumukit/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|