Skip to content

fix: regenerate-iam audit_log column names and admin bucket access - #31

Merged
neuromechanist merged 2 commits into
mainfrom
fix/regenerate-iam-audit-log
Jan 18, 2026
Merged

neuromechanist merged 2 commits into
mainfrom
fix/regenerate-iam-audit-log

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Fix regenerate-iam endpoint failing due to wrong audit_log column names (entity_type/entity_id instead of resource_type/resource_id)
  • Add full S3 bucket access for admin users instead of dataset-specific access
  • Update CLI to display admin status in output

Test plan

  • Verified the issue with direct API call showing "table audit_log has no column named entity_type"
  • After deploying backend, test nemar admin regenerate-iam yahya for admin user
  • Test nemar admin regenerate-iam cool-vibers for regular user
  • Verify admin gets full bucket access in AWS IAM policy
  • Verify regular user gets only their datasets in policy

Fixes #30

- Fix audit_log INSERT using wrong column names (entity_type/entity_id
  instead of resource_type/resource_id)
- Add generateAdminS3PolicyDocument for admin users with full bucket access
- Admin users now get full S3 bucket access instead of dataset-specific
- Update CLI to display admin status and handle new response format

Fixes #30
- Add warning when old key revocation fails (security improvement)
- Wrap audit log in separate try-catch to avoid masking success
- Add cleanup for orphaned AWS credentials on DB failure
- Log error details in CLI for non-ApiError exceptions
- Update JSDoc for generateAdminS3PolicyDocument with complete docs
- Extract S3_DATASET_ACTIONS constant to reduce duplication
- Add input validation for bucket parameter
- Remove redundant full_bucket_access field from audit log
- Standardize response format and messages

Addresses review feedback from PR #31
@neuromechanist
neuromechanist merged commit cf5052a into main Jan 18, 2026
@neuromechanist
neuromechanist deleted the fix/regenerate-iam-audit-log branch January 18, 2026 10:43
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.

Bug: regenerate-iam fails due to audit_log column name mismatch

1 participant