Skip to content

TAXII-2 Bug Fixes #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix error for opentaxii-sync-data
When a collection that does not exist is used in a data-configuration
file, a warning is produced
  • Loading branch information
aams-eam committed Dec 29, 2023
commit 171e99bfb47b9280818a0f488ea3c6945271f150
8 changes: 5 additions & 3 deletions opentaxii/auth/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import structlog
from opentaxii.persistence.exceptions import DoesNotExistError

log = structlog.getLogger(__name__)

Expand Down Expand Up @@ -58,11 +59,12 @@ def update_account(self, account, password):
# Check for taxii2 collections
for api_root, collections in list(account.permissions.get("taxii2", {}).items()):
for colname, permission in collections.items():
collection = self.server.servers.taxii2.persistence.get_collection(api_root, colname)
if not collection:
try:
collection = self.server.servers.taxii2.persistence.get_collection(api_root, colname)
except DoesNotExistError:
log.warning(
"update_account.unknown_collection",
collection=colname)
api_root=api_root, collection=colname)
else:
permission_collections[str(collection.id)] = permission

Expand Down