Skip to content

inrupt/libreoffice-solid

Repository files navigation

LibreOffice Solid UCP

C++ implementation of a Universal Content Provider (UCP) for LibreOffice that enables native Solid pod integration with vnd-solid:// URL scheme and DPoP authentication.

What This Is

This repo contains the source code for a LibreOffice UCP that provides native Solid protocol support. When integrated into LibreOffice, users can access Solid pods through the standard "File → Open Remote Files" interface using custom vnd-solid:// URLs that internally map to HTTPS.

Current Status

✅ URL Scheme: Custom vnd-solid:// routing implemented and working
✅ Integration: Successfully integrated into LibreOffice build system
✅ Authentication: Complete OAuth 2.0 + PKCE + DPoP implementation
✅ Build System: All namespace issues resolved, compiles cleanly
🔄 Testing: Ready for runtime testing with Solid pods

Installation

Prerequisites

  • LibreOffice 25.2+ source code
  • Standard LibreOffice build dependencies (autotools, C++ compiler, etc.)
  • libcurl development headers
  • OpenSSL development headers

Integration Steps

  1. Clone LibreOffice source (if not already done):

    git clone https://git.libreoffice.org/core libreoffice-core
    cd libreoffice-core
  2. Clone this repository:

    git clone https://github.com/inrupt/libreoffice-solid.git
  3. Copy Solid UCP files to LibreOffice source:

    # Copy UCP implementation
    cp -r libreoffice-solid/ucb/source/ucp/solid/ ucb/source/ucp/
    
    # Copy build configuration
    cp libreoffice-solid/ucb/Library_ucpsolid.mk ucb/
    
    # Copy UCB provider registration
    cp libreoffice-solid/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu \
       officecfg/registry/data/org/openoffice/ucb/
    
    # Copy Remote Files dialog integration
    cp libreoffice-solid/fpicker/source/office/RemoteFilesDialog.cxx \
       fpicker/source/office/
    
    # Copy server details controls
    cp libreoffice-solid/svtools/source/dialogs/ServerDetailsControls.* \
       svtools/source/dialogs/
  4. Update LibreOffice build system:

    # Add ucpsolid to UCB module build
    echo "ucpsolid \\" >> ucb/Module_ucb.mk
    
    # Add to repository makefile
    echo "ucb/Library_ucpsolid.mk \\" >> Repository.mk
  5. Configure and build LibreOffice:

    ./autogen.sh --enable-debug
    make clean
    make -j$(nproc)

How It Works

  1. Custom URL Scheme: Uses vnd-solid:// URLs that get converted to https:// internally
  2. UCB Registration: Registers as Provider98 in UCB Configuration.xcu
  3. Authentication: Full OAuth 2.0 + PKCE + DPoP authentication flow
  4. File Operations: Standard LibreOffice content operations through Solid HTTP API
  5. UI Integration: Appears as "Solid Pod" in Remote Files dialog

Key Components

  • SolidOAuth.cxx/hxx: OAuth 2.0 + PKCE + DPoP authentication with ECDSA P-256 JWT signing
  • solidprovider.cxx/hxx: Main UCP implementation with vnd-solid:// URL scheme handling
  • solidcontent.cxx/hxx: Content interface for file operations
  • SolidHttpSession.cxx/hxx: HTTP session management with DPoP authentication headers
  • SolidConfigDialog.cxx/hxx: Configuration dialog for Solid pod settings
  • SolidCallbackServer.cxx/hxx: Local OAuth callback server for browser authentication

Usage

Once installed and LibreOffice is built:

  1. Open Remote Files: File → Open Remote Files
  2. Select Service: Choose "Solid Pod" from service dropdown
  3. Enter Pod URL: Use format vnd-solid://storage.inrupt.com/your-pod-id/
  4. Authenticate: Browser will open for OAuth login
  5. Access Files: Browse and open files from your Solid pod

Technical Architecture

URL Scheme Resolution

  • Input: vnd-solid://storage.inrupt.com/pod/file.odt
  • Internal: Converts to https://storage.inrupt.com/pod/file.odt
  • UCB Routing: Registered as Provider98 to intercept vnd-solid URLs
  • WebDAV Bypass: Prevents WebDAV UCP from claiming HTTPS URLs

Authentication Flow

  1. Discovery: OIDC configuration from pod domain
  2. Authorization: Browser-based OAuth 2.0 + PKCE flow
  3. Token Exchange: Authorization code for access/refresh tokens
  4. DPoP Headers: ECDSA P-256 signed JWT tokens per request
  5. Request Signing: Each HTTP request gets unique DPoP token

Build Integration

  • gbuild System: Uses LibreOffice's standard build macros
  • Service Registration: UCB Configuration.xcu registers the provider
  • Library Dependencies: Links to curl, openssl, LibreOffice core libraries
  • UI Integration: Remote Files dialog shows "Solid Pod" option

Dependencies

  • libcurl: HTTP client operations and authentication flows
  • openssl: ECDSA P-256 key generation and JWT signing for DPoP
  • LibreOffice core: ucbhelper, comphelper, sal, svtools, fpicker libraries

Current Limitations

  • Pod Discovery: Limited to manual URL entry (no automatic pod discovery)
  • Container Operations: Basic file operations only (no advanced container management)
  • ACL Integration: No Access Control List management
  • Offline Support: No local caching or offline file access

Development Areas

Priority areas for contribution:

  • Runtime Testing: Verify end-to-end authentication and file operations
  • Error Handling: Improve network error recovery and user feedback
  • Performance: Optimize HTTP request batching and connection reuse
  • Pod Compatibility: Test with different Solid pod implementations
  • Security Review: Audit DPoP implementation and credential storage

Troubleshooting

Build Issues

  • Missing Dependencies: Ensure libcurl and openssl development headers are installed
  • Namespace Errors: Code uses libreoffice::solid namespace structure
  • Missing Files: Verify all files were copied to correct LibreOffice source locations

Runtime Issues

  • No Solid Pod Option: Check UCB Configuration.xcu was updated and LibreOffice restarted
  • Authentication Failures: Verify pod URL format and network connectivity
  • File Access Errors: Check DPoP token generation and HTTP request headers

Contributing

This project welcomes contributions. Areas of focus:

  1. Testing: Verify compatibility across different Solid pod providers
  2. Features: Implement advanced Solid protocol features (ACL, containers, etc.)
  3. Performance: Optimize authentication flows and HTTP operations
  4. Documentation: Improve code documentation and user guides

License

MPL-2.0 (Mozilla Public License 2.0, same as LibreOffice core)

About

LibreOffice Solid Protocol Connector

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published