-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PXP-7805 Fetch audit logs from an AWS SQS (#2)
- Loading branch information
1 parent
b80f783
commit 6af2bc8
Showing
21 changed files
with
579 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Creating audit logs | ||
|
||
## Async POST endpoint | ||
|
||
The audit log creation endpoints is an async endpoint: | ||
- POSTing audit logs does not impact the performance of the caller. | ||
- Audit Service failures are not visible to users (for example, we don’t want to return a 500 error to users who are trying to download). | ||
|
||
However, it's difficult to monitor errors when using this endpoint. | ||
|
||
## Pulling from a queue | ||
|
||
The audit service can also handle pulling audit logs from a queue, which allows for easier monitoring. This can be configured by turning on the `PULL_FROM_QUEUE` flag in the configuration file (enabled by default). Right now, only AWS SQS is integrated, but integrations for other types of queues can be added by adding code and extending the values accepted for the `QUEUE_CONFIG.type` field in the configuration file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
migrations/versions/fd0510a0a9aa_optional_presigned_url_resource_paths.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""optional presigned_url resource_paths | ||
Revision ID: fd0510a0a9aa | ||
Revises: d5b18185c458 | ||
Create Date: 2021-05-25 15:06:06.372742 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "fd0510a0a9aa" | ||
down_revision = "d5b18185c458" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
table_name = "presigned_url" | ||
|
||
|
||
def upgrade(): | ||
op.alter_column(table_name, "resource_paths", nullable=True) | ||
|
||
|
||
def downgrade(): | ||
# replace null values with an empty array | ||
op.execute( | ||
f"UPDATE {table_name} SET resource_paths=ARRAY[]::VARCHAR[] WHERE resource_paths IS NULL" | ||
) | ||
op.alter_column(table_name, "resource_paths", nullable=False) |
Oops, something went wrong.