token_authenticate_me 0.10.0 → 0.11.0

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
- SHA256:
3
- metadata.gz: 7e477cd7a96389a06de7cb3803c14f6ff5771a30623263f0bdae3084589ef9ec
4
- data.tar.gz: 44a689d5dd260a45bf5fd41d170ddd8ca5061ea7387615d555012c1f0800d1f1
2
+ SHA1:
3
+ metadata.gz: 2c6c6821edac85717a1f7a5fa20e0bd76b8305ea
4
+ data.tar.gz: 4b05d2608af22979442d666e2d6662e9471e4e06
5
5
  SHA512:
6
- metadata.gz: dc9fa03c9fb2e90592a5e9e0894656b7d428a5dcfe3400550e641dc20f692af9b73c1aa669013c787773d704af15e776714fa47b4d08e155d2eb010a3875e091
7
- data.tar.gz: d86112fb68f9251e0d62b5ca29a054e7cbe05043ac17b8f9019d736c4cca96e1c854f9369cc205e382e9406ee1b0a48562b42b07853ffc997871ff9d67c27bce
6
+ metadata.gz: 9315bf14dafc17c604ca0cfee75e0e1317e5b16b54efe5d39c36ef81bf466c11a111f5e9aa25469a7cae1d552b9e1d540c4b16cc47e977c8e42883f396dea11b
7
+ data.tar.gz: 4eba0477377d304b9bb0b9fd2c6dbada4bbbe5780642dd813bd1421451dfd89b30ff012a8498d742511f88badf032bcdb0ee7bd5c53f72808948a9bfee955534
data/README.md CHANGED
@@ -3,6 +3,10 @@ TokenAuthenticateMe
3
3
 
4
4
  This gem adds simple API based token authentication. We at [inigo](http://inigo.io) wanted to be able to handle our entire authentication process -- including account creation and logging in -- through a RESTful API over JSON using token authentication, and found that solutions like Devise required too much hand holding due to its complexity to ultimately get the functionality that we wanted. Unfortunately we were unable to find a satisfactory existing solution -- though I'm sure one does exist, this isn't a new problem -- so we set out to create our own. After using internally on one project, we decided to roll it out into a gem to use on another.
5
5
 
6
+ ## Compatibility
7
+ For rails < 5.x use v0.10.x
8
+ For rails >= 5.x use v0.11.x
9
+
6
10
  ## Upgrade Instructions
7
11
  - For all major and minor run: `rails generate token_authenticate_me:install`
8
12
  - Note: Patch version upgrades shouldnt need to run the install command.
data/config/routes.rb CHANGED
@@ -4,13 +4,6 @@ TokenAuthenticateMe::Engine.routes.draw do
4
4
  resource :session, only: [:create, :show, :destroy]
5
5
  resources :users
6
6
 
7
- resources :invites, except: [:update] do
8
- member do
9
- get 'accept'
10
- get 'decline'
11
- end
12
- end
13
-
14
7
  resources(
15
8
  :password_resets,
16
9
  only: [:create, :update],
@@ -1,4 +1,4 @@
1
- class CreateTokenAuthenticateMeInvites < ActiveRecord::Migration
1
+ class CreateTokenAuthenticateMeInvites < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  enable_extension 'uuid-ossp'
4
4
 
@@ -1,4 +1,4 @@
1
- class CreateTokenAuthenticateMeUsers < ActiveRecord::Migration
1
+ class CreateTokenAuthenticateMeUsers < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :token_authenticate_me_users do |t|
4
4
  t.string :username, null: false
@@ -1,4 +1,4 @@
1
- class CreateTokenAuthenticateMeSessions < ActiveRecord::Migration
1
+ class CreateTokenAuthenticateMeSessions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :token_authenticate_me_sessions do |t|
4
4
  t.string :key, null: false
@@ -1,4 +1,4 @@
1
- class AddIndexToUsers < ActiveRecord::Migration
1
+ class AddIndexToUsers < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_index :token_authenticate_me_users, :password_digest, unique: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class DowncaseUsernameEmail < ActiveRecord::Migration
1
+ class DowncaseUsernameEmail < ActiveRecord::Migration[4.2]
2
2
  class TokenAuthenticateMe::User < ActiveRecord::Base
3
3
  end
4
4
 
@@ -11,7 +11,6 @@ module TokenAuthenticateMe
11
11
  included do
12
12
 
13
13
  has_many :sessions, dependent: :destroy
14
- has_many :invites, inverse_of: 'creator', foreign_key: 'creator_id'
15
14
 
16
15
  before_save :downcase_email_and_username
17
16
 
@@ -1,3 +1,3 @@
1
1
  module TokenAuthenticateMe
2
- VERSION = '0.10.0'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: token_authenticate_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-20 00:00:00.000000000 Z
12
+ date: 2018-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -74,11 +74,9 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - MIT-LICENSE
78
77
  - README.md
79
78
  - Rakefile
80
79
  - app/controllers/token_authenticate_me/api/v1/base_controller.rb
81
- - app/controllers/token_authenticate_me/api/v1/invites_controller.rb
82
80
  - app/controllers/token_authenticate_me/api/v1/password_resets_controller.rb
83
81
  - app/controllers/token_authenticate_me/api/v1/sessions_controller.rb
84
82
  - app/controllers/token_authenticate_me/api/v1/users_controller.rb
@@ -86,12 +84,10 @@ files:
86
84
  - app/helpers/token_authenticate_me/application_helper.rb
87
85
  - app/mailers/token_authenticate_me_mailer.rb
88
86
  - app/models/token_authenticate_me/default_token_handler.rb
89
- - app/models/token_authenticate_me/invite.rb
90
87
  - app/models/token_authenticate_me/session.rb
91
88
  - app/models/token_authenticate_me/user.rb
92
89
  - app/views/token_authenticate_me_mailer/invalid_user_reset_password_email.html.erb
93
90
  - app/views/token_authenticate_me_mailer/invalid_user_reset_password_email.text.erb
94
- - app/views/token_authenticate_me_mailer/invite_user_email.html.erb
95
91
  - app/views/token_authenticate_me_mailer/session/new.html.erb
96
92
  - app/views/token_authenticate_me_mailer/valid_user_reset_password_email.html.erb
97
93
  - app/views/token_authenticate_me_mailer/valid_user_reset_password_email.text.erb
@@ -119,7 +115,6 @@ files:
119
115
  - lib/token_authenticate_me/concerns/controllers/token_authenticateable.rb
120
116
  - lib/token_authenticate_me/concerns/controllers/token_sessionable.rb
121
117
  - lib/token_authenticate_me/concerns/models/authenticatable.rb
122
- - lib/token_authenticate_me/concerns/models/invitable.rb
123
118
  - lib/token_authenticate_me/concerns/models/passwordable.rb
124
119
  - lib/token_authenticate_me/concerns/models/sessionable.rb
125
120
  - lib/token_authenticate_me/configuration.rb
@@ -159,6 +154,7 @@ files:
159
154
  - test/dummy/config/locales/en.yml
160
155
  - test/dummy/config/routes.rb
161
156
  - test/dummy/config/secrets.yml
157
+ - test/dummy/log/test.log
162
158
  - test/dummy/public/404.html
163
159
  - test/dummy/public/422.html
164
160
  - test/dummy/public/500.html
@@ -192,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
188
  version: '0'
193
189
  requirements: []
194
190
  rubyforge_project:
195
- rubygems_version: 2.7.6
191
+ rubygems_version: 2.5.2
196
192
  signing_key:
197
193
  specification_version: 4
198
194
  summary: This gem adds simple token authentication to users.
@@ -225,6 +221,7 @@ test_files:
225
221
  - test/dummy/config/routes.rb
226
222
  - test/dummy/config/secrets.yml
227
223
  - test/dummy/config.ru
224
+ - test/dummy/log/test.log
228
225
  - test/dummy/public/404.html
229
226
  - test/dummy/public/422.html
230
227
  - test/dummy/public/500.html
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2016 Sam Clopton
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,14 +0,0 @@
1
- require 'token_authenticate_me/concerns/controllers/invitable'
2
-
3
- module TokenAuthenticateMe
4
- module Api
5
- module V1
6
- class InvitesController < BaseController
7
- include TokenAuthenticateMe::Concerns::Controllers::Invitable
8
-
9
- model TokenAuthenticateMe::Invite
10
- serializer TokenAuthenticateMe::InviteSerializer
11
- end
12
- end
13
- end
14
- end
@@ -1,11 +0,0 @@
1
- require 'token_authenticate_me/concerns/models/invitable'
2
-
3
- module TokenAuthenticateMe
4
- class Invite < ActiveRecord::Base
5
- include TokenAuthenticateMe::Concerns::Models::Invitable
6
-
7
- def accept!(current_user)
8
- # no-op, override for app specific accept logic
9
- end
10
- end
11
- end
@@ -1,20 +0,0 @@
1
- require 'active_support/concern'
2
-
3
- module TokenAuthenticateMe
4
- module Concerns
5
- module Models
6
- module Invitable
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- belongs_to :creator, class_name: User
11
-
12
- validates :requestor, presence: true
13
- validates :email, presence: true
14
-
15
- default_scope { order('created_at ASC') }
16
- end
17
- end
18
- end
19
- end
20
- end