Skip to content

In /embed, check document sensitivity label before processing file #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jare5d
Copy link

@jare5d jare5d commented Apr 12, 2025

Added document sensitivity checker as described in issue #136. This update introduces a document sensitivity checker that processes files based on their sensitivity labels and types. The checker supports the following file formats: .docx, .pptx, .xlsx, and .pdf.

  • DOC_FLTR_ENABLED: Enables or disables sensitivity label filtering.

    • Type: boolean
    • Accepted values: true, 1, yes (case-insensitive)
    • Default: false if not set
  • DOC_FLTR_ALLOWED_LABELS: A JSON array of allowed sensitivity labels. If a document's label is not included in this list, it will be rejected when filtering is enabled.

    • Type: JSON list of strings
    • Format: Must be a valid JSON array (e.g., ["public", "confidential"])
    • Note: Labels are normalized (trimmed and lowercased). Special characters and spaces are allowed.
    • Default: If unset or an empty array, all labels are allowed
    • Example: DOC_FLTR_ALLOWED_LABELS=["public", "personal", "confidential", "company name - confidential"]
  • DOC_FLTR_FILE_TYPES: A JSON array of allowed file extensions (e.g., "pdf", "docx"). Only these types will be checked for labels.

    • Type: JSON list of strings
    • Note: File extensions should be lowercase and without dots.
    • Default: If unset, defaults to ["pdf", "docx", "xlsx", "pptx"]
    • Example: DOC_FLTR_FILE_TYPES=["pdf", "docx"]

This ensures that files are checked according to the specified document types and sensitivity labels, providing flexibility for different configurations.

@jare5d jare5d marked this pull request as draft April 13, 2025 14:36
@jare5d jare5d marked this pull request as ready for review April 14, 2025 17:34
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.

1 participant