2019-08-16 17:59:44 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
2019-10-17 16:39:43 +02:00
|
|
|
import sys
|
2019-08-16 17:59:44 +02:00
|
|
|
import redis
|
|
|
|
|
2019-10-29 16:52:33 +01:00
|
|
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages'))
|
2020-02-19 16:15:41 +01:00
|
|
|
import Correlation
|
2019-08-16 17:59:44 +02:00
|
|
|
|
2019-10-29 16:52:33 +01:00
|
|
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/'))
|
|
|
|
import ConfigLoader
|
|
|
|
|
|
|
|
config_loader = ConfigLoader.ConfigLoader()
|
|
|
|
serv_metadata = config_loader.get_redis_conn("ARDB_Metadata")
|
|
|
|
config_loader = None
|
|
|
|
|
2020-02-11 15:48:30 +01:00
|
|
|
pgp = Correlation.Correlation('pgpdump', ['key', 'mail', 'name'])
|
2019-08-16 17:59:44 +02:00
|
|
|
|
|
|
|
def get_pgp(request_dict, pgp_type):
|
|
|
|
# basic verification
|
2020-02-19 16:15:41 +01:00
|
|
|
res = pgp.verify_correlation_field_request(request_dict, pgp_type)
|
2019-08-16 17:59:44 +02:00
|
|
|
if res:
|
|
|
|
return res
|
|
|
|
# cerify address
|
|
|
|
field_name = request_dict.get(pgp_type)
|
|
|
|
|
2020-02-19 16:15:41 +01:00
|
|
|
return pgp.get_correlation(request_dict, pgp_type, field_name)
|