Confluence Data Center Edge Cases (#631)

This commit is contained in:
Yuhong Sun 2023-10-25 21:52:07 -07:00 committed by GitHub
parent a8b7155b5e
commit 379e71160a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,8 @@ class ConfluenceConnector(LoadConnector, PollConnector):
url=self.wiki_base,
# passing in username causes issues for Confluence data center
username=username if self.is_cloud else None,
password=access_token,
password=access_token if self.is_cloud else None,
token=access_token if not self.is_cloud else None,
cloud=self.is_cloud,
)
return None
@ -250,6 +251,13 @@ class ConfluenceConnector(LoadConnector, PollConnector):
author = page["version"].get("by", {}).get("email")
last_modified = datetime.fromisoformat(last_modified_str)
if last_modified.tzinfo is None:
# If no timezone info, assume it is UTC
last_modified = last_modified.replace(tzinfo=timezone.utc)
else:
# If not in UTC, translate it
last_modified = last_modified.astimezone(timezone.utc)
if time_filter is None or time_filter(last_modified):
page_id = page["id"]