Skip to content

Commit

Permalink
feat: Added ZIA SSL Inspection Rules Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Jan 21, 2025
1 parent 9eaf44e commit 16ddb96
Show file tree
Hide file tree
Showing 6 changed files with 706 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/zia-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: ZIA Test
on:
pull_request:
types: [opened, synchronize]
merge_group:
types: [checks_requested]
push:
branches:
- master

# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
# we recommend testing at a regular interval not necessarily tied to code changes. This will
# ensure you are alerted to something breaking due to an API change, even if the code did not
# change.

schedule:
- cron: '0 11 * * 1-5' # UTC
workflow_dispatch:

jobs:
zia-zsbeta-tests:
environment: ZIA_ZSBETA
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goVersion: ["1.22"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVersion }}

- name: Clean existing Go modules
run: go clean -modcache

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set Go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install dependencies
run: go mod download

- name: Run tests with retry on Ubuntu
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20 # Adjust as needed
command: |
make sweep:zia
make test:integration:zia
make ziaActivator
env:
ZSCALER_CLIENT_ID: ${{ secrets.ZSCALER_CLIENT_ID }}
ZSCALER_CLIENT_SECRET: ${{ secrets.ZSCALER_CLIENT_SECRET }}
ZSCALER_VANITY_DOMAIN: ${{ secrets.ZSCALER_VANITY_DOMAIN }}
ZSCALER_CLOUD: ${{ secrets.ZSCALER_CLOUD }}
ZSCALER_SANDBOX_TOKEN: ${{ secrets.ZSCALER_SANDBOX_TOKEN }}
ZSCALER_SANDBOX_CLOUD: ${{ secrets.ZSCALER_SANDBOX_CLOUD }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true
81 changes: 81 additions & 0 deletions .github/workflows/zpa-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: ZPA Test
on:
pull_request:
types: [opened, synchronize]
merge_group:
types: [checks_requested]
push:
branches:
- master
schedule:
- cron: '0 11 * * 1-5' # UTC
workflow_dispatch:

jobs:
zpa-beta-tenants:
# needs: [zpa-beta-tenants]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goVersion: ["1.22"]
environment:
- ZPA_PROD_TENANT01
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVersion }}

- name: Clean existing Go modules
run: go clean -modcache

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set Go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install dependencies
run: go mod download

- name: Run tests with retry
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20
command: |
make test:unit:zpa
make sweep:zpa
make test:integration:zpa
make sweep:zpa
env:
ZSCALER_CLIENT_ID: ${{ secrets.ZSCALER_CLIENT_ID }}
ZSCALER_CLIENT_SECRET: ${{ secrets.ZSCALER_CLIENT_SECRET }}
ZSCALER_VANITY_DOMAIN: ${{ secrets.ZSCALER_VANITY_DOMAIN }}
ZSCALER_CLOUD: ${{ secrets.ZSCALER_CLOUD }}
OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

# 3.1.0 (January 20, 2025)

## Notes
- Golang: **v1.22**

### ZIA SSL Inspection Rules
[PR #293](https://github.com/zscaler/zscaler-sdk-go/pull/293) - Added the following new ZIA API Endpoints:
- Added `GET /sslInspectionRules` Retrieves all SSL inspection rules.
- Added `GET /sslInspectionRules/{ruleId}` Retrieves the SSL inspection rule based on the specified ID
- Added `POST /sslInspectionRules` Creates a new SSL inspection rule
- Added `PUT /sslInspectionRules/{ruleId}` Updates the SSL inspection rule based on the specified ID
- Added `DELETE /sslInspectionRules/{ruleId}` Deletes an existing SSL inspection rule based on the specified ID

# 3.0.0 (January 20, 2025) - BREAKING CHANGES

## Notes
Expand Down
14 changes: 13 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ Track all Zscaler SDK GO releases. New resources, features, and bug fixes will b

---

``Last updated: v3.0.0``
``Last updated: v3.1.0``

---

# Changelog


## Notes
- Golang: **v1.22**

### ZIA SSL Inspection Rules
[PR #293](https://github.com/zscaler/zscaler-sdk-go/pull/293) - Added the following new ZIA API Endpoints:
- Added `GET /sslInspectionRules` Retrieves all SSL inspection rules.
- Added `GET /sslInspectionRules/{ruleId}` Retrieves the SSL inspection rule based on the specified ID
- Added `POST /sslInspectionRules` Creates a new SSL inspection rule
- Added `PUT /sslInspectionRules/{ruleId}` Updates the SSL inspection rule based on the specified ID
- Added `DELETE /sslInspectionRules/{ruleId}` Deletes an existing SSL inspection rule based on the specified ID

# 3.0.0 (January 20, 2025) - BREAKING CHANGES

## Notes
Expand Down
Loading

0 comments on commit 16ddb96

Please sign in to comment.