auth_jwt_go 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/.idea/.gitignore +8 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/auth_jwt_go.iml +18 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.rakeTasks +7 -0
- data/Gemfile.lock +46 -0
- data/README.md +9 -4
- data/auth_jwt_go-0.1.0.gem +0 -0
- data/lib/auth_jwt_go.rb +6 -0
- data/lib/auth_jwt_go/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1455c62435f166383caa9afc07d8b4b3d24dce3fa5b8c79613f7fbb8954bcd0a
|
|
4
|
+
data.tar.gz: a7506fce9b03686a43a4cca615181d324ea94b230a05dc7f44a8ec43475d122e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 530105f2086f88bc74f09783c426ad1e1f66ec339497b1ce9bacc1b675ed64c93043ccd9b85e93dee9b1e1d81948967c780f554c912444a133f3a9ef58c35187
|
|
7
|
+
data.tar.gz: 512eb15244514ff38e22da3268091691a774ef1f256b3d81f57fdb25b854b0397506e8ae50fb09099e6325cbedd89585690da888b0c34bca217a855b92eae90a
|
data/.idea/.gitignore
ADDED
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
|
4
|
+
<shared />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="NewModuleRootManager">
|
|
7
|
+
<content url="file://$MODULE_DIR$">
|
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
|
11
|
+
</content>
|
|
12
|
+
<orderEntry type="inheritedJdk" />
|
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.16.2, RVM: ruby-2.3.7) [gem]" level="application" />
|
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="jwt (v2.2.1, RVM: ruby-2.3.7) [gem]" level="application" />
|
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="method_source (v1.0.0, RVM: ruby-2.3.7) [gem]" level="application" />
|
|
17
|
+
</component>
|
|
18
|
+
</module>
|
data/.idea/misc.xml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="JavaScriptSettings">
|
|
4
|
+
<option name="languageLevel" value="ES6" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.3.7" project-jdk-type="RUBY_SDK" />
|
|
7
|
+
</project>
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/auth_jwt_go.iml" filepath="$PROJECT_DIR$/.idea/auth_jwt_go.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
auth_jwt_go (0.1.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
byebug (11.1.3)
|
|
10
|
+
coderay (1.1.3)
|
|
11
|
+
diff-lcs (1.4.4)
|
|
12
|
+
jwt (2.2.1)
|
|
13
|
+
method_source (1.0.0)
|
|
14
|
+
pry (0.13.1)
|
|
15
|
+
coderay (~> 1.1)
|
|
16
|
+
method_source (~> 1.0)
|
|
17
|
+
pry-byebug (3.9.0)
|
|
18
|
+
byebug (~> 11.0)
|
|
19
|
+
pry (~> 0.13.0)
|
|
20
|
+
rake (12.3.3)
|
|
21
|
+
rspec (3.9.0)
|
|
22
|
+
rspec-core (~> 3.9.0)
|
|
23
|
+
rspec-expectations (~> 3.9.0)
|
|
24
|
+
rspec-mocks (~> 3.9.0)
|
|
25
|
+
rspec-core (3.9.2)
|
|
26
|
+
rspec-support (~> 3.9.3)
|
|
27
|
+
rspec-expectations (3.9.2)
|
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
29
|
+
rspec-support (~> 3.9.0)
|
|
30
|
+
rspec-mocks (3.9.1)
|
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
32
|
+
rspec-support (~> 3.9.0)
|
|
33
|
+
rspec-support (3.9.3)
|
|
34
|
+
|
|
35
|
+
PLATFORMS
|
|
36
|
+
ruby
|
|
37
|
+
|
|
38
|
+
DEPENDENCIES
|
|
39
|
+
auth_jwt_go!
|
|
40
|
+
jwt
|
|
41
|
+
pry-byebug
|
|
42
|
+
rake (~> 12.0)
|
|
43
|
+
rspec (~> 3.0)
|
|
44
|
+
|
|
45
|
+
BUNDLED WITH
|
|
46
|
+
2.1.4
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AuthJwtGo
|
|
2
2
|
|
|
3
3
|
This gem allows you to make identifications for your microservices and create the Jwt if you wish so
|
|
4
4
|
|
|
@@ -7,9 +7,9 @@ This gem allows you to make identifications for your microservices and create th
|
|
|
7
7
|
Add this line to your application's Gemfile:
|
|
8
8
|
|
|
9
9
|
```ruby
|
|
10
|
-
gem '
|
|
10
|
+
gem 'jwt'
|
|
11
|
+
gem 'auth_jwt_go', '~> 0.1.0'
|
|
11
12
|
```
|
|
12
|
-
|
|
13
13
|
And then execute:
|
|
14
14
|
|
|
15
15
|
$ bundle install
|
|
@@ -52,6 +52,11 @@ Or install it yourself as:
|
|
|
52
52
|
before_action :authorized_user # Identify the user based on the jwt for login
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
5- rspec add in rspec_rails
|
|
56
|
+
config.include RequestHelpers, type: :controller
|
|
57
|
+
|
|
58
|
+
## include helper current_user
|
|
59
|
+
|
|
55
60
|
## Contributing
|
|
56
61
|
|
|
57
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
62
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/remolacho/auth_jwt_go.
|
|
Binary file
|
data/lib/auth_jwt_go.rb
CHANGED
|
@@ -21,6 +21,12 @@ module AuthJwtGo
|
|
|
21
21
|
render json: { message: "The error was #{e.to_s}" }, status: 500
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
def authorized_tenant
|
|
25
|
+
{ message: 'The user has not token active', status: 403 } unless logged_in?
|
|
26
|
+
rescue StandardError => e
|
|
27
|
+
{ message: e.to_s, status: 500 }
|
|
28
|
+
end
|
|
29
|
+
|
|
24
30
|
def authorized_app
|
|
25
31
|
unless AuthJwtGo::secret_key_api.eql?(auth_client)
|
|
26
32
|
render json: {message: 'The app has not access' }, status: 401
|
data/lib/auth_jwt_go/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: auth_jwt_go
|
|
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
|
- jonathan rojas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: this authenticates your api with jwt include current_user helper
|
|
14
14
|
email:
|
|
@@ -18,11 +18,20 @@ extensions: []
|
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
20
|
- ".gitignore"
|
|
21
|
+
- ".idea/.gitignore"
|
|
22
|
+
- ".idea/.rakeTasks"
|
|
23
|
+
- ".idea/auth_jwt_go.iml"
|
|
24
|
+
- ".idea/misc.xml"
|
|
25
|
+
- ".idea/modules.xml"
|
|
26
|
+
- ".idea/vcs.xml"
|
|
27
|
+
- ".rakeTasks"
|
|
21
28
|
- ".rspec"
|
|
22
29
|
- ".travis.yml"
|
|
23
30
|
- Gemfile
|
|
31
|
+
- Gemfile.lock
|
|
24
32
|
- README.md
|
|
25
33
|
- Rakefile
|
|
34
|
+
- auth_jwt_go-0.1.0.gem
|
|
26
35
|
- auth_jwt_go.gemspec
|
|
27
36
|
- bin/console
|
|
28
37
|
- bin/setup
|