Skip to content

Commit

Permalink
redaced the apikey and fixed top-level card import
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiogermann committed Aug 20, 2024
1 parent a42d179 commit 1199278
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions guruCollectionToConfluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import requests
import os
import sys
import re
import mimetypes
import datetime
import logging
Expand Down Expand Up @@ -519,7 +519,12 @@ def initiate_log(quiet):
seed(datetime.datetime.now().timestamp())

initiate_log(args.quiet)
logging.info('Arguments {}'.format(args))

# Regular expression pattern to find the apikey value
pattern = r"(apikey=')\w+(')"
# Replace the value of apikey with "**********"
sanitized_arguments = re.sub(pattern, r"\1**********\2", 'Arguments {}'.format(args))
logging.info(sanitized_arguments)

if args.datedisclaimer is None:
datedisclaimer = 'no'
Expand Down Expand Up @@ -567,5 +572,9 @@ def initiate_log(quiet):
folder = ConfluencePage("unknown", "-1", rootNode.id, "<h2>unknown</h2>", item['ID'])
rootNode.add_child(folder)
fill_folder(folder, item['ID'], args.collectiondir + "/folders/")
if item['Type'] == 'card' and export_version == 2:
card = ConfluencePage("unknown", "-1", rootNode.id, "<h2>unknown</h2>", item['ID'])
rootNode.add_child(card)
fill_card(card, item['ID'], args.collectiondir + "/cards/")
for page in rootNode.children:
create_node(page, args.org, args.spacekey, args.username, args.apikey, args.collectiondir)

0 comments on commit 1199278

Please sign in to comment.