lockie 0.4.5 → 0.5.2

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: 86eac2be7c9981eb52904045b83103de633140c29fe6c1f8a58a05509ae10d2f
4
- data.tar.gz: fa61c62cfc66f650bb288f8d29fa6b45a9d515635da2051fd50943ff2ac4cb8c
3
+ metadata.gz: 27d5888160628cbede6cdddc542ea8f8638500e787f2eda93be425b1f556ab2e
4
+ data.tar.gz: 5897d3386ab1e1e7834a6884a113684910eb1d083af02791e39bad53010fb98a
5
5
  SHA512:
6
- metadata.gz: 567d4b868e544121f9f62274634e6b50319774d4b8f8c479c04112016e669d3a930e4d74ea5d68bf5b8097a7ff9fc71201e1026a259c5eee40fba993b79a17e6
7
- data.tar.gz: 24c141be113f8cc783c9a03ad9fb01e2cc139393215580e6703194cdb70cdbb537a5fe2e9420959c9200807eb7f99925a369a3338b842e5e891fbbd145a9e215
6
+ metadata.gz: 5a1d6bdc871802e2eea30cbafd49588e7c4f52299e270066239ff7fdc82d780a177890681437c57b186fbe25b20148e52002c4d2539a8dbe89d48247bc352fb7
7
+ data.tar.gz: b99066c6de4ca0648ed2817681968109b9cdd2650f32c5d6c8ca981e2789d03a56932c09b8947166c9ddcecf4404ceb519e5c33697b06379a25bbbec13c6971b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/melvinsembrano/lockie.svg?branch=master)](https://travis-ci.org/melvinsembrano/lockie)
1
+ [![Build Status](https://github.com/melvinsembrano/lockie/actions/workflows/00_test.yml/badge.svg)](https://github.com/melvinsembrano/lockie/actions/workflows/00_test.yml)
2
2
  [![Gem Version](https://badge.fury.io/rb/lockie.svg)](https://badge.fury.io/rb/lockie)
3
3
 
4
4
  # Lockie
@@ -9,7 +9,7 @@ A drop-in, none assuming warden based Password and JWT authentication for Rails
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'lockie', '~> 0.3.3'
12
+ gem 'lockie', '~> 0.5.2'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -82,6 +82,7 @@ Lockie.configure do |c|
82
82
  c.model_name = "Account" # default to 'User'
83
83
  c.unauthenticated_path = "/some/login/path" # default to '/login'
84
84
  c.hash_algorithm = "HS512" # default to 'HS256'
85
+ c.session_timeout = 14.days
85
86
 
86
87
  # add custom warden strategy, default strategies and priority are [:email_password, :jwt]
87
88
  c.default_strategies = [:auth0, :jwt]
@@ -13,7 +13,7 @@ module Lockie
13
13
  def unauthenticated
14
14
  if request.xhr?
15
15
  api_response(:text)
16
- elsif request.format.to_sym == :json || request.content_type.to_s.split("/").last == 'json'
16
+ elsif request.format.to_sym == :json || request.media_type.to_s.split("/").last == 'json'
17
17
  api_response(:json)
18
18
  else
19
19
  html_response
data/lib/lockie/rails.rb CHANGED
@@ -5,7 +5,7 @@ module Lockie
5
5
 
6
6
  config.app_middleware.use Warden::Manager do |manager|
7
7
  manager.default_strategies Lockie.config.default_strategies
8
- manager.failure_app = Lockie::FailureApp
8
+ manager.failure_app = Lockie.config.failure_app
9
9
 
10
10
  if Lockie.config.serialize_session
11
11
  serializer_to_session = Lockie.config.serializer_to_session || proc { |u| [u.class.name, u.id] }
@@ -1,3 +1,3 @@
1
1
  module Lockie
2
- VERSION = '0.4.5'
2
+ VERSION = '0.5.2'
3
3
  end
data/lib/lockie.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'rails'
2
2
  require 'warden'
3
3
  require_relative "lockie/rails"
4
+ require_relative "lockie/failure_app"
4
5
  require_relative "lockie/log_helper"
5
6
  require_relative "lockie/model_helper"
6
7
  require_relative "lockie/controller_helper"
@@ -9,7 +10,6 @@ require_relative "lockie/strategies/jwt"
9
10
  require_relative "lockie/strategies/failed"
10
11
 
11
12
  module Lockie
12
- autoload :FailureApp, 'lockie/failure_app'
13
13
 
14
14
  class Configuration
15
15
  attr_accessor :model_name
@@ -22,6 +22,7 @@ module Lockie
22
22
  attr_accessor :scopes
23
23
  attr_accessor :serializer_to_session, :serializer_from_session
24
24
  attr_accessor :session_timeout
25
+ attr_accessor :failure_app
25
26
 
26
27
  def initialize
27
28
  @model_name = "User"
@@ -34,6 +35,7 @@ module Lockie
34
35
  @serializer_to_session = nil
35
36
  @serializer_from_session = nil
36
37
  @session_timeout = 3.hours
38
+ @failure_app = Lockie::FailureApp
37
39
  end
38
40
  end
39
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melvin Sembrano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-23 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.0.3.1
138
+ rubygems_version: 3.3.26
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Drop in password and JWT token authentication for Ruby on Rails