Skip to content

Commit

Permalink
fix(backend): 审计中心 resource 错误的问题 #2342
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Dec 5, 2023
1 parent 018b265 commit 2d375a1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/auto_create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.yaml-data.outputs.data }}',
ref: 'refs/tags/temp-${{ steps.yaml-data.outputs.data }}',
sha: context.sha
})
Expand All @@ -45,19 +45,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: delete-temporary-tag
name: Delete temporary tag
uses: actions/github-script@v6
with:
# 参考 https://octokit.github.io/rest.js/v18#git-delete-ref
# 参考 https://github.com/actions/github-script
script: |
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/v${{ steps.yaml-data.outputs.data }}'
})
- id: create-tag
name: Create tag
uses: actions/github-script@v6
Expand All @@ -81,4 +68,17 @@ jobs:
release_name: ${{ steps.yaml-data.outputs.data }}
body: ${{ steps.build-release-log.outputs.changelog }}
draft: false
prerelease: true
prerelease: true

- id: delete-temporary-tag
name: Delete temporary tag
uses: actions/github-script@v6
with:
# 参考 https://octokit.github.io/rest.js/v18#git-delete-ref
# 参考 https://github.com/actions/github-script
script: |
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/temp-${{ steps.yaml-data.outputs.data }}'
})
6 changes: 5 additions & 1 deletion dbm-ui/backend/iam_app/handlers/drf_perm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class IAMPermission(permissions.BasePermission):
作为drf-iam鉴权的基类
"""

resource_type = None

def __init__(self, actions: List[ActionMeta], resources: List[Resource] = None) -> None:
self.actions = actions
self.resources = resources or []
Expand All @@ -74,7 +76,7 @@ def has_permission(self, request, view):
for resource in self.resources:
bk_audit_client.add_event(
action=action,
resource_type=resource,
resource_type=self.resource_type() if self.resource_type else resource,
audit_context=context,
instance=CommonInstance(resource.attribute),
)
Expand Down Expand Up @@ -105,6 +107,8 @@ class BusinessIAMPermission(IAMPermission):
业务相关动作的鉴权
"""

resource_type = BusinessResourceMeta

def __init__(self, actions: List[ActionMeta], resources: List[Resource] = None, bk_biz_id: int = None) -> None:
self.bk_biz_id = bk_biz_id
super().__init__(actions, resources)
Expand Down
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.3.0-alpha.13
appVersion: 1.3.0-alpha.13
version: 1.3.0-alpha.14
appVersion: 1.3.0-alpha.14
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/backup-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.31
appVersion: 0.0.1-alpha.35
description: A Helm chart for backup-server
name: backup-server
type: application
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-resource/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.56
appVersion: 0.0.1-alpha.64
description: A Helm chart for Kubernetes
name: db-resource
type: application
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbconfig/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.62
appVersion: 0.0.1-alpha.63
description: A Helm chart for dbconfig
name: dbconfig
type: application
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.3.0-alpha.39
appVersion: 1.3.0-alpha.61
description: A Helm chart for dbm
name: dbm
type: application
Expand Down

0 comments on commit 2d375a1

Please sign in to comment.