Skip to content

Conversation

@eldenpark
Copy link
Collaborator

Pull Request

Thank you for raising a Pull Request. Please follow the instruction.

  • I’ve read CONTRIBUTING.md and followed the guidelines.

Summary

Links (Issue References, etc, if there's any)


# Build crypto/bytes
WORKDIR /home/node/oko
RUN yarn workspaces focus @oko-wallet/bytes
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

question

@chemonoworld chemonoworld changed the title o issue/48 Nov 12, 2025
@@ -0,0 +1 @@
// TODO: @retto
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

RAISE EXCEPTION 'audit_event is append-only';
END; $$ LANGUAGE plpgsql;

CREATE TRIGGER audit_event_block_u BEFORE UPDATE ON audit_event
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lidarbtc Do we have to define "trigger" event? I'm generally quite against this idea. What's the use? (curious)

Copy link
Contributor

Choose a reason for hiding this comment

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

My intention is to prevent updates and deletions in the database even if the app is compromised. I anticipate such situations would be limited, so if you think this is excessive, I'll remove it.

// Create audit context for login route
const auditContext: AuditContext = {
db: state.db,
adminUserId: undefined, // Not authenticated yet
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What's the use?

Copy link
Contributor

Choose a reason for hiding this comment

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

by default, AuditContext require admin's id string and user login route doesn't have admin's id string so I made custom audit context for this route.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is quite an arbitrary string concat. Maybe we can at least define function to create this string concat and name the function with the intent?

Upon reconsideration, the login should probably be adminUserId set to “system”. I will remove this and make it to use default AuditContext.

@eldenpark eldenpark merged commit ddeff26 into main Nov 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants