Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/upload-p…
Browse files Browse the repository at this point in the history
…ages-artifact-3
  • Loading branch information
kishore7snehil authored Nov 14, 2024
2 parents c5d493f + 49b8be4 commit 09cc0e5
Show file tree
Hide file tree
Showing 17 changed files with 978 additions and 724 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @auth0/dx-sdks-engineer
* @auth0/project-dx-sdks-engineer-codeowner
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions .github/actions/rl-scanner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Reversing Labs Scanner"
description: "Runs the Reversing Labs scanner on a specified artifact."
inputs:
artifact-path:
description: "Path to the artifact to be scanned."
required: true
version:
description: "Version of the artifact."
required: true

runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Python dependencies
shell: bash
run: |
pip install boto3 requests
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.PRODSEC_TOOLS_ARN }}
aws-region: us-east-1
mask-aws-account-id: true

- name: Install RL Wrapper
shell: bash
run: |
pip install rl-wrapper>=1.0.0 --index-url "https://${{ env.PRODSEC_TOOLS_USER }}:${{ env.PRODSEC_TOOLS_TOKEN }}@a0us.jfrog.io/artifactory/api/pypi/python-local/simple"
- name: Run RL Scanner
shell: bash
env:
RLSECURE_LICENSE: ${{ env.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ env.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ env.SIGNAL_HANDLER_TOKEN }}
PYTHONUNBUFFERED: 1
run: |
if [ ! -f "${{ inputs.artifact-path }}" ]; then
echo "Artifact not found: ${{ inputs.artifact-path }}"
exit 1
fi
rl-wrapper \
--artifact "${{ inputs.artifact-path }}" \
--name "${{ github.event.repository.name }}" \
--version "${{ inputs.version }}" \
--repository "${{ github.repository }}" \
--commit "${{ github.sha }}" \
--build-env "github_actions" \
--suppress_output
# Check the outcome of the scanner
if [ $? -ne 0 ]; then
echo "RL Scanner failed."
echo "scan-status=failed" >> $GITHUB_ENV
exit 1
else
echo "RL Scanner passed."
echo "scan-status=success" >> $GITHUB_ENV
fi
outputs:
scan-status:
description: "The outcome of the scan process."
value: ${{ env.scan-status }}
File renamed without changes.
47 changes: 23 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
name: Publish Release

on:
pull_request:
types:
- closed
workflow_dispatch:

### TODO: Replace instances of './.github/actions/' with reference to the `dx-sdk-actions` repo is made public and this file is transferred over
### TODO: Also remove `get-prerelease`, `get-version`, `release-create`, `tag-create` and `tag-exists` actions from this repo's .github/actions folder once the repo is public.

permissions:
contents: read
contents: write
id-token: write # Required for trusted publishing to PyPI

jobs:
rl-scanner:
uses: ./.github/workflows/rl-scanner.yml
with:
node-version: 18
artifact-name: "auth0-python.tgz"
secrets:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
publish-pypi:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
name: "PyPI"
runs-on: ubuntu-latest
needs: rl-scanner
environment: release

steps:
Expand All @@ -26,7 +36,7 @@ jobs:
with:
fetch-depth: 0
fetch-tags: true

# Get the version from the branch name
- id: get_version
uses: ./.github/actions/get-version
Expand All @@ -42,21 +52,20 @@ jobs:
- id: get_release_notes
uses: ./.github/actions/get-release-notes
with:
token: ${{ secrets.github-token }}
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ steps.get_version.outputs.version }}
repo_owner: ${{ github.repository_owner }}
repo_name: ${{ github.event.repository.name }}

# Check if the tag already exists
- id: tag_exists
uses: ./.github/actions/tag-exists
# Create a release for the tag
- uses: ./.github/actions/release-create
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get_version.outputs.version }}
body: ${{ steps.get_release_notes.outputs.release-notes }}
tag: ${{ steps.get_version.outputs.version }}
token: ${{ secrets.github-token }}

# If the tag already exists, exit with an error
- if: steps.tag_exists.outputs.exists == 'true'
run: exit 1
commit: ${{ github.sha }}
prerelease: ${{ steps.get_prerelease.outputs.prerelease }}

- name: Configure Python
uses: actions/setup-python@v5
Expand All @@ -79,13 +88,3 @@ jobs:
- name: Publish release
uses: pypa/gh-action-pypi-publish@release/v1

# Create a release for the tag
- uses: ./.github/actions/release-create
with:
token: ${{ secrets.github-token }}
name: ${{ steps.get_version.outputs.version }}
body: ${{ steps.get_release_notes.outputs.release-notes }}
tag: ${{ steps.get_version.outputs.version }}
commit: ${{ github.sha }}
prerelease: ${{ steps.get_prerelease.outputs.prerelease }}
85 changes: 85 additions & 0 deletions .github/workflows/rl-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: RL-Secure Workflow
name: RL-Secure Workflow

on:
workflow_call:
inputs:
python-version:
required: true
type: string
artifact-name:
required: true
type: string
secrets:
RLSECURE_LICENSE:
required: true
RLSECURE_SITE_KEY:
required: true
SIGNAL_HANDLER_TOKEN:
required: true
PRODSEC_TOOLS_USER:
required: true
PRODSEC_TOOLS_TOKEN:
required: true
PRODSEC_TOOLS_ARN:
required: true

jobs:
checkout-build-scan-only:
runs-on: ubuntu-latest

permissions:
pull-requests: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Configure dependencies
run: |
pip install --user --upgrade pip
pip install --user pipx
pipx ensurepath
pipx install poetry==1.4.2
pip install --upgrade pip
pip install boto3 requests
poetry config virtualenvs.in-project true
poetry install --with dev
poetry self add "poetry-dynamic-versioning[plugin]==1.1.1"
- name: Build release
run: |
poetry build
- name: Create tgz build artifact
run: |
tar -czvf ${{ inputs.artifact-name }} *
- name: Get Artifact Version
id: get_version
run: echo "version=$(cat .version)" >> $GITHUB_ENV

- name: Run RL Scanner
id: rl-scan-conclusion
uses: ./.github/actions/rl-scanner
with:
artifact-path: "$(pwd)/${{ inputs.artifact-name }}"
version: "${{ steps.get_version.outputs.version }}"
env:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}

- name: Output scan result
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV
11 changes: 1 addition & 10 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Semgrep

on:
merge_group:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -20,16 +20,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
authorize:
name: Authorize
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

run:
needs: authorize # Require approval before running on forked pull requests

name: Check for Vulnerabilities
runs-on: ubuntu-latest

Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Snyk

on:
merge_group:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -22,16 +22,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
authorize:
name: Authorize
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

check:
needs: authorize

name: Check for Vulnerabilities
runs-on: ubuntu-latest

Expand All @@ -43,7 +34,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- uses: snyk/actions/python-3.7@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0
- uses: snyk/actions/python-3.8@4a528b5c534bb771b6e3772656a8e0e9dc902f8b # pinned 2023-06-13
continue-on-error: true # Make sure the SARIF upload is called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Test

on:
merge_group:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -18,16 +18,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
authorize:
name: Authorize
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

run:
needs: authorize # Require approval before running on forked pull requests

name: Run
runs-on: ubuntu-latest

Expand Down Expand Up @@ -89,4 +80,4 @@ jobs:

- if: ${{ matrix.python-version == '3.10' }}
name: Upload coverage
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@3.1.4
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@3.1.5
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.7.0
4.7.2
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log

## [4.7.2](https://github.com/auth0/auth0-python/tree/4.7.2) (2024-09-10)
[Full Changelog](https://github.com/auth0/auth0-python/compare/4.7.1...4.7.2)

**Security**
- Update cryptography requirements.txt [\#630](https://github.com/auth0/auth0-python/pull/630) ([duedares-rvj](https://github.com/duedares-rvj))

## [4.7.1](https://github.com/auth0/auth0-python/tree/4.7.1) (2024-02-26)
[Full Changelog](https://github.com/auth0/auth0-python/compare/4.7.0...4.7.1)

**Security**
- Update cryptography requirements.txt [\#597](https://github.com/auth0/auth0-python/pull/597) ([skjensen](https://github.com/skjensen))

## [4.7.0](https://github.com/auth0/auth0-python/tree/4.7.0) (2023-12-05)
[Full Changelog](https://github.com/auth0/auth0-python/compare/4.6.1...4.7.0)

Expand Down
Loading

0 comments on commit 09cc0e5

Please sign in to comment.