No description
  • PHP 61.2%
  • JavaScript 27.3%
  • CSS 5.8%
  • HTML 5.3%
  • Dockerfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Martin Miller 6734d742e1 Style: Add icon for iconet inbox
Previously the envelope icon was duplicated.
2023-03-06 12:39:38 +01:00
.idea Fetch inbox content and implement interactions 2022-12-08 15:43:36 +01:00
api API: Rename endpoints 2023-02-27 12:08:25 +01:00
assets iconet open inbox call within neta 2023-02-22 10:01:56 +01:00
config DB: Use singleton and prepare SQL statements 2023-02-20 10:24:11 +01:00
iconet EE: Allow data/blob schema in default-src CSP 2023-03-06 12:31:30 +01:00
includes Style: Add icon for iconet inbox 2023-03-06 12:39:38 +01:00
tests added external comments 2023-02-17 17:51:13 +01:00
.env.default Make the content response packet follow the schema 2022-12-07 14:25:34 +01:00
.gitignore Make the content response packet follow the schema 2022-12-07 14:25:34 +01:00
.htaccess Cleanup code (mainly User and Post classes) 2022-10-21 10:26:41 +02:00
apache.conf feat: add docker support 2022-11-02 17:56:05 +01:00
close_account.php Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00
comment_frame.php added external comments 2023-02-17 17:51:13 +01:00
composer.json Implement simple http S2S and cleanup code (#14) 2022-11-18 16:56:29 +00:00
composer.lock Implement simple http S2S and cleanup code (#14) 2022-11-18 16:56:29 +00:00
contacts.php DB: Use singleton and prepare SQL statements 2023-02-20 10:24:11 +01:00
docker-compose.yml Simplify docker setup to a single command (#12) 2022-11-15 16:19:06 +01:00
Dockerfile Implement EmbeddedExperience sandbox with client proxy 2022-11-30 16:37:59 +01:00
external_comment_frame.php cleanups 2023-02-17 17:51:13 +01:00
favicon.ico Cleanup code (mainly User and Post classes) 2022-10-21 10:26:41 +02:00
iconet_inbox.php iconet open inbox call within neta 2023-02-22 10:01:56 +01:00
index.php Fix: Send native id in notification content instead of iconet id 2023-02-26 22:24:06 +01:00
LICENSE-ExampleNetA Upload ExampleNetA 2022-09-09 13:20:31 +02:00
LICENSE.md Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00
like.php Fix issues from processing-PR 2022-11-03 17:28:23 +01:00
messages.php Add unit tests for User.php 2022-10-21 17:41:35 +02:00
netA.sql added external comments 2023-02-17 17:51:13 +01:00
phpstan.neon Add phpstan as code inspection tool 2022-10-21 10:35:37 +02:00
phpunit.xml Add phpunit framework and use composer autoloader 2022-10-21 17:38:25 +02:00
print_comments.php added external comments 2023-02-17 17:51:13 +01:00
profile.php DB: Use singleton and prepare SQL statements 2023-02-20 10:24:11 +01:00
README.md Remove format request and response packets 2022-12-08 20:18:56 +01:00
register.php Implement simple http S2S and cleanup code (#14) 2022-11-18 16:56:29 +00:00
search.php Add unit tests for removing friends 2022-10-21 20:23:21 +02:00
settings.php Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00
setup.md Update setup instructions 2022-12-09 14:09:44 +01:00
single_post.php Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00
todo.md iframes: Simplify authentication and initialization 2022-12-05 23:33:52 +01:00
upload.php Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00
user_closed.php Cleanup code (formatting only) 2022-10-21 10:33:06 +02:00

Iconet integration into ExampleNetA

Check setup.me for Setup Instructions.

This repository is part of the iconet prototype development, where two networks are linked through the iconet mechanisms. This is a basic network, with a low feature set and the code uses no frameworks. This allows for a quite untangled demonstration, on how to integrate the iconet technology. ExampleNetA is taken from: https://github.com/yaswanthpalaghat/Social-Network-using-php-and-mysql

A: Development Doku

Here we document the development from ExampleNetA towards interconnectivity.

Files added:

While not necessary, for demonstration purposes we intend to split the initial structure of ExampleNetA as much as possible from the required structure added for iconet.

iconet/iconet.sql

Fills the iconet database with the required tables. (execute only on setup)

iconet/index.php

Catches incoming requests, initiates required action.

iconet/api_outwards

HTTP helper to send packets to URLS.

iconet/database

Getters and Setters for the iconet DB

iconet/formats

Functions to check variables if their format adheres to iconet structures

iconet/request_builder

Translates internally required variables into iconet requests. (potentially merges later with api_outwards)

iconet/cryptography

Handles iconet encryption and decryption

iconet/libs/AES

AES class for symetric encryption

Features added:

Internal process documentation for the incrementally added features.

Feature: Separate Infrastructure

Description: Add a separate database and infrastructure for all iconet related aspects. While networks might want the iconet features to be rather integrated, for showcasing this is ideal.

Code added: iconet database table generation, folders for iconet handlers.

Feature: Contactlist

Description: In its initial feature-set, Users of ExampleNetA have no ability to display or manage contacts/friends. So far, the friends feature of ExampleNetA only enables adding and removing friends, where being friends entails that posts are displayed on the friends feed. While iconet does not set any requirements on how contacts/friends are handled by a network, there needs to be some way for a user to add and manage external addresses and hold them in a contact-list, so they can send messages to them.

Code added: Since ExampleNetA has no such feature, we add it. We change the requests.php to contacts.php, which previously only displayed pending friend requests. A user will be able to display all their internal friends and friends-requests, as well as their external contacts.

Feature: Iconet-Address generation

Description: Each user, to be able to be addressed by users of external networks, needs some global address. This will be the local identifier of a user and the global address of the network, written like localID@globalURL

Code added: Assume, ExampleNetA holds the global URL ExampleNetA.net On User registration, a global Address is automatically generated and added to the database. This address will be displayed on the profile of each user.

Feature: Basic S2S: Request and Return PublicKey of Users.

Description: Required to provided external sources with pubkey of local users.

Code added: Generate internal Server2Server handling structure. For now use trivial placeholders for external s2s communication. Return Pubkey on request.
Packets are formatted in JSON.

Request:

{
    "type": "RequestPublicKey",
    "address": %address
}

Response:

{
    "type": "PublicKeyResponse",
    "address": %address,
    "publickey": %pubkey
}

Feature: Encryption Basics

Description: Create cryptography interface, import AES and openSSL.

Code added: Imported AES and openSSL, created cryptography.php Implement and test hybrid encryption process.

Feature: Encryption Adaption

Description: Notifications and content are encrypted via AES, the common Secret is encrypted via GPG with an in openSSL generated public key. A private key for decryption is generated simultaneously.

Code added: Created Keys on User Registration & Store in DB Created Key format in formats.php Use Checks of Format on Receiving Keys. Prepare: Encrypt outgoing packets, eecrypt incoming packets. (No such packets are being sent yet)

Feature: Processing

Create processing interface with iconet API. Define non-optional elements of processed packets. In this table these are written in bold lettering.

Packet Field Value/Example Description
Public Key Request type "publicKeyRequest" Required: The packet type is a specific name, identifying, what kind of packet is sent.
address "bob@bobnet.org" Required: "Address" is the global address of the owner of the requested public key including the owners name and the one of the hosting network.
Public Key Response type "publicKeyResponse" Required
address "bob@bobnet.org" Required
publicKey "-----BEGIN PUBLIC KEY-----\nMI..." Required: The requested public key is sent as string.
Notification type "Notification" Required
actor "alice@alicenet.net" Required: "Actor" specifies the address of the sender of the content.
to "bob@bobnet.org" Required: "To" contains the address of the person, the content is sent to.
encryptedSecret "jtqgp5D2Z4..." Required: The asymmetrically encrypted key for symmetric encryption is named "encryptedSecret".
predata Required: This array includes the symmetrically encrypted pre-data and the content identifier.
predata.id "92defee110..." Required: The content identifier is necessary, to be able to assign the pre-data to the actual content.
predata.subject "New message from ..." Required: The subject is a string with a short description of the received content.
encrypted bool(true) "Encrypted" is true, if the pre-data is encrypted.
interoperability Here, interoperability information about network of sender can be attached. This helps processing content of foreign technologies.
interoperability.protocol "ExampleNetA" If needed, the technology of the sender's network can be described.
interoperability.contentType "Posting" The content type tells the receiving network, what sort of content is sent.
Content Request type "ContentRequest" Required
actor "alice@alicenet.net" Required: "Actor" specifies the address of the sender of the content.
id "92defee110..." Required: The content identifier is required, to be able to assign the pre-data as well as all past and coming interactions to the actual content.
Content Response type "ContentResponse" Required
actor "alice@alicenet.net" Required
formatId "post-comments" Required: The format identifier is a string specifying the name of the sent format.
content "ZXloOUp2Nn..." Required: The actual content is encrypted symmetrically with the secret.
encrypted bool(true) "Encrypted" is true, if the content is encrypted.
interactions Here, the list of interactions to original content can be attached.
interactions.sender "bob@bobnet.net" Each interaction needs the information about the address of the interaction's sender.
interactions.interaction "ERt3dsfsdf..." All interaction contents are symmetrically encrypted with the secret.
Interaction type "Interaction" Required
actor "bob@bobnet.net" Required: "Actor" specifies the address of the sender of the interaction content.
to "alice@alicenet.net" Required: "To" contains the address of the person, who receives the interaction content.
id "92defee110..." Required:
interactionType "comment" Required: The interaction type is important for the receiving network to be able to properly process and view the content.
interaction "j9345jsdl7..." Required: The interaction content is symmetrically encrypted with the secret.
nonce "90353ß2350..." The "number only used once" is used to identify and sort the interactions.
encrypted bool(true) "Encrypted" is true, if the interaction content is encrypted.
Acknowledgment type "ACK" Required: An acknowledgment about the received content is sent to the actor's network.
Error type "Error" Required
error "Error!" Required: The error message includes information about the occurring problem.

Code added: Created PacketBuilder.php, PacketHandler.php, index.php, post_office.php, Processor.php. Added folder posts for saving content via ID. Implement and test processing.