-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: auditlog #157
base: main
Are you sure you want to change the base?
feat: auditlog #157
Conversation
f72ec11
to
5252e5e
Compare
@deepakdinesh1123 we can remove the enterprise folder as now auditlog is shifted to apps |
@@ -15,6 +15,7 @@ | |||
from zelthy.api.platform.packages.v1 import urls as packages_v1_urls | |||
from zelthy.api.platform.tasks.v1 import urls as tasks_v1_urls | |||
from zelthy.api.platform.codeassist.v1 import urls as codeassist_v1_urls | |||
from zelthy.api.platform.audit.v1 import urls as audit_v1_urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
audit
can be changed to auditlog
@@ -57,5 +58,6 @@ | |||
re_path(r"^(?P<app_uuid>[\w-]+)/packages/$", include(packages_v1_urls)), | |||
re_path(r"^(?P<app_uuid>[\w-]+)/tasks/", include(tasks_v1_urls)), | |||
re_path(r"^(?P<app_uuid>[\w-]+)/code-assist/", include(codeassist_v1_urls)), | |||
re_path(r"^(?P<app_uuid>[\w-]+)/audit/", include(audit_v1_urls)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auditlog
from .serializers import AuditLogSerializerModel | ||
|
||
|
||
class AuditLogViewAPIV1(ZelthyGenericPlatformAPIView, ZelthyAPIPagination): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we can attach set_app_schema_path
decorator. Refer to the task APIs or tenancy views
search = request.GET.get("search", None) | ||
columns = get_search_columns(request) | ||
connection.set_tenant(tenant) | ||
with connection.cursor() as c: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we attach set_app_schema_path
, we don't need to change the connection explicitly
@@ -0,0 +1,3 @@ | |||
# from importlib.metadata import version | |||
|
|||
# __version__ = version("django-auditlog") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is not need needed pls remove the commented code
changes = models.JSONField(null=True, verbose_name=_("change message")) | ||
tenant_actor = models.ForeignKey( | ||
to="appauth.AppUserModel", | ||
on_delete=models.DO_NOTHING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can change the on_delete to models.SET_NULL
) | ||
platform_actor = models.ForeignKey( | ||
to="platformauth.PlatformUserModel", | ||
on_delete=models.DO_NOTHING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the on_delete to models.SET_NULL
kwargs.setdefault("additional_data", get_additional_data()) | ||
db = instance._state.db | ||
try: | ||
obj = ObjectStore.objects.get(object_uuid=instance.object_uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also handle the case where objectstore doesn't contain the object with given instance.object_uuid
, in this case code shouldn't break, object_ref can be None in that case
@@ -0,0 +1,12 @@ | |||
from django.db import models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the exportjob as of now
urlpatterns += [ | ||
path("__debug__/", include("debug_toolbar.urls")), | ||
] | ||
# urlpatterns += [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert this change
@@ -7,12 +7,12 @@ | |||
re_path(r"^", include("zelthy.apps.appauth.urls")), | |||
re_path(r"api/auth/", include("knox.urls")), | |||
re_path(r"api/", include("zelthy.api.app_auth.urls")), | |||
path("__debug__/", include("debug_toolbar.urls")), | |||
# path("__debug__/", include("debug_toolbar.urls")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert this change
urlpatterns += [ | ||
path("__debug__/", include("debug_toolbar.urls")), | ||
] | ||
# urlpatterns += [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert this change
47c7ef0
to
e291820
Compare
@deepakdinesh1123 should we change "api/platform/auditlog" folder to |
add: audit logs unused build removed
@@ -106,6 +106,46 @@ export default function SideMenu() { | |||
Packages | |||
</span> | |||
</NavLink> | |||
{/* <NavLink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls remove unnecessary commented code
@@ -0,0 +1,130 @@ | |||
import { createSlice } from '@reduxjs/toolkit'; | |||
|
|||
export const appAccessLogsSlice = createSlice({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accesslog related code should not be included in this PR.
@@ -0,0 +1,20 @@ | |||
The MIT License (MIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets have a readme file in this folder where we detail out:
- which version of auditlog library we have taken
- what changes have we made
- overall rationale
- How is it being used, how to exclude model, fields, etc.
Also include a section in Docs
* refactor: auditlog fe * build: 1.1.1 * remove: license file
fixes #166