authentication-zero 2.16.13 → 2.16.14

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: fd4aba188e6a8763ada4f0cc90f370e8980afd0903e3e5f17a5f4bcc5db7c8d6
4
- data.tar.gz: 8e16e20f5ed9d2cf1aadd469bdeffae20e1c51ab030bb5731697ae37dd749079
3
+ metadata.gz: e0f83db44ee39461a039edbf34e4ab4b1af7698fc537361607b120310e3d828e
4
+ data.tar.gz: ecbf7f8578a9612f30bd7d19d9c482c7d9dbf62e2a28fa148f25c7cb5eb3bad6
5
5
  SHA512:
6
- metadata.gz: dc0688a6b1fae46b456d7c7ce473f1a4414f13bf9bc29439c6d687a67e9122d58eb76e592ef2796c79f1b0e19816e66e6a92f7278dc9df31c9595382108016ce
7
- data.tar.gz: 06d51e04679f0821a4cb296f2e06f588c0614b75ae1f8ca6ce370cbca494d950280b617e8f6346539ddbe8d412838c9fdb9fceb4b6315d47b3471e30b9b7cd19
6
+ metadata.gz: c8b1ed8282c418a5941295a522640ec2bcbc43fcd5dd8f6743333a860051c7c2858301d019f4f3400e217e2a385527809ab7bee61ef49306e4f6aba88bbdad38
7
+ data.tar.gz: 48220896d353c7aa5c37584f84ec4bd75d189f2205440fe754256fd2cfb885d31a2e87859d8756ec54502ef1e5f6cad51eede0662b664a26dc9f2daa066ea8e6
@@ -5,9 +5,7 @@
5
5
  # This workflow will install a prebuilt Ruby version, install dependencies, and
6
6
  # run tests and linters.
7
7
  name: "Generate sample app and run tests"
8
- on:
9
- push:
10
- branches: ["*"]
8
+ on: [push]
11
9
  jobs:
12
10
  test_html:
13
11
  name: 🧪 Run HTML Tests
@@ -26,16 +24,36 @@ jobs:
26
24
  - name: Install the latest Rails gem
27
25
  run: gem install rails
28
26
 
29
- - name: Create fresh Rails app then run generator and tests
30
- env:
31
- CI: true
27
+ - name: Create fresh Rails app and run generator
32
28
  run: |
33
29
  rails new test-app
34
30
  cd test-app
31
+ wget https://raw.githubusercontent.com/lazaronixon/authentication-zero/master/.rubocop.yml
35
32
  bundle add authentication-zero --github ${{ github.repository }} --branch ${{ github.ref_name }}
36
33
  bin/rails generate authentication
37
34
  bundle install
38
35
  bin/rails db:migrate
36
+
37
+
38
+ - name: Install Rubocop
39
+ run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
40
+
41
+ - name: Rubocop
42
+ run: |
43
+ cd test-app
44
+ rubocop
45
+
46
+ - name: Install brakeman
47
+ run: gem install brakeman
48
+
49
+ - name: Brakeman
50
+ run: |
51
+ cd test-app
52
+ brakeman
53
+
54
+ - name: Tests
55
+ run: |
56
+ cd test-app
39
57
  bin/rails test
40
58
  bin/rails test:system
41
59
  test_api:
@@ -55,14 +73,34 @@ jobs:
55
73
  - name: Install the latest Rails gem
56
74
  run: gem install rails
57
75
 
58
- - name: Create fresh Rails app then run generator and tests
59
- env:
60
- CI: true
76
+ - name: Create fresh Rails app and run generator
61
77
  run: |
62
- rails new test-app --api
78
+ rails new test-app
63
79
  cd test-app
80
+ wget https://raw.githubusercontent.com/lazaronixon/authentication-zero/master/.rubocop.yml
64
81
  bundle add authentication-zero --github ${{ github.repository }} --branch ${{ github.ref_name }}
65
- bin/rails generate authentication
82
+ bin/rails generate authentication --api
66
83
  bundle install
67
84
  bin/rails db:migrate
85
+
86
+ - name: Install Rubocop
87
+ run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
88
+
89
+ - name: Rubocop
90
+ run: |
91
+ cd test-app
92
+ rubocop
93
+
94
+ - name: Install brakeman
95
+ run: gem install brakeman
96
+
97
+ - name: Brakeman
98
+ run: |
99
+ cd test-app
100
+ brakeman
101
+
102
+ - name: Tests
103
+ run: |
104
+ cd test-app
68
105
  bin/rails test
106
+
data/.rubocop.yml CHANGED
@@ -1,15 +1,8 @@
1
- inherit_from: https://raw.githubusercontent.com/rails/rails/master/.rubocop.yml
1
+ inherit_from: https://raw.githubusercontent.com/rails/rails/v7.0.4/.rubocop.yml
2
2
 
3
- Performance:
3
+ Style/HashSyntax:
4
4
  Exclude:
5
- - 'test/**/*'
5
+ - Gemfile
6
6
 
7
7
  Style/FrozenStringLiteralComment:
8
8
  Enabled: false
9
-
10
- Style/StringLiterals:
11
- Enabled: true
12
- EnforcedStyle: double_quotes
13
- Include:
14
- - 'app/**/*'
15
- - 'test/**/*'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## Authentication Zero 2.16.14 ##
2
+
3
+ * Remove password requirements
4
+ * Rubocop compliant
5
+ * Brakeman compliant
6
+
1
7
  ## Authentication Zero 2.16.13 ##
2
8
 
3
9
  * Enable resend invitation
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.16.13)
4
+ authentication-zero (2.16.14)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.16.13"
2
+ VERSION = "2.16.14"
3
3
  end
@@ -125,7 +125,7 @@ class AuthenticationGenerator < Rails::Generators::Base
125
125
  end
126
126
 
127
127
  def add_routes
128
- route "root 'home#index'" unless options.api?
128
+ route 'root "home#index"' unless options.api?
129
129
 
130
130
  if sudoable?
131
131
  route "resource :sudo, only: [:new, :create]", namespace: :sessions
@@ -136,9 +136,9 @@ class AuthenticationGenerator < Rails::Generators::Base
136
136
  end
137
137
 
138
138
  if omniauthable?
139
- route "post '/auth/:provider/callback', to: 'sessions/omniauth#create'"
140
- route "get '/auth/:provider/callback', to: 'sessions/omniauth#create'"
141
- route "get '/auth/failure', to: 'sessions/omniauth#failure'"
139
+ route 'post "/auth/:provider/callback", to: "sessions/omniauth#create"'
140
+ route 'get "/auth/:provider/callback", to: "sessions/omniauth#create"'
141
+ route 'get "/auth/failure", to: "sessions/omniauth#failure"'
142
142
  end
143
143
 
144
144
  if two_factor?
@@ -153,13 +153,14 @@ class AuthenticationGenerator < Rails::Generators::Base
153
153
  route "resource :password_reset, only: [:new, :edit, :create, :update]", namespace: :identity
154
154
  route "resource :email_verification, only: [:show, :create]", namespace: :identity
155
155
  route "resource :email, only: [:edit, :update]", namespace: :identity
156
+
156
157
  route "resource :invitation, only: [:new, :create]" if invitable?
157
158
  route "resource :password, only: [:edit, :update]"
158
159
  route "resources :sessions, only: [:index, :show, :destroy]"
159
- route "post 'sign_up', to: 'registrations#create'"
160
- route "get 'sign_up', to: 'registrations#new'" unless options.api?
161
- route "post 'sign_in', to: 'sessions#create'"
162
- route "get 'sign_in', to: 'sessions#new'" unless options.api?
160
+ route 'post "sign_up", to: "registrations#create"'
161
+ route 'get "sign_up", to: "registrations#new"' unless options.api?
162
+ route 'post "sign_in", to: "sessions#create"'
163
+ route 'get "sign_in", to: "sessions#new"' unless options.api?
163
164
  end
164
165
 
165
166
  def create_test_files
@@ -2,7 +2,7 @@ class Identity::EmailsController < ApplicationController
2
2
  before_action :set_user
3
3
 
4
4
  def update
5
- if !@user.authenticate(params[:current_password])
5
+ if !@user.authenticate(params[:current_password])
6
6
  render json: { error: "The password you entered is incorrect" }, status: :bad_request
7
7
  elsif @user.update(user_params)
8
8
  render_show
@@ -5,7 +5,7 @@ class Identity::EmailsController < ApplicationController
5
5
  end
6
6
 
7
7
  def update
8
- if !@user.authenticate(params[:current_password])
8
+ if !@user.authenticate(params[:current_password])
9
9
  redirect_to edit_identity_email_path, alert: "The password you entered is incorrect"
10
10
  elsif @user.update(user_params)
11
11
  redirect_to_root
@@ -16,7 +16,7 @@ class InvitationsController < ApplicationController
16
16
 
17
17
  private
18
18
  def user_params
19
- params.permit(:email).merge(password: SecureRandom::base58, verified: true)
19
+ params.permit(:email).merge(password: SecureRandom.base58, verified: true)
20
20
  end
21
21
 
22
22
  def send_invitation_instructions
@@ -21,7 +21,7 @@ class Sessions::OmniauthController < ApplicationController
21
21
 
22
22
  private
23
23
  def user_params
24
- { email: omniauth.info.email, password: SecureRandom::base58, verified: true }
24
+ { email: omniauth.info.email, password: SecureRandom.base58, verified: true }
25
25
  end
26
26
 
27
27
  def omniauth_params
@@ -16,7 +16,7 @@ class User < ApplicationRecord
16
16
  <%- end -%>
17
17
 
18
18
  validates :email, presence: true, uniqueness: true, format: { with: URI::MailTo::EMAIL_REGEXP }
19
- validates :password, allow_nil: true, length: { minimum: 12 }, format: { with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ }
19
+ validates :password, allow_nil: true, length: { minimum: 12 }
20
20
  <%- if options.pwned? -%>
21
21
  validates :password, not_pwned: { message: "might easily be guessed" }
22
22
  <%- end -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.13
4
+ version: 2.16.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon