Skip to content

feat(agent-forge): add 401 authentication error handling with tests - #13

Merged
suwhang-cisco merged 5 commits into
agent-forge-upstream-dockerfrom
feat/agent-forge-401-auth-handling
Nov 10, 2025
Merged

feat(agent-forge): add 401 authentication error handling with tests#13
suwhang-cisco merged 5 commits into
agent-forge-upstream-dockerfrom
feat/agent-forge-401-auth-handling

Conversation

@sriaradhyula

Copy link
Copy Markdown
Member

Implemented comprehensive 401 error handling for OpenID token authentication:

  • Modified authentication to only handle 401 errors (removed 403 handling)
  • Added OpenID token expiration detection with JWT decoding
  • Implemented configurable auto-reload on token expiry (autoReloadOnTokenExpiry)
  • Added 5-second countdown toast before page reload
  • Added session expired toast with manual reload button for API 401 errors
  • Created 35 unit tests with 100% pass rate covering:
    • Token expiration validation
    • 401 error detection (excluding 403)
    • Toast notifications and user interactions
    • Configurable auto-reload behavior
    • API error handling flows

Configuration:

  • Added autoReloadOnTokenExpiry option to config.d.ts and app-config.yaml
  • Default behavior: auto-reload page on token expiry with countdown
  • Can be disabled to show error message instead

Documentation:

  • Enhanced README.md with comprehensive testing instructions
  • Added development workflow and PR creation guide
  • Added manual linting commands and Backstage-specific rules
  • Included code quality commands and conventional commit examples
  • Added working directory information for all commands

Code Quality:

  • Fixed linting issues (toLowerCase -> toLocaleLowerCase)
  • Fixed variable shadowing in error handlers
  • Added eslint-disable for pre-existing conditional hook call
  • All tests passing with 100% success rate

Hey, I just made a Pull Request!

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Implemented comprehensive 401 error handling for OpenID token authentication:

- Modified authentication to only handle 401 errors (removed 403 handling)
- Added OpenID token expiration detection with JWT decoding
- Implemented configurable auto-reload on token expiry (autoReloadOnTokenExpiry)
- Added 5-second countdown toast before page reload
- Added session expired toast with manual reload button for API 401 errors
- Created 35 unit tests with 100% pass rate covering:
  * Token expiration validation
  * 401 error detection (excluding 403)
  * Toast notifications and user interactions
  * Configurable auto-reload behavior
  * API error handling flows

Configuration:
- Added autoReloadOnTokenExpiry option to config.d.ts and app-config.yaml
- Default behavior: auto-reload page on token expiry with countdown
- Can be disabled to show error message instead

Documentation:
- Enhanced README.md with comprehensive testing instructions
- Added development workflow and PR creation guide
- Added manual linting commands and Backstage-specific rules
- Included code quality commands and conventional commit examples
- Added working directory information for all commands

Code Quality:
- Fixed linting issues (toLowerCase -> toLocaleLowerCase)
- Fixed variable shadowing in error handlers
- Added eslint-disable for pre-existing conditional hook call
- All tests passing with 100% success rate

Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
sriaradhyula and others added 4 commits November 8, 2025 06:29
Enhanced README documentation with:

- Added CAIPE (Community AI Platform Engineering) overview and integration details
- Updated A2A Protocol links to official documentation (a2a-protocol.org)
- Clarified that Agent Forge works with any A2A-compatible agent
- Added CAIPE community resources:
  * Community page with weekly meeting information
  * Slack channel (#cnoe-sig-agentic-ai)
  * GitHub issues for CAIPE-specific questions
- Added configuration examples for CAIPE and custom A2A agents
- Reorganized support section for clarity
- Updated description to highlight A2A protocol compatibility

Documentation now provides clear guidance for users integrating Agent Forge
with CAIPE or any other A2A-compatible agent system.

Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Merged agent-forge-upstream-docker branch into feat/agent-forge-401-auth-handling.
Combined both features:
- autoReloadOnTokenExpiry for automatic page reload on token expiry
- enableFeedback with feedbackEndpoint for user feedback collection

Resolved conflicts in:
- config.d.ts: Added both autoReloadOnTokenExpiry and feedback config options
- ChatbotApi.ts: Integrated both features in API options and implementation
- AgentForgePage.tsx: Combined config reading and API initialization
- yarn.lock: Accepted upstream changes

Both features now work together seamlessly.

Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
- Renamed metadata fields to use Jarvis-compatible naming
- Changed MetadataField to PlatformEngineerInputField
- Updated field names: field_name, field_description, field_values
- Ensures consistency with A2A DataPart schema
- Updated dependencies in yarn.lock

Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: suwhang-cisco <suwhang@cisco.com>

@suwhang-cisco suwhang-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and all looks good. Published npm @caipe/plugin-agent-forge@0.3.41

@suwhang-cisco
suwhang-cisco merged commit 272ca6f into agent-forge-upstream-docker Nov 10, 2025
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants