Skip to content
Snippets Groups Projects
Commit 9070081d authored by qweqweasdasd's avatar qweqweasdasd
Browse files

Authentication using env vars

parent bbad4fa4
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import json
import base64
from sys import argv, exit
import socket
import os
def get_version():
with Gmp(connection, transform=transform) as gmp:
......@@ -244,13 +245,6 @@ class report_formats:
xml = "a994b278-1f62-11e1-96ac-406186ea4fc5"
def get_report_formats():
# |------------- ID -----------------| |--- NAME ---|
# 5057e5cc-b825-11e4-9d0e-28d24461215b Anonymous XML
# c1645568-627a-11e3-a660-406186ea4fc5 CSV Results
# 77bd6c4a-1f62-11e1-abf0-406186ea4fc5 ITG
# c402cc3e-b531-11e1-9163-406186ea4fc5 PDF
# a3810a62-1f62-11e1-9219-406186ea4fc5 TXT
# a994b278-1f62-11e1-96ac-406186ea4fc5 XML
with Gmp(connection, transform=transform) as gmp:
gmp.authenticate(auth_name, auth_passwd)
res = gmp.get_report_formats()
......@@ -401,8 +395,8 @@ def import_dep_info(file_path, endpoints_to_scan):
################ MAIN #######################################
auth_name = "xxxx"
auth_passwd = "xxxxxxxx"
auth_name = os.getenv('GMP_USER')
auth_passwd = os.getenv('GMP_PASSWORD')
logging.basicConfig(filename='debug.log', level=logging.DEBUG)
local_ip = socket.gethostbyname(socket.gethostname())
connection = TLSConnection(hostname=local_ip)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment