summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/controller.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-11-03 15:41:34 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-11-03 15:41:34 +0700
commit75933b6c16a6161930d8a51ac17a10f970f0d15b (patch)
treeebe34bc36bd13a9c366b40bddc6b01f6fa9fa3b5 /indoteknik_api/controllers/controller.py
parent4aa474f3ced6681a1dfd5ec48806eb690e31c3d8 (diff)
allowed_ip_address get from system_parameter
Diffstat (limited to 'indoteknik_api/controllers/controller.py')
-rw-r--r--indoteknik_api/controllers/controller.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py
index d1ecab57..261adf36 100644
--- a/indoteknik_api/controllers/controller.py
+++ b/indoteknik_api/controllers/controller.py
@@ -24,14 +24,8 @@ class Controller(http.Controller):
except:
remote_address = wsgienv['REMOTE_ADDR']
_logger.info("API Request from %s" % remote_address)
- allowed_ip_address = []
- # server website production
- allowed_ip_address.append('34.101.189.218')
- # server website development
- allowed_ip_address.append('34.101.55.147')
- # rafizadanly localhost
- allowed_ip_address.append('182.253.155.143')
- if remote_address in allowed_ip_address:
+ allowed_ip_address = request.env['ir.config_parameter'].get_param('api_allowed_ip_address')
+ if remote_address in allowed_ip_address.split(','):
request.session.authenticate(config.get('db_name'), 'it@fixcomart.co.id', 'Fixcomart378')
return True
return False