mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Check client certificate CN in REPP
This commit is contained in:
parent
b8e4b3ed87
commit
67196217a8
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,14 @@ module Repp
|
||||||
@current_user ||= ApiUser.find_by(username: username, password: password)
|
@current_user ||= ApiUser.find_by(username: username, password: password)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before do
|
||||||
|
if request.ip == ENV['webclient_ip']
|
||||||
|
error! 'Certificate mismatch', 401 if env['HTTP_SSL_CLIENT_S_DN_CN'] != 'webclient'
|
||||||
|
else
|
||||||
|
error! 'Certificate mismatch', 401 if env['HTTP_SSL_CLIENT_S_DN_CN'] != @current_user.username
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
helpers do
|
helpers do
|
||||||
attr_reader :current_user
|
attr_reader :current_user
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue