Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
runs-on: ${{ inputs.image }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: develop
fetch-depth: 0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Bootstrap poetry (Linux and macOS)
Expand All @@ -55,7 +55,7 @@ jobs:
sudo find _build -name .doctrees -prune -exec rm -rf {} \;
sudo find _build -name .buildinfo -exec rm {} \;
- name: Upload HTML
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: html-build-artifact
path: _build/docs
Expand All @@ -70,7 +70,7 @@ jobs:
echo ${{ github.event.action }} > ./pr/action.txt
- name: Upload PR information
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: pr
path: pr/
Expand All @@ -80,15 +80,15 @@ jobs:
needs: [build-docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
ref: "gh-pages"
- name: Initialize Git configuration
run: |
git config user.name docs-build
git config user.email do-not-send@github.com
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: html-build-artifact
path: ${{ github.ref_name }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fi

- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ steps.version.outputs.tag }}
fetch-depth: 0
Expand All @@ -59,7 +59,7 @@ jobs:
echo "✅ Version validated: $VERSION_IN_FILE matches tag $TAG_VERSION"

- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: ${{ steps.version.outputs.artifact_name }}
path: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: nemoguardrails-${{ github.event.inputs.version }}.whl

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-and-build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
outputs:
artifact_name: ${{ steps.set-artifact-name.outputs.artifact_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
fi

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: ${{ steps.set-artifact-name.outputs.artifact_name }}
path: dist/*
Expand All @@ -88,12 +88,12 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Download Build Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: ${{ needs.build-wheel.outputs.artifact_name }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
#
# Checkout the code
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

# Get runner architecture
- name: Get runner architecture
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-published-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
13 changes: 4 additions & 9 deletions nemoguardrails/server/schemas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,11 @@ async def fetch_models(
headers: Dict[str, str] = {}
forwarded = request_headers.get("Authorization", "")

# Check if the auth header is a Bearer token
if forwarded and auth_header_name == "Authorization":
headers["Authorization"] = forwarded
else:
# Extract the key from the forwarded header or from the env var.
raw_key = os.environ.get(api_key_env, "")
if not raw_key:
raw_key = forwarded.removeprefix("Bearer ").strip() if forwarded else ""
if not raw_key:
raw_key = os.environ.get(api_key_env, "")
if raw_key:
headers[auth_header_name] = f"Bearer {raw_key}" if use_bearer else raw_key
if raw_key:
headers[auth_header_name] = f"Bearer {raw_key}" if use_bearer else raw_key

headers.update(provider.get("extra_headers", {}))

Expand Down
Loading