From 79be95349022d38bacf3149f86ad43cc0fbd17cf Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 21 Dec 2023 13:06:06 +0100 Subject: [PATCH 1/3] add source_to_granter and granter_to_dest for IAM Search --- prismacloud/api/cspm/_endpoints.py | 8 ++++++++ prismacloud/api/version.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/prismacloud/api/cspm/_endpoints.py b/prismacloud/api/cspm/_endpoints.py index e54789e..3d82725 100644 --- a/prismacloud/api/cspm/_endpoints.py +++ b/prismacloud/api/cspm/_endpoints.py @@ -538,6 +538,14 @@ def search_iam_read(self, search_params): next_page_token = api_response.pop('nextPageToken', None) return result + def search_iam_source_to_granter(self, search_params): + search_url = 'api/v1/permission/graph/source_to_granter' + return self.execute('POST', search_url, body_params=search_params) + + def search_iam_granter_to_dest(self, search_params): + search_url = 'api/v1/permission/graph/granter_to_dest' + return self.execute('POST', search_url, body_params=search_params) + def search_suggest_list_read(self, query_to_suggest): return self.execute('POST', 'search/suggest', body_params=query_to_suggest) diff --git a/prismacloud/api/version.py b/prismacloud/api/version.py index 2b3b745..841a457 100644 --- a/prismacloud/api/version.py +++ b/prismacloud/api/version.py @@ -1,3 +1,3 @@ """ version file """ -version = '5.2.8' +version = '5.2.9' From 28ebb58ef698c3f74db2c194cc77a79721d0e096 Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 21 Dec 2023 13:20:04 +0100 Subject: [PATCH 2/3] add automatic release --- .github/workflows/pypi.yml | 26 +++++++++++++++++++++++++- prismacloud/api/version.py | 4 +--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index ffabd5a..e71370f 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -11,15 +11,39 @@ name: Upload Python Package on: release: types: [published] + pull_request: + types: + - closed jobs: + create-github-release: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Extract version from prismacloud/cli/version.py + run: | + version=$(grep 'version = ' prismacloud/api/version.py | sed -E "s/version = \"([^\"]+)\"/\1/") + echo "PRISMA_CLOUD_API_VERSION=$version" >> $GITHUB_ENV + + - name: Create GitHub Release + run: | + gh release create ${{ env.PRISMA_CLOUD_API_VERSION }} --generate-notes --latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + deploy: runs-on: ubuntu-latest + needs: + - create-github-release steps: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.9' - name: Install Dependencies diff --git a/prismacloud/api/version.py b/prismacloud/api/version.py index 841a457..a662198 100644 --- a/prismacloud/api/version.py +++ b/prismacloud/api/version.py @@ -1,3 +1 @@ -""" version file """ - -version = '5.2.9' +version = "5.2.9" From 84d6bd58910ff49615f54d4f18087166b5459997 Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 21 Dec 2023 13:21:27 +0100 Subject: [PATCH 3/3] add automatic release in github actions --- .github/workflows/pypi.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e71370f..1fa6c19 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -2,12 +2,6 @@ name: Upload Python Package -#on: -# push: -# branches: [ main ] -# tags: -# - '*' - on: release: types: [published]