Skip to content

mathieu-vision/contract-consent-agent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Consent/Contracts Negotiating Agent

Overview

The Consent/Contracts Agent is a comprehensive library designed to seamlessly integrate with the contract-manager and consent-manager. It offers a range of features, including the automatic creation and management of profiles, automation of processes, personalized recommendations, and the ability to set and manage profile preferences. Additionally, the agent provides a robust routing system to facilitate the efficient flow of these functionalities.

Design Document

See the design document here.

Features

  • Consent Profile Management: Enables profiles for users in the consent-manager.
  • Contract Profile Management: Enables profiles for contract-manager.
  • Contract Negotiation Management: Enables organizations to define default rules and conditions for negotiation.

Example Configuration

Here’s an example of a JSON configuration:

{
  "source": "profiles",
  "url": "mongodb://localhost:27017",
  "dbName": "contract_consent_agent_db",
  "watchChanges": false,
  "hostsProfiles": true,
  "existingDataCheck": true
}

Building instructions

pnpm install

Running instructions

Contract Agent

pnpm test-cca-contract

Consent Agent

pnpm test-cca-consent

Technical Usage Scenarios

  • Individuals can manage their consent preferences effectively.
  • Organizations can streamline the negotiation process for data sharing agreements.
  • Automatic recommendations for services based on consent profiles and contract profiles.

API Documentation

The API for the Consent/Contracts Negotiating Agent is documented using Swagger. You can find the API routes and their descriptions in the swagger.json file located in the contract-agent/docs directory.

Example API Endpoints

  • Get Recommendations: GET /profile/{profileId}/recommendations/consent
  • Set Preferences: POST /profile/{profileId}/preferences
  • Get Preferences: GET /profile/{profileId}/preferences
  • Negotiate Contract: POST /negotiation/contract/negotiate

Example usage

Describe how to check some basic functionality of the BB. E.g.:

Send the following requests to the designated endpoints:

Endpoint Example input Expected output
/hello World 200, Hello World!

Integrations

Direct Integrations with Other Building Blocks

Standards

  • Data Format Standards: JSON-LD, ISO 3166-1 alpha-2, ISO 8601, ODRL

Architecture

The architecture consists of several key components:

  1. Contract Agent: Manages contract profiles of organizations and facilitates contract negotiations.
  2. Consent Agent: Manages consent preferences of individuals and automates responses to consent requests.

Logging and Operations

The agent logs operations, errors, and warnings to facilitate troubleshooting and debugging. It also imposes limits and usage constraints to ensure efficient operation.

Testing

The testing strategy includes unit tests, integration tests, and UI tests to ensure the correctness and reliability of functionalities.

Generate Test Reports for Contract Agent

pnpm report-cca-contract

Generate Test Reports for Consent Agent

pnpm report-cca-consent

Run Full Test Suite

pnpm test

Usage in the Dataspace

The Consent/Contracts Negotiating Agent enhances data usage and sharing agreements management, ensuring compliance with policies and streamlining processes for individuals and organizations.

Build the Project

pnpm build

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bug fixes.

Contact

For more information, please contact the project maintainers.

About

Consent/contracts negotiating agent

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.3%
  • JavaScript 2.7%