Skip to content

Docs/render open api link#207

Open
Unclebaffa wants to merge 10 commits into
Agentpay-Org:mainfrom
Unclebaffa:docs/render-OpenApi-link
Open

Docs/render open api link#207
Unclebaffa wants to merge 10 commits into
Agentpay-Org:mainfrom
Unclebaffa:docs/render-OpenApi-link

Conversation

@Unclebaffa

Copy link
Copy Markdown
Contributor

Summary of Completed Work

  1. Page Update:

    • Modified src/app/docs/page.tsx to validate the OpenAPI and GitHub external links through safeHref.
    • Applied secure target="_blank" and rel="noopener noreferrer" attributes on the external GitHub link.
    • Handled fallbacks by rendering the links as plain text if validation fails.
  2. Tests:

    • Updated assertions in src/app/docs/page.test.tsx to verify correct target and rel attribute handling on both links.
    • Added comprehensive tests for validation failure cases using jest.spyOn() to mock safeHref without causing recursion issues.
    • Verified that the page maintains 100% test coverage.
  3. Documentation:

    • Updated the Link safety convention section in README.md to note that /docs links are validated through safeHref.
  4. Commits:

    • Committed all changes in 4 separate, clean commits:
      • feat(docs): route relative and external links through safeHref and secure external link
      • test(docs): assert target and rel attributes for docs links
      • test(docs): add test coverage for docs link safety validation fallback
      • docs(README): document link safety validation on the docs page
  5. Validation & Verification:

    • Ran npm run lint, npm run typecheck, npm test (coverage), and npm run build successfully with zero errors.

For more details, please see the implementation_plan.md and walkthrough.md artifacts.

Closes #143

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.

Render the docs OpenAPI link through the safeHref-validated link path

1 participant