Skip to content

docs: Add Audit logs usage and internal develop guide #786

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

Merged
merged 3 commits into from
Jun 23, 2025

Conversation

sakshamarora1
Copy link
Contributor

No description provided.

@sakshamarora1 sakshamarora1 moved this from In progress to In review 🔍 in Sprint Q3/2025 ☀️ Jun 20, 2025

### Storage

To maintain consistency across storage backends, such as the database and the configured search backend (e.g., OpenSearch), the Unit of Work (UoW) pattern is used. This ensures that all operations, including creation, updates, and indexing, are handled transactionally, keeping the database and search indexes synchronized.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To maintain consistency across storage backends, such as the database and the configured search backend (e.g., OpenSearch), the Unit of Work (UoW) pattern is used. This ensures that all operations, including creation, updates, and indexing, are handled transactionally, keeping the database and search indexes synchronized.
The Unit of Work (UoW) pattern is used to maintain consistency across storage backends, such as the database and the configured search backend (e.g., OpenSearch). This ensures that all operations, including creation, updates, and indexing, are handled transactionally, keeping the database and search indexes synchronized.


### Permissions

Access to audit logs is controlled via the Invenio permissions system. Currently only the System User can create the audit log and administrators can read. The permissions can be updated in the permission policy class to extended, for example, providing read access to the logs to other user roles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Access to audit logs is controlled via the Invenio permissions system. Currently only the System User can create the audit log and administrators can read. The permissions can be updated in the permission policy class to extended, for example, providing read access to the logs to other user roles.
Access to audit logs is controlled via the Invenio permissions system. Currently only the System User can create audit logs and administrators can read them. The permissions can be updated in the permission policy class to, for example, provide read access to other user roles.

Copy link
Contributor

@carlinmack carlinmack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :) Couple edits

@carlinmack carlinmack moved this from In review 🔍 to In progress in Sprint Q3/2025 ☀️ Jun 20, 2025
@carlinmack carlinmack moved this from In progress to In review 🔍 in Sprint Q3/2025 ☀️ Jun 20, 2025
Copy link
Contributor

@kpsherva kpsherva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff! do we have it in release notes already?

@kpsherva kpsherva moved this from In review 🔍 to To release 🤖 in Sprint Q3/2025 ☀️ Jun 20, 2025
@ntarocco ntarocco force-pushed the docs/add-audit-logs branch from ce5bb9c to b803fd8 Compare June 23, 2025 11:55
@ntarocco ntarocco merged commit a9daa7d into inveniosoftware:master Jun 23, 2025
1 check failed
uow.register(AuditLogOp(CustomActionAuditLog.build(identity, resource_id, ...)))
```

By following these steps, you can extend the audit logging system to include custom actions tailored to your instance's needs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placement notes: If the "How to track more actions" section is directed at instance operators, then it should be moved to the "Operate an Instance" section. Otherwise this can be reworded to tailored to your module's needs.


```

4. **Use the action in your module**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbered list resets to 1. for each paragraph when the page is rendered. There is some spacing that needs to be fixed to address that.


The feature can be enabled by setting the `AUDIT_LOGS_ENABLED` flag to `True`.

## Adminstration panel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placement: This should be moved and merged with the audit logs section in the "Use" section since it's really what this is about.

@ntarocco ntarocco mentioned this pull request Jul 3, 2025
15 tasks
@ntarocco
Copy link
Contributor

ntarocco commented Jul 3, 2025

@fenekku Thanks! All comments collected here #812

@ntarocco ntarocco moved this from To release 🤖 to Released ✔️ in Sprint Q3/2025 ☀️ Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released ✔️
Development

Successfully merging this pull request may close these issues.

6 participants