Skip to content

Update Authlete IdP OpenAPI Specification #336

Update Authlete IdP OpenAPI Specification

Update Authlete IdP OpenAPI Specification #336

name: Update Authlete IdP OpenAPI Specification
on:
schedule:
# Run daily at 2:30 AM UTC to check for updates
- cron: "30 2 * * *"
workflow_dispatch:
# Allow manual trigger
permissions:
contents: write
pull-requests: write
jobs:
update-idp-openapi-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- name: Install dependencies
run: uv sync
- name: Update IdP OpenAPI specification
id: update-spec
run: |
echo "Updating IdP OpenAPI specification..."
uv run python scripts/update_idp_openapi_spec.py
- name: Determine IdP spec branch name
id: branch-info
run: |
SPEC_HASH="${{ steps.update-spec.outputs.spec-sha256 }}"
if [ -z "$SPEC_HASH" ] || [ "$SPEC_HASH" = "unknown" ]; then
if [ -f "resources/idp-openapi-spec.json" ]; then
SPEC_HASH=$(sha256sum resources/idp-openapi-spec.json | cut -d' ' -f1)
else
SPEC_HASH="${{ github.run_id }}"
fi
fi
BRANCH="update-idp-openapi-spec-${SPEC_HASH:0:12}"
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
echo "TARGET_BRANCH=$BRANCH" >> $GITHUB_ENV
echo "Using branch $BRANCH for this update"
- name: Check for existing IdP spec PR
id: existing-pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ steps.update-spec.outputs.has-changes }}" != "true" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
BRANCH="${{ steps.branch-info.outputs.branch }}"
if [ -z "$BRANCH" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
if ! command -v gh >/dev/null 2>&1; then
echo "GitHub CLI not available - assuming no existing PR"
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
PR_COUNT=$(gh pr list --state open --head "$BRANCH" --repo "$GITHUB_REPOSITORY" --json number --jq 'length')
if [ "$PR_COUNT" -gt 0 ]; then
echo "An open PR already exists for $BRANCH (count: $PR_COUNT)"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.update-spec.outputs.has-changes == 'true' && steps.existing-pr.outputs.exists != 'true'
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
chore: update Authlete IdP OpenAPI specification
- Updated from Authlete IdP API (https://login.authlete.com/v3/api-docs)
- Version: ${{ steps.update-spec.outputs.current-version }} → ${{ steps.update-spec.outputs.new-version }}
- Paths: ${{ steps.update-spec.outputs.current-paths }} → ${{ steps.update-spec.outputs.new-paths }}
- Generated YAML and JSON specifications for reference
- Content hash: ${{ steps.update-spec.outputs.spec-sha256 }}
Auto-generated by update-idp-openapi-spec workflow
branch: ${{ steps.branch-info.outputs.branch }}
delete-branch: true
title: "chore: update Authlete IdP OpenAPI specification to v${{ steps.update-spec.outputs.new-version }}"
body: |
## Authlete IdP OpenAPI Specification Update
This PR updates the Authlete IdP OpenAPI specification from the latest IdP API documentation.
**Changes:**
- **Version:** `${{ steps.update-spec.outputs.current-version }}` → \
`${{ steps.update-spec.outputs.new-version }}`
- **API Endpoints:** `${{ steps.update-spec.outputs.current-paths }}` → \
`${{ steps.update-spec.outputs.new-paths }}`
- **Content Hash:** `${{ steps.update-spec.outputs.spec-sha256 }}`
- **Source:** https://login.authlete.com/v3/api-docs
**Files Updated:**
- `resources/idp-openapi-spec.yaml` - IdP OpenAPI specification (YAML format)
- `resources/idp-openapi-spec.json` - IdP OpenAPI specification (JSON format)
**Context:**
The Authlete IdP API currently supports limited operations with `ORGANIZATION_ACCESS_TOKEN`:
- Service creation (`create_service`, `create_service_detailed`)
- Service deletion (`delete_service`)
This specification serves as a reference for future IdP API integrations and \
potential expansion of MCP server capabilities.
**Verification:**
- [ ] IdP OpenAPI spec is valid YAML/JSON
- [ ] Spec contains expected Authlete IdP API endpoints
- [ ] No breaking changes in existing endpoint definitions
- [ ] Both YAML and JSON formats are correctly generated
---
🤖 This PR was automatically created by the `update-idp-openapi-spec` GitHub Action.
**Review Guidelines:**
1. Verify the changes are legitimate updates from Authlete IdP
2. Check that service creation/deletion endpoints are preserved
3. Ensure the new version is correctly parsed
4. Consider how this spec could be used for future IdP API tool enhancements
labels: |
dependencies
automation
documentation
idp-api
reviewers: |
watahani
- name: Summary
run: |
if [ "${{ steps.update-spec.outputs.has-changes }}" = "true" ]; then
if [ "${{ steps.existing-pr.outputs.exists }}" = "true" ]; then
echo "ℹ️ IdP spec update matches an existing open PR."
echo "🔁 Reusing branch ${{ steps.branch-info.outputs.branch }}"
else
echo "✅ Authlete IdP OpenAPI spec updated successfully"
echo "📊 Version: ${{ steps.update-spec.outputs.current-version }} → \
${{ steps.update-spec.outputs.new-version }}"
echo "🔧 Paths: ${{ steps.update-spec.outputs.current-paths }} → \
${{ steps.update-spec.outputs.new-paths }}"
echo "📋 PR created with refreshed YAML/JSON spec"
echo "🔧 Available for reference in future IdP API integrations"
fi
else
echo "ℹ️ Authlete IdP OpenAPI spec is already up to date"
fi