Skip to content

Commit

Permalink
add missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fqrious committed Dec 17, 2024
1 parent 748363d commit 4ca5c9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
schemathesis
schemathesis
https://github.com/muchdogesec/stix2arango/archive/main.zip?v=kz
27 changes: 14 additions & 13 deletions tests/st_hooks/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,23 @@ def after_load_schema(
schema: BaseOpenAPISchema,):
logging.info("Running stix2arango")

from stix2arango.stix2arango import Stix2Arango
username = os.getenv('ARANGODB_USERNAME')
password = os.getenv('ARANGODB_PASSWORD')
try:
Stix2Arango(database=TEST_DB, collection=TEST_COLLECTION, file=None, host_url=os.getenv('ARANGODB_HOST_URL'), username=username, password=password)
username = os.getenv('ARANGODB_USERNAME', 'root')
password = os.getenv('ARANGODB_PASSWORD', '')

@schema.auth()
class MyAuth:
def get(self, case, context):
return True

@schema.auth()
class MyAuth:
def get(self, case, context):
return True
def set(self, case, data, context):
case.headers = case.headers or {}

def set(self, case, data, context):
case.headers = case.headers or {}
token = b64encode(f"{username}:{password}".encode('utf-8')).decode("ascii")
case.headers["Authorization"] = f'Basic {token}'

token = b64encode(f"{username}:{password}".encode('utf-8')).decode("ascii")
case.headers["Authorization"] = f'Basic {token}'
try:
from stix2arango.stix2arango import Stix2Arango
Stix2Arango(database=TEST_DB, collection=TEST_COLLECTION, file=None, host_url=os.getenv('ARANGODB_HOST_URL'), username=username, password=password)
except:
logging.info("failed to auth")

0 comments on commit 4ca5c9f

Please sign in to comment.