microfed 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CORE.md ADDED
@@ -0,0 +1,48 @@
1
+ # Microfed Core
2
+
3
+ Microfed Core is the central module that manages communication between different components of the Microfed framework and provides utility functions. This document outlines the core design of Microfed Core, focusing on its integration with ActivityPub.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Core Components](#core-components)
8
+ - [ActivityPub Integration](#activitypub-integration)
9
+ - [API Interface](#api-interface)
10
+ - [Error Handling and Logging](#error-handling-and-logging)
11
+
12
+ ## Core Components
13
+
14
+ Microfed Core comprises the following components:
15
+
16
+ 1. **Configuration Management**: Handles settings and configuration for the framework, including user preferences, application settings, and module configurations.
17
+ 2. **Module Loader**: Manages the loading, initialization, and communication between Microfed modules, such as the Profile, Inbox, Outbox, and Authentication modules.
18
+ 3. **ActivityPub Adapter**: Provides a set of utility functions and classes to interact with ActivityPub, parse and serialize data, and manage ActivityPub objects.
19
+ 4. **Networking**: Handles networking tasks, such as HTTP requests, WebSocket connections, and peer-to-peer communication.
20
+
21
+ ## ActivityPub Integration
22
+
23
+ Microfed Core integrates with ActivityPub using the ActivityPub Adapter component. The adapter offers the following functionality:
24
+
25
+ 1. **ActivityPub Objects**: Defines classes for ActivityPub objects, such as Activities, Actors, and Objects, including methods to manipulate and interact with these objects.
26
+ 2. **Parsing and Serialization**: Provides utility functions to parse and serialize ActivityPub objects from/to JSON-LD format.
27
+ 3. **Activity Handling**: Implements methods for processing incoming and outgoing activities, such as Create, Update, Delete, Follow, and Like, according to the ActivityPub specification.
28
+ 4. **ActivityPub API**: Offers an API for interacting with ActivityPub services, such as fetching and updating Actor profiles, sending activities, and managing followers and following collections.
29
+
30
+ ## API Interface
31
+
32
+ Microfed Core exposes a simple and intuitive API interface for developers to interact with the framework and its modules. The API includes methods for:
33
+
34
+ 1. **Module Management**: Registering, initializing, and accessing Microfed modules.
35
+ 2. **ActivityPub Interaction**: Sending and receiving ActivityPub activities, managing Actor profiles, and handling collections.
36
+ 3. **Utility Functions**: Accessing common utility functions, such as data validation, conversion, and formatting.
37
+
38
+ ## Error Handling and Logging
39
+
40
+ Microfed Core provides a robust error handling and logging system to ensure that any issues or errors are properly reported and logged. This system includes:
41
+
42
+ 1. **Error Classes**: Custom error classes for different types of errors that can occur within Microfed Core and its modules.
43
+ 2. **Error Reporting**: Methods for reporting errors to the user or developer, with context-specific information and suggestions for resolving the issue.
44
+ 3. **Logging**: A flexible logging system that supports different log levels, log formats, and log destinations (e.g., console, file, or remote server).
45
+
46
+ ---
47
+
48
+ Microfed Core is the backbone of the Microfed framework, providing seamless integration with ActivityPub and managing communication between its components. By handling the core functionality, Microfed Core allows developers to focus on building innovative and decentralized applications that leverage the power of microservices and the fediverse.
package/DESIGN.md ADDED
@@ -0,0 +1,73 @@
1
+ # Microfed: Design Overview
2
+
3
+ <div align="center">
4
+ <img src="https://microfed.org/images/microfed.jpg" />
5
+ <h1><a href="https://microfed.org/">Microfed</a></h1>
6
+ </div>
7
+
8
+ <div align="center">
9
+ <i>Micro Services Meets the Fediverse</i>
10
+ </div>
11
+
12
+ ---
13
+
14
+ Microfed is a modular and extensible JavaScript framework that aims to bring together microservices and the fediverse, enabling the creation of decentralized applications that leverage the power of both worlds.
15
+
16
+ This document provides a high-level overview of Microfed's design, outlining the core modules and their functionality.
17
+
18
+ ## Table of Contents
19
+
20
+ - [Microfed Core](#microfed-core)
21
+ - [Profile Module](#profile-module)
22
+ - [Inbox Module](#inbox-module)
23
+ - [Outbox Module](#outbox-module)
24
+ - [Authentication Module](#authentication-module)
25
+ - [Utility Functions](#utility-functions)
26
+
27
+ ## Microfed Core
28
+
29
+ The Microfed Core serves as the central module that manages communication between different components and provides utility functions.
30
+
31
+ ## Profile Module
32
+
33
+ The Profile Module consists of the following features:
34
+
35
+ - A class representing a user profile, including attributes, public keys, connections, and endpoints.
36
+ - Methods for parsing and serializing profile data from/to JSON-LD format.
37
+ - Support for self-hosted and multi-user services.
38
+ - Compatibility with mobile devices and browsers.
39
+
40
+ [Profile Design](./PROFILE.md)
41
+
42
+ ## Inbox Module
43
+
44
+ The Inbox Module is designed to offer the following functionality:
45
+
46
+ - A class representing a user's inbox, which stores incoming messages in JSON format.
47
+ - Methods for filtering messages based on user preferences.
48
+ - Support for Activity Pub JSON compatibility and message signatures.
49
+
50
+ ## Outbox Module
51
+
52
+ The Outbox Module includes the following capabilities:
53
+
54
+ - A class representing a user's outbox, which sends messages to other inboxes.
55
+ - Methods for storing private keys and signing outgoing messages.
56
+ - Support for routing messages to appropriate endpoints.
57
+
58
+ ## Authentication Module
59
+
60
+ The Authentication Module provides a flexible and extensible authentication system:
61
+
62
+ - A base authentication class, which can be extended for different authentication methods.
63
+ - Support for PKI-based strong authentication.
64
+ - Support for delegated authentication (e.g., OAuth, OIDC) if needed.
65
+ - Integration with enterprise authentication systems.
66
+
67
+ ## Utility Functions
68
+
69
+ The Utility Functions module offers various general-purpose functions, such as data validation, conversion, and formatting.
70
+
71
+ ---
72
+
73
+ With its modular and extensible design, Microfed provides a robust and flexible foundation for developing decentralized applications that harness the power of microservices and the fediverse. By combining these technologies, Microfed empowers developers to create innovative, secure, and scalable applications for the decentralized web.
package/INBOX.md ADDED
@@ -0,0 +1,33 @@
1
+ # 📥 Inbox Module
2
+
3
+ The Inbox Module is an essential component of the Microfed project, focusing on the management of incoming messages and filtering based on user preferences. It seamlessly integrates with the ActivityPub protocol, ensuring a smooth user experience.
4
+
5
+ ## Overview
6
+
7
+ The Inbox Module provides a comprehensive solution for handling a user's inbox in a Microfed environment, offering a range of features, including:
8
+
9
+ - A dedicated class representing a user's inbox
10
+ - Storage of incoming messages in JSON format
11
+ - Message filtering based on user preferences
12
+ - Compatibility with ActivityPub JSON
13
+ - Support for message signatures to verify authenticity
14
+
15
+ ## 📩 User Inbox Class
16
+
17
+ At the heart of the Inbox Module lies a class specifically designed to represent a user's inbox. This class manages the storage, retrieval, and processing of incoming messages in JSON format, ensuring that users can easily interact with their inboxes in a consistent and structured manner.
18
+
19
+ ## 🔎 Message Filtering
20
+
21
+ The Inbox Module provides methods for filtering incoming messages based on user-defined preferences. This functionality allows users to have greater control over the messages they receive, enabling them to focus on the content that truly matters to them.
22
+
23
+ ## 🌐 ActivityPub JSON Compatibility
24
+
25
+ To ensure seamless integration with the fediverse, the Inbox Module has been designed to be compatible with the ActivityPub JSON format. This compatibility guarantees that messages from other users within the fediverse are correctly processed and displayed within the user's inbox.
26
+
27
+ ## 🔏 Message Signatures
28
+
29
+ In today's digital world, security and authenticity are of paramount importance. The Inbox Module supports message signatures, allowing users to verify the authenticity of incoming messages. This feature helps to protect users from potential phishing attempts or other malicious activities.
30
+
31
+ ---
32
+
33
+ The Inbox Module has been meticulously crafted to offer an exceptional user experience when interacting with the Microfed environment. Its powerful features and seamless integration with ActivityPub make it an indispensable part of the Microfed ecosystem.
package/OUTBOX.md ADDED
@@ -0,0 +1,33 @@
1
+ # 📤 Outbox Module
2
+
3
+ The Outbox Module is a critical component of the Microfed project, focusing on the efficient management of outgoing messages and ensuring secure communication with other inboxes in the fediverse. Its seamless integration with the ActivityPub protocol guarantees a smooth and intuitive user experience.
4
+
5
+ ## Overview
6
+
7
+ The Outbox Module offers a comprehensive solution for handling a user's outbox in a Microfed environment, providing a range of features, including:
8
+
9
+ - A dedicated class representing a user's outbox
10
+ - Sending messages to other inboxes
11
+ - Storage and management of private keys
12
+ - Signing outgoing messages for enhanced security
13
+ - Routing messages to appropriate endpoints
14
+
15
+ ## 📤 User Outbox Class
16
+
17
+ At the core of the Outbox Module is a class specifically designed to represent a user's outbox. This class manages the creation, processing, and sending of outgoing messages, ensuring that users can easily interact with their outboxes in a consistent and structured manner.
18
+
19
+ ## 🔐 Private Key Management
20
+
21
+ The Outbox Module includes methods for storing and managing private keys on behalf of users. By securely handling private keys, the module helps maintain the confidentiality of users' sensitive information and ensures robust security when communicating with other inboxes.
22
+
23
+ ## ✍️ Message Signing
24
+
25
+ To further enhance the security and authenticity of outgoing messages, the Outbox Module supports message signing. By signing messages with a user's private key, recipients can verify the authenticity of the message, protecting against potential phishing attempts or other malicious activities.
26
+
27
+ ## 🚀 Message Routing
28
+
29
+ The Outbox Module ensures that messages are correctly routed to their intended recipients by providing support for determining appropriate endpoints. This functionality guarantees that messages are delivered efficiently and accurately, enhancing the overall user experience.
30
+
31
+ ---
32
+
33
+ The Outbox Module has been carefully designed to offer an outstanding user experience when interacting with the Microfed environment. Its powerful features and seamless integration with ActivityPub make it an essential part of the Microfed ecosystem.
package/PROFILE.md ADDED
@@ -0,0 +1,55 @@
1
+ # Microfed Profile
2
+
3
+ Microfed Profile is a module within the Microfed framework responsible for handling user profiles and their interactions with the fediverse using ActivityPub and WebFinger protocols. This document outlines the core design of the Microfed Profile module.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Profile Components](#profile-components)
8
+ - [ActivityPub Profile Integration](#activitypub-profile-integration)
9
+ - [WebFinger Integration](#webfinger-integration)
10
+ - [API Interface](#api-interface)
11
+ - [Error Handling and Logging](#error-handling-and-logging)
12
+
13
+ ## Profile Components
14
+
15
+ Microfed Profile comprises the following components:
16
+
17
+ 1. **Profile Manager**: Handles the creation, updating, and retrieval of user profiles, as well as profile data management.
18
+ 2. **ActivityPub Profile Adapter**: Provides utility functions and classes to interact with ActivityPub profiles, parse and serialize profile data, and manage ActivityPub objects related to profiles.
19
+ 3. **WebFinger Adapter**: Offers utility functions to discover and resolve user profiles using WebFinger protocol.
20
+ 4. **Profile API**: Exposes an API for interacting with profiles, including fetching, updating, and managing connections.
21
+
22
+ ## ActivityPub Profile Integration
23
+
24
+ Microfed Profile integrates with ActivityPub using the ActivityPub Profile Adapter component. The adapter offers the following functionality:
25
+
26
+ 1. **Profile Objects**: Defines classes for ActivityPub profiles, including methods to manipulate and interact with profile data.
27
+ 2. **Parsing and Serialization**: Provides utility functions to parse and serialize ActivityPub profile data from/to JSON-LD format.
28
+ 3. **Profile Interaction**: Implements methods for interacting with profiles according to the ActivityPub specification, such as fetching profile data, updating profile attributes, and managing connections (followers, following, etc.).
29
+
30
+ ## WebFinger Integration
31
+
32
+ Microfed Profile integrates with the WebFinger protocol using the WebFinger Adapter component. This adapter provides the following functionality:
33
+
34
+ 1. **Profile Discovery**: Offers methods to discover user profiles based on their WebFinger identifiers (e.g., user@example.com).
35
+ 2. **Profile Resolution**: Implements methods to resolve WebFinger identifiers to actual profile URLs, making it easier to interact with profiles across different platforms.
36
+
37
+ ## API Interface
38
+
39
+ Microfed Profile exposes a simple and intuitive API interface for developers to interact with user profiles and their related ActivityPub and WebFinger functionality. The API includes methods for:
40
+
41
+ 1. **Profile Management**: Creating, updating, and retrieving user profiles.
42
+ 2. **ActivityPub Interaction**: Fetching and updating ActivityPub profiles, and managing connections (followers, following, etc.).
43
+ 3. **WebFinger Interaction**: Discovering and resolving user profiles using WebFinger identifiers.
44
+
45
+ ## Error Handling and Logging
46
+
47
+ Microfed Profile provides robust error handling and logging to ensure that any issues or errors are properly reported and logged. This system includes:
48
+
49
+ 1. **Error Classes**: Custom error classes for different types of errors that can occur within the Microfed Profile module.
50
+ 2. **Error Reporting**: Methods for reporting errors to the user or developer, with context-specific information and suggestions for resolving the issue.
51
+ 3. **Logging**: A flexible logging system that supports different log levels, log formats, and log destinations (e.g., console, file, or remote server).
52
+
53
+ ---
54
+
55
+ Microfed Profile is an essential module within the Microfed framework, providing seamless integration with ActivityPub and WebFinger protocols for managing user profiles. By handling the core functionality of profiles, Microfed Profile allows developers to build decentralized applications that leverage the power of microservices and the fediverse.
package/README.md CHANGED
@@ -22,7 +22,11 @@
22
22
 
23
23
  # ⚡️ Introduction
24
24
 
25
- Tthis project is still at concept stage and aims to brain storm the intersection of [micro servcies](https://en.wikipedia.org/wiki/Microservices) and the [fediverse](https://en.wikipedia.org/wiki/Fediverse).
25
+ This project is still at concept stage and aims to brainstorm the intersection of [micro services](https://en.wikipedia.org/wiki/Microservices) and the [fediverse](https://en.wikipedia.org/wiki/Fediverse).
26
+
27
+ # 🎨 Design
28
+
29
+ Microfed follows a modular design approach, ensuring flexibility and maintainability. The high-level design focuses on the interaction between microservices and the fediverse.
26
30
 
27
31
  The idea is that each component of a fediverse server can be composed from smaller services.
28
32
 
@@ -32,35 +36,40 @@ These include:
32
36
  - [Outbox](#Outbox)
33
37
  - [Authentication](#Authentication)
34
38
 
39
+ [Design Documentation](./DESIGN.md)
40
+
41
+
35
42
  # ✍️ Profile
36
43
 
37
- Your profile page is the starting point for microfed services. It will generally be an HTTP page, but the data should be agnostic to HTTP or any other protocol so that it can live in a database, or run over a P2P network.
44
+ Your Profile page is the starting point for microfed services. It will generally be an HTTP page, but the data should be agnostic to HTTP or any other protocol so that it can live in a database, or run over a P2P network.
38
45
 
39
- The profile will be in HTML, with the data in in JSON(-LD). It will contain:
46
+ The Profile will be in HTML, with the data in in JSON(-LD). It will contain:
40
47
 
41
- &nbsp;&nbsp;✓&nbsp;The profile page
48
+ &nbsp;&nbsp;✓&nbsp;The Profile page
42
49
  &nbsp;&nbsp;✓&nbsp;The User / Actor / Agent
43
50
  &nbsp;&nbsp;✓&nbsp;Attributes about the User
44
51
  &nbsp;&nbsp;✓&nbsp;Ability to store a public key
45
52
  &nbsp;&nbsp;✓&nbsp;A list of connections (friends, knows, followers etc.)
46
- &nbsp;&nbsp;✓&nbsp;Endpoint for inbox
47
- &nbsp;&nbsp;✓&nbsp;Endpoint for outbox
53
+ &nbsp;&nbsp;✓&nbsp;Endpoint for Inbox
54
+ &nbsp;&nbsp;✓&nbsp;Endpoint for Outbox
48
55
  &nbsp;&nbsp;✓&nbsp;Authentictation endpoints
49
56
  &nbsp;&nbsp;✓&nbsp;Arbitrary fields specified by the user
50
57
 
51
- The Profile can be self hosted, or part of a multi user service. It should be able to run on a mobile device, or in the browser.
58
+ The Profile can be self-hosted, or part of a multi user service. It should be able to run on a mobile device, or in the browser.
59
+
60
+ [Profile Design](./PROFILE.md)
52
61
 
53
- # Inbox
62
+ # 📬 Inbox
54
63
 
55
- The Inbox should be a place where people can send messages in JSON. The micro service can filter out messages based on user preferences. The message format should be as far as possible compatible with Activity Pub JSON. Signatures can be used to verify the authenticity of a message
64
+ The Inbox should be a place where people can send messages in JSON. The micro service can filter out messages based on user preferences. The message format should be as far as possible compatible with Activity Pub JSON. Signatures can be used to verify the authenticity of a message.
56
65
 
57
- # Outbox
66
+ # 📤 Outbox
58
67
 
59
- The outbox is a service that allows messages to be sent to other inboxes. It should also have to ability to store a private key on behalf of a user, in order to sign outgoing messages. It should be able to route messages to the right endpoints.
68
+ The Outbox is a service that allows messages to be sent to other inboxes. It should also have to ability to store a private key on behalf of a user, in order to sign outgoing messages. It should be able to route messages to the right endpoints.
60
69
 
61
- # Authentication
70
+ # 🔐 Authentication
62
71
 
63
- Initially, strong authentication via PKI will be supported. Delegated authenticaiton, such as OAuth and OIDC may be considered desirable. A loosely coupled authentication suite will allow the user to add different authentication modules. This could also work with enterprise authentication.
72
+ Initially, strong authentication via PKI will be supported. Delegated authentication, such as OAuth and OIDC may be considered desirable. A loosely coupled authentication suite will allow the user to add different authentication modules. This could also work with enterprise authentication.
64
73
 
65
74
  # ⚖️ License
66
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microfed",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "microfed",
5
5
  "main": "index.js",
6
6
  "scripts": {