microfed 0.0.4 → 0.0.6
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 +48 -0
- package/DESIGN.md +73 -0
- package/INBOX.md +33 -0
- package/PROFILE.md +55 -0
- package/README.md +32 -23
- package/package.json +1 -1
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/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
|
@@ -20,11 +20,15 @@
|
|
|
20
20
|
[](https://npmjs.com/package/microfed)
|
|
21
21
|
[](https://github.com/micro-fed/microfed.org/)
|
|
22
22
|
|
|
23
|
-
# Introduction
|
|
23
|
+
# ⚡️ Introduction
|
|
24
24
|
|
|
25
|
-
|
|
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
26
|
|
|
27
|
-
|
|
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.
|
|
30
|
+
|
|
31
|
+
The idea is that each component of a fediverse server can be composed from smaller services.
|
|
28
32
|
|
|
29
33
|
These include:
|
|
30
34
|
- [Profile](#Profile)
|
|
@@ -32,36 +36,41 @@ These include:
|
|
|
32
36
|
- [Outbox](#Outbox)
|
|
33
37
|
- [Authentication](#Authentication)
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
[Design Documentation](./DESIGN.md)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# ✍️ Profile
|
|
43
|
+
|
|
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.
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
The Profile will be in HTML, with the data in in JSON(-LD). It will contain:
|
|
38
47
|
|
|
39
|
-
The
|
|
48
|
+
✓ The Profile page
|
|
49
|
+
✓ The User / Actor / Agent
|
|
50
|
+
✓ Attributes about the User
|
|
51
|
+
✓ Ability to store a public key
|
|
52
|
+
✓ A list of connections (friends, knows, followers etc.)
|
|
53
|
+
✓ Endpoint for Inbox
|
|
54
|
+
✓ Endpoint for Outbox
|
|
55
|
+
✓ Authentictation endpoints
|
|
56
|
+
✓ Arbitrary fields specified by the user
|
|
40
57
|
|
|
41
|
-
-
|
|
42
|
-
- The User / Actor / Agent
|
|
43
|
-
- Attributes about the User
|
|
44
|
-
- Ability to store a public key
|
|
45
|
-
- A list of connections (friends, knows, followers etc.)
|
|
46
|
-
- Endpoint for inbox
|
|
47
|
-
- Endpoint for outbox
|
|
48
|
-
- Authentictation endpoints
|
|
49
|
-
- Arbitrary fields specified by the user
|
|
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.
|
|
50
59
|
|
|
51
|
-
|
|
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
|
|
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
|
|
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
|
-
# License
|
|
74
|
+
# ⚖️ License
|
|
66
75
|
|
|
67
76
|
- MIT
|