mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
Implement shared key authentication to bounces API
This commit is contained in:
parent
b2c5a9a5ec
commit
03182f9222
3 changed files with 11 additions and 1 deletions
|
@ -10,6 +10,11 @@ module Api
|
|||
head :unauthorized unless ip_allowed
|
||||
end
|
||||
|
||||
def authenticate_shared_key
|
||||
api_key = "Basic #{ENV['api_shared_key']}"
|
||||
head(:unauthorized) unless api_key == request.authorization
|
||||
end
|
||||
|
||||
def not_found_error
|
||||
uuid = params['uuid']
|
||||
json = { error: 'Not Found', uuid: uuid, message: 'Record not found' }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue