Skip to content

Resolve issue with enforcement deletion #301

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.

.github/ @axonius/devex-team
22 changes: 22 additions & 0 deletions .github/workflows/jira-description-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: jira-description-action
on:
pull_request:
types: [opened, reopened, edited, synchronize]
# Set the minimum required permissions for the GITHUB_TOKEN
# This action only needs read access to pull requests for
# reading PR titles and checking PR context. These permissions
# are set to adhere to the principle of least privilege, ensuring
# the token cannot perform unintended actions.
permissions:
pull-requests: read
jobs:
add-jira-description:
runs-on: ubuntu-latest
steps:
- uses: Axonius/jira-description-action@v0.4.0
name: jira-description-action
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
jira-token: ${{ secrets.JIRA_TOKEN }}
jira-base-url: https://axonius.atlassian.net
fail-when-jira-issue-not-found: true
4 changes: 2 additions & 2 deletions axonius_api_client/api/api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,8 @@ class Enforcements(ApiEndpointGroup):
delete_set: ApiEndpoint = ApiEndpoint(
method="delete",
path="api/enforcements",
request_schema_cls=json_api.generic.DictValueSchema,
request_model_cls=json_api.generic.DictValue,
request_schema_cls=json_api.enforcements.DeleteEnforcementSchema,
request_model_cls=json_api.enforcements.DeleteEnforcementModel,
response_schema_cls=json_api.generic.DeletedSchema,
response_model_cls=json_api.generic.Deleted,
)
Expand Down
27 changes: 27 additions & 0 deletions axonius_api_client/api/json_api/enforcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,33 @@ def get_schema_cls() -> t.Any:
return CreateEnforcementSchema


class DeleteEnforcementSchema(BaseSchemaJson):
"""Pass."""
value = marshmallow_jsonapi.fields.Dict()


class Meta:
"""Pass."""

type_ = "enforcements_delete_schema"

@staticmethod
def get_model_cls() -> t.Any:
"""Pass."""
return DeleteEnforcementModel


@dataclasses.dataclass
class DeleteEnforcementModel(BaseModel):
"""Pass."""
value: dict

@staticmethod
def get_schema_cls() -> t.Any:
"""Pass."""
return DeleteEnforcementSchema


@dataclasses.dataclass
class ActionType(BaseModel):
"""Pass."""
Expand Down
Loading