Skip to main content

Pangea Multipass authorization library for LangChain

Project description

Pangea Multipass for LangChain

The pangea-multipass-langchain package extends Pangea Multipass to integrate with LangChain's document processing, providing enhanced security, metadata filtering, and access control for LangChain documents. This package supports integrations with Google Drive, JIRA, and Confluence, leveraging metadata-based filtering and authorization to control document access.

Features

  • Document Reader: Custom LangChainDocumentReader class reads content from LangChain documents, adapting to Pangea's document model.
  • Integration Processors:
    • LangChainJiraFilter: Allows JIRA integration, authenticating and processing JIRA documents in LangChain.
    • LangChainConfluenceFilter: Provides Confluence integration for document access control in LangChain.
    • LangChainGDriveFilter: Uses Google OAuth credentials to access and filter Google Drive documents in LangChain.
  • Document Filter Mixer: The DocumentFilterMixer aggregates multiple processors, applying customized filters for advanced access control across various sources.

Installation

Use Poetry to install dependencies:

poetry add pangea-multipass-langchain

Usage

Core Components

  • LangChainDocumentReader: The LangChainDocumentReader class enables reading content from LangChain documents for authorization and metadata filtering. This class acts as a bridge between LangChain documents and Pangea's authorization model.
  • Processors for LangChain Integration: The package includes processors that integrate with specific data sources using authentication credentials. Each processor retrieves metadata from documents, allowing fine-grained control over document access:
    • LangChainJiraFilter: Authenticates with JIRA and processes JIRA documents.
    • LangChainConfluenceFilter: Processes Confluence documents, applying access control.
    • LangChainGDriveFilter: Integrates Google Drive documents into LangChain using OAuth2 credentials.
  • DocumentFilterMixer: The DocumentFilterMixer aggregates multiple document processors, applying filters to handle complex document access control. It retrieves authorized and unauthorized documents based on the combined filters from each processor.
    • Filter Documents: filter() applies filters to a list of LangChain documents.
    • Retrieve Unauthorized Documents: get_unauthorized_documents() retrieves documents that fail authorization checks.
    • Retrieve Authorized Documents: get_authorized_documents() provides access to documents meeting authorization criteria.
  • Metadata Filtering: The package includes metadata-based filtering, allowing users to apply filters with operators like EQ, GT, LT, CONTAINS, and more. Each filter can be customized to match document metadata for precise access control.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pangea_multipass_langchain-0.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pangea_multipass_langchain-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pangea_multipass_langchain-0.2.0.tar.gz.

File metadata

  • Download URL: pangea_multipass_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.10.16 Linux/6.1.112+

File hashes

Hashes for pangea_multipass_langchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c01c571b342aee91bec893a4f908611483c03ce05fd65ef8f93f62e02b93a6bf
MD5 7237e0d75c5a91b0038876b193cf87ea
BLAKE2b-256 bd83d4cdcc327145f48d6e507ee1574d2aa0d68b8cf924938f7570a9355228da

See more details on using hashes here.

File details

Details for the file pangea_multipass_langchain-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pangea_multipass_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfacda8b9f8a0e7c63bb1c27c1b74293189cc2319c998b38823ea7e097068c71
MD5 0aeeeff322cb6c1010760a2c19408e41
BLAKE2b-256 94b7f75574bdca6b7f44926d5cb12048a74bb4f930c727c7223ac46aaeba7599

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page