auth_jwt_go 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: 88f0fe6e0796919739795db92cd3a0543acd4623994ff0a48e87aa6f99817088
4
- data.tar.gz: f2d78358db5a9852bd5fa43cfa50ca37a580f332fd3a04eb327341e81d97f9cf
3
+ metadata.gz: 1455c62435f166383caa9afc07d8b4b3d24dce3fa5b8c79613f7fbb8954bcd0a
4
+ data.tar.gz: a7506fce9b03686a43a4cca615181d324ea94b230a05dc7f44a8ec43475d122e
5
5
  SHA512:
6
- metadata.gz: eb9a68dda8df17452b62e875296aadf49503f36c73201ba1d9afb4f35d4226cb7e5eace710a15e3e72d091c2a0cc25ba6b301ce40b33bdbc72b6885a1437d47f
7
- data.tar.gz: fb2d35162af6de6476a169c59890cf722ae0e934844301f025e5358cb2b8356d1fe3935268021ab6c5dc96651a4df13403a462d7afbe912115d67a8fa19df3ec
6
+ metadata.gz: 530105f2086f88bc74f09783c426ad1e1f66ec339497b1ce9bacc1b675ed64c93043ccd9b85e93dee9b1e1d81948967c780f554c912444a133f3a9ef58c35187
7
+ data.tar.gz: 512eb15244514ff38e22da3268091691a774ef1f256b3d81f57fdb25b854b0397506e8ae50fb09099e6325cbedd89585690da888b0c34bca217a855b92eae90a
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Datasource local storage ignored files
5
+ /dataSources/
6
+ /dataSources.local.xml
7
+ # Editor-based HTTP Client requests
8
+ /httpRequests/
@@ -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>
@@ -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>
@@ -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>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -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,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
- # AuthJwt
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 'auth_jwt_go'
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/[USERNAME]/auth_jwt.
62
+ Bug reports and pull requests are welcome on GitHub at https://github.com/remolacho/auth_jwt_go.
Binary file
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AuthJwtGo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-13 00:00:00.000000000 Z
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