Skip to content

Conversation

alexpmule
Copy link
Contributor

@alexpmule alexpmule commented Sep 10, 2025

🔒 Add PII Detection and Display Support to API Body Document Component

📋 Overview

This PR adds Personally Identifiable Information (PII) detection and visual indication capabilities to the api-body-document component, along with CI/CD improvements.

✨ Features Added

🎯 PII Detection & Display

  • Automatic PII Detection: Automatically detects PII data from AMF model schemas using the _computeAgentPrivacy method from AmfHelperMixin
  • Visual PII Indicators: Displays color-coded status badges showing whether PII data is detected
  • Manual PII Override: Allows manual setting of PII status for different component instances
  • Reactive Properties: PII status updates automatically trigger component re-renders

🔧 Technical Implementation

New Properties Added:

agentParameters: { type: Object },    // Contains privacy data from AMF model
isPii: { type: Boolean },             // Reactive PII status flag
_agentOpened: { type: Boolean }       // Controls agent section visibility

New Methods:

  • _computePiiFromSchema(schema) - Computes PII status from schema
  • _computeAgentPrivacyBySchema(schema) - Processes AMF privacy data
  • setPiiStatus(isPii, agentParams) - Manual PII status override
  • _toggleAgent() - Toggle agent parameters section
  • _getAgentTemplate() - Renders agent parameters UI

Integration with AmfHelperMixin:

Uses the existing _computeAgentPrivacy(node) method from AmfHelperMixin to extract privacy annotations from AMF models.

🛠️ CI/CD Improvements

Fixed GitHub Actions Issues:

  • Resolved web-test-runner command not found errors
  • Updated to use correct commands: npx wtr instead of deprecated web-test-runner
  • Simplified test configuration using existing web-test-runner.config.mjs
  • Added Windows testing support
  • Improved dependency caching

Updated Scripts:

{
  "start": "npx wds --app-index demo/index.html --node-resolve --open --watch --root-dir .",
  "test": "npx wtr --coverage --playwright --browsers chromium firefox webkit",
  "test:watch": "npx wtr --watch --playwright --browsers chromium"
}

📝 Summary of Files Changed:

  • src/ApiBodyDocumentElement.js - Main component logic and PII detection
  • src/Styles.js - PII indicator styling
  • package.json - Fixed test scripts
  • .github/workflows/deployment.yml - CI/CD improvements

@alexpmule alexpmule self-assigned this Sep 10, 2025
…move Windows testing, and enhance Playwright setup.
…downgrading @web/dev-server and @web/test-runner versions, upgrading eslint to version 8.0.0, and updating lint-staged to version 11.2.2. Add new dependencies and remove deprecated ones.
… to disable custom HTML output for test runners.
… Windows support, updating Node.js and checkout actions, and enhancing caching for npm dependencies.
…ensuring consistent execution across environments.
@alexpmule alexpmule merged commit 85aad24 into master Sep 10, 2025
4 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