mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Refactor ID card sign-in
- Extract to Devise custom strategy - Use `SSL_CLIENT_S_DN_CN` env variable instead of `SSL_CLIENT_S_DN` to get ID card data - Remove `database_authenticatable` strategy from `RegistrantUser` Closes #1047
This commit is contained in:
parent
27976c3fbd
commit
a08f063640
20 changed files with 266 additions and 89 deletions
13
test/lib/devise/strategies/id_card_authenticatable_test.rb
Normal file
13
test/lib/devise/strategies/id_card_authenticatable_test.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
require 'test_helper'
|
||||
|
||||
class IdCardAuthenticatableTest < ActiveSupport::TestCase
|
||||
def test_valid_when_id_card_data_is_present_in_env
|
||||
strategy = Devise::Strategies::IdCardAuthenticatable.new({ 'SSL_CLIENT_S_DN_CN' => 'some' })
|
||||
assert strategy.valid?
|
||||
end
|
||||
|
||||
def test_not_valid_when_id_card_data_is_absent_in_env
|
||||
strategy = Devise::Strategies::IdCardAuthenticatable.new({})
|
||||
assert_not strategy.valid?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue