jw_tea 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f10858f84fcbca15b529a439572c7ee1fdeb8188676281669208cd351d88ac1d
4
+ data.tar.gz: 965466e3150b6d624c72153090fd059f58788ef8bc069a59ac1aaa708ce37ce6
5
+ SHA512:
6
+ metadata.gz: 40cdd405942894e97ad06ef90bb78e9e1646f6ca85ed260fd17b6311f7e97c6e668e98f106ba87e1f252bf11031fc5522e324b2a3a20a9248069682c33774163
7
+ data.tar.gz: 24a1aa473256150e625ecb1eb469053afd22c6bed639062ffe08a880dee1694bc375e9a694a7fd5932a2beeb21cf72aff8fe9218d59d0fb535ba208eeabbd166
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 1.17.3
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at berna.loyola@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in jw_tea.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jw_tea (0.1.0)
5
+ activesupport
6
+ jwt
7
+ redis
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activesupport (6.0.1)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 0.7, < 2)
15
+ minitest (~> 5.1)
16
+ tzinfo (~> 1.1)
17
+ zeitwerk (~> 2.2)
18
+ concurrent-ruby (1.1.5)
19
+ diff-lcs (1.3)
20
+ i18n (1.7.0)
21
+ concurrent-ruby (~> 1.0)
22
+ jwt (2.2.1)
23
+ minitest (5.13.0)
24
+ rake (10.5.0)
25
+ redis (4.1.3)
26
+ rspec (3.9.0)
27
+ rspec-core (~> 3.9.0)
28
+ rspec-expectations (~> 3.9.0)
29
+ rspec-mocks (~> 3.9.0)
30
+ rspec-core (3.9.0)
31
+ rspec-support (~> 3.9.0)
32
+ rspec-expectations (3.9.0)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.9.0)
35
+ rspec-mocks (3.9.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.9.0)
38
+ rspec-support (3.9.0)
39
+ thread_safe (0.3.6)
40
+ timecop (0.9.1)
41
+ tzinfo (1.2.5)
42
+ thread_safe (~> 0.1)
43
+ zeitwerk (2.2.1)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ bundler (~> 1.17)
50
+ jw_tea!
51
+ rake (~> 10.0)
52
+ rspec (~> 3.0)
53
+ timecop (~> 0.9)
54
+
55
+ BUNDLED WITH
56
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Ben Loyola
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # JWTea
2
+
3
+ The goal of JWTea is to simplify authentication in web apps without coupling it with any specific strategy. It is a simple lightweight ruby wrapper around the [JWT](https://github.com/jwt/ruby-jwt) gem, which allows for storing jti claims so that tokens can be revoked and validated. If that sounds like your cup of tea, then this gem is for you.
4
+ Comes with a Redis store built-in, but allows for custom stores as well.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'jw_tea'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install jw_tea
21
+
22
+ ## Usage
23
+
24
+ Brewing a JWTea token (encode)
25
+
26
+ ```ruby
27
+ kettle = JWTea::Kettle.new(
28
+ secret: 'MY_SECRET_KEY',
29
+ store: JWTea::Stores::RedisStore.new,
30
+ algorithm: 'HS256',
31
+ expires_in: 3600 # seconds
32
+ )
33
+ #=> #<JWTea::Kettle expires_in: 3600, store: #<JWTea::Stores::RedisStore:0x00007f86bc05f8d0>>
34
+ data = { some: 'data' }
35
+ token = kettle.brew(data)
36
+ #=> #<JWTea::Token:0x00007f86bd0ff780>
37
+ token.encoded
38
+ #=> "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InNvbWUiOiJkYXRhIn0sImp0aSI6IjczZWI5YTBjNDgwOTIwZGY5ZTM0ZWQ0MTRlOWFhOTA4IiwiaWF0IjoxNTcyODQ4OTQ0LCJleHAiOjE1NzM0NTM3NDR9.UmPwCXusG65VNXPxdCLKMC8gyUsGkTDIcaSw1R6_YZQ"
39
+ token.jti
40
+ #+> "73eb9a0c480920df9e34ed414e9aa908"
41
+ token.exp
42
+ #=> 1573453744
43
+ ```
44
+
45
+ Or, if you don't really care about jti/exp and just want the encoded token
46
+
47
+ ```ruby
48
+ data = { some: 'data' }
49
+ encoded_token = kettle.encode(data)
50
+ #=> "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InNvbWUiOiJkYXRhIn0sImp0aSI6ImNiMGZiOWQ3NzVmYjM4NTYzYTJjMDgxZTZkNzhlNzAwIiwiaWF0IjoxNTcyODQ5MzQ4LCJleHAiOjE1NzM0NTQxNDh9.xrps_lCz0FNWNmEVFbxNR4TcssOAtTS1EuQO2JffQB0"
51
+ ```
52
+
53
+ Pouring a JWTea token (decoding)
54
+
55
+ ```ruby
56
+ token = kettle.pour(encoded_token)
57
+ #=> #<JWTea::Token:0x00007feba6a33330>
58
+ #=> #<JWTea::Token:0x00007feba592ef08>
59
+ token.jti
60
+ #=> "1571bb5d8ac64b7b087b65350b530e0d"
61
+ token.data
62
+ #=> {"some"=>"data"}
63
+ ```
64
+
65
+ Again, if you just want the data you can do
66
+
67
+ ```ruby
68
+ data = kettle.decode(encoded_token)
69
+ #=> {"some"=>"data"}
70
+ ```
71
+
72
+ If using a store, you can validate that the token hasn't been revoked (trying to pour/decode a revoked token will yield an error)
73
+
74
+ ```ruby
75
+ kettle.valid?(encoded_token)
76
+ #=> true
77
+ ```
78
+
79
+ Revoking a token
80
+
81
+ ```ruby
82
+ kettle.revoke(encoded_token)
83
+ #=> true
84
+ kettle.valid?(encoded_token)
85
+ #=> false
86
+ ```
87
+
88
+ You can also define your own method of storage, which just needs to respond to `save`, `exists?` and `delete`
89
+
90
+ ```ruby
91
+ class MyCustomStore
92
+ def save(jti, exp, ttl_in_seconds)
93
+ # Some logic to store the token
94
+ end
95
+
96
+ def exists?(jti, exp)
97
+ # Some logic to verify the token hasn't been revoked
98
+ end
99
+
100
+ def delete(jti)
101
+ # Some logic to revoke the token
102
+ end
103
+ end
104
+
105
+ JWTea::Kettle.new(
106
+ secret: 'MY_SECRET_KEY',
107
+ store: MyCustomStore.new,
108
+ )
109
+ #=> #<JWTea::Kettle expires_in: 3600, store: #<MyCustomStore:0x00007feba696e2b0>>
110
+ ```
111
+
112
+ That's pretty much it!
113
+
114
+ ## Contributing
115
+
116
+ Bug reports and pull requests are welcome on GitHub at https://github.com/b-loyola/jw_tea. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
117
+
118
+ ## License
119
+
120
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
121
+
122
+ ## Code of Conduct
123
+
124
+ Everyone interacting in the JWTea project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/b-loyola/jw_tea/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "jw_tea"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/jw_tea.gemspec ADDED
@@ -0,0 +1,33 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "jw_tea/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jw_tea"
8
+ spec.version = JWTea::VERSION
9
+ spec.authors = ["Ben Loyola"]
10
+ spec.email = ["berna.loyola@gmail.com"]
11
+
12
+ spec.summary = "A gem to facilitate JWT authentication in web apps."
13
+ spec.homepage = "https://github.com/b-loyola/jw_tea"
14
+ spec.license = "MIT"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_dependency "jwt"
26
+ spec.add_dependency "redis"
27
+ spec.add_dependency "activesupport"
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.17"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ spec.add_development_dependency "timecop", "~> 0.9"
33
+ end
data/lib/jw_tea.rb ADDED
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ require 'active_support/core_ext/time/calculations'
3
+ require 'active_support/core_ext/numeric/time'
4
+
5
+ require_relative File.join('jw_tea', 'version')
6
+ require_relative File.join('jw_tea', 'kettle')
7
+ Dir[File.join(File.dirname(__FILE__), 'jw_tea', 'stores', '*.rb')].each {|file| require file }
8
+
9
+ module JWTea
10
+ class << self
11
+ attr_writer :configuration
12
+
13
+ def configuration
14
+ @configuration ||= ::JWTea::Configuration.new
15
+ end
16
+
17
+ def configure
18
+ yield(configuration)
19
+ configuration
20
+ end
21
+ end
22
+
23
+ class Configuration
24
+ DEFAULT_EXPIRES_IN = 3600 # seconds (1 hour)
25
+ DEFAULT_ALGORITHM = 'HS256'
26
+
27
+ attr_writer :default_expires_in, :default_algorithm
28
+
29
+ def default_expires_in
30
+ @default_expires_in ||= DEFAULT_EXPIRES_IN
31
+ end
32
+
33
+ def default_algorithm
34
+ @default_algorithm ||= DEFAULT_ALGORITHM
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,8 @@
1
+ module JWTea
2
+ class Error < StandardError; end
3
+ class StoreNotDefinedError < Error; end
4
+ class MissingJtiError < Error; end
5
+ class MissingExpError < Error; end
6
+ class InvalidToken < Error; end
7
+ class TokenAlreadyGenerated < Error; end
8
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+ require_relative 'token'
3
+ require_relative 'exceptions'
4
+
5
+ module JWTea
6
+ class Kettle
7
+ delegate :as_json, :to_json, to: :to_h
8
+
9
+ def initialize(secret:, store:, algorithm: nil, expires_in: nil)
10
+ @secret = secret
11
+ @store = store
12
+ @algorithm = algorithm || ::JWTea.configuration.default_algorithm
13
+ @expires_in = (expires_in || ::JWTea.configuration.default_expires_in).to_i
14
+ end
15
+
16
+ def brew(data)
17
+ exp = @expires_in.seconds.from_now.to_i
18
+ token = ::JWTea::Token.build(data, exp, @secret, @algorithm)
19
+ @store.save(token.jti, token.exp, @expires_in)
20
+ token
21
+ end
22
+
23
+ def pour(encoded_token)
24
+ with_token(encoded_token) do |token|
25
+ raise ::JWTea::InvalidToken.new('token revoked') unless token_exists?(token)
26
+
27
+ token
28
+ end
29
+ rescue ::JWT::DecodeError => e
30
+ raise ::JWTea::InvalidToken.new(e.message)
31
+ end
32
+
33
+ def encode(data)
34
+ token = brew(data)
35
+ token.encoded
36
+ end
37
+
38
+ def decode(encoded_token)
39
+ token = pour(encoded_token)
40
+ token.data
41
+ end
42
+
43
+ def revoke(encoded_token)
44
+ with_token(encoded_token) { |token| @store.delete(token.jti) }
45
+ end
46
+
47
+ def valid?(encoded_token)
48
+ with_token(encoded_token) { |token| token_exists?(token) }
49
+ rescue JWT::DecodeError
50
+ false
51
+ end
52
+
53
+ # Prevent sentitive data from being accidentally logged to console
54
+ def inspect
55
+ "#<#{self.class} expires_in: #{@expires_in}, store: #{@store}>"
56
+ end
57
+
58
+ # Prevent sentitive data from being accidentally rendered to json
59
+ def to_h
60
+ { expires_in: @expires_in }.freeze
61
+ end
62
+
63
+ private
64
+
65
+ def token_exists?(token)
66
+ @store.exists?(token.jti, token.exp)
67
+ end
68
+
69
+ def with_token(encoded_token)
70
+ token = ::JWTea::Token.load(encoded_token, @secret, @algorithm)
71
+ raise ::JWTea::MissingJtiError unless token.jti
72
+ raise ::JWTea::MissingExpError unless token.exp
73
+
74
+ yield(token)
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JWTea
4
+ module Stores
5
+ class NullStore
6
+ def save(_key, _value, _ttl_in_seconds)
7
+ nil
8
+ end
9
+
10
+ def exists?(_key, _value)
11
+ true
12
+ end
13
+
14
+ def delete(_key)
15
+ nil
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ require 'redis'
3
+
4
+ module JWTea
5
+ module Stores
6
+ class RedisStore
7
+ OK = 'OK'
8
+
9
+ def initialize(*redis_options)
10
+ @redis = ::Redis.new(*redis_options)
11
+ end
12
+
13
+ def save(key, value, ttl_in_seconds)
14
+ result = @redis.setex(key, ttl_in_seconds, value.to_s)
15
+ result == OK
16
+ end
17
+
18
+ def exists?(key, value)
19
+ @redis.get(key) == value.to_s
20
+ end
21
+
22
+ def delete(key)
23
+ result = @redis.del(key)
24
+ result == 1
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ require 'jwt'
3
+ require_relative 'token/payload'
4
+
5
+ module JWTea
6
+ class Token
7
+ class << self
8
+ def load(encoded_token, secret, algorithm)
9
+ payload, _header = ::JWT.decode(encoded_token, secret, true, verify_iat: true, algorithm: algorithm)
10
+ new(payload)
11
+ end
12
+
13
+ def build(data, exp, secret, algorithm)
14
+ token = new(data: data, exp: exp)
15
+ token.encoded = ::JWT.encode(token.payload.to_h, secret, algorithm)
16
+ token
17
+ end
18
+ end
19
+
20
+ attr_accessor :encoded
21
+ attr_reader :payload
22
+ delegate :data, :exp, :jti, to: :payload
23
+
24
+ def initialize(payload)
25
+ @payload = JWTea::Token::Payload.from_hash(payload)
26
+ end
27
+
28
+ # Prevent sentitive data from being accidentally logged to console
29
+ def inspect
30
+ to_s
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+ require 'jwt'
3
+
4
+ module JWTea
5
+ class Token
6
+ class Payload
7
+ attr_reader :data, :exp, :iat, :jti
8
+
9
+ class << self
10
+ def from_hash(payload_hash)
11
+ new(payload_hash.transform_keys(&:to_sym))
12
+ end
13
+ end
14
+
15
+ def initialize(data:, exp:, iat: nil, jti: nil)
16
+ @data = data
17
+ @exp = exp
18
+ @iat = iat || Time.current.to_i
19
+ @jti = jti || Digest::MD5.hexdigest([SecureRandom.hex, @iat].join(':'))
20
+ end
21
+
22
+ def to_h
23
+ {
24
+ 'data' => @data,
25
+ 'jti' => @jti,
26
+ 'iat' => @iat,
27
+ 'exp' => @exp,
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JWTea
4
+ VERSION = "0.1.0"
5
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jw_tea
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Loyola
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-11-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jwt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redis
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.17'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.17'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: timecop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.9'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.9'
111
+ description:
112
+ email:
113
+ - berna.loyola@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
+ - CODE_OF_CONDUCT.md
122
+ - Gemfile
123
+ - Gemfile.lock
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - bin/console
128
+ - bin/setup
129
+ - jw_tea.gemspec
130
+ - lib/jw_tea.rb
131
+ - lib/jw_tea/exceptions.rb
132
+ - lib/jw_tea/kettle.rb
133
+ - lib/jw_tea/stores/null_store.rb
134
+ - lib/jw_tea/stores/redis_store.rb
135
+ - lib/jw_tea/token.rb
136
+ - lib/jw_tea/token/payload.rb
137
+ - lib/jw_tea/version.rb
138
+ homepage: https://github.com/b-loyola/jw_tea
139
+ licenses:
140
+ - MIT
141
+ metadata: {}
142
+ post_install_message:
143
+ rdoc_options: []
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ requirements: []
157
+ rubygems_version: 3.0.6
158
+ signing_key:
159
+ specification_version: 4
160
+ summary: A gem to facilitate JWT authentication in web apps.
161
+ test_files: []