Swiftpack.co - swift-libp2p/swift-libp2p-plaintext as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by swift-libp2p.
swift-libp2p/swift-libp2p-plaintext 0.1.1
A libp2p (in)security module that performs plaintext faux-cryption
⭐️ 0
🕓 5 days ago
iOS macOS
.package(url: "https://github.com/swift-libp2p/swift-libp2p-plaintext.git", from: "0.1.1")

LibP2PPlaintext

Swift Package Manager compatible

A LibP2P Stream Faux-Cryption protocol

Table of Contents

Overview

⚠️ Plaintext is intended only for debugging and interoperability testing purposes. ⚠️

Secure communications are a key feature of libp2p, and encrypted transport is configured by default in libp2p implementations to encourage security for all production traffic. However, there are some use cases such as testing in which encryption is unnecessary. For such cases, the plaintext "security" protocol can be used. By conforming to the same interface as real security adapters like SECIO and TLS, the plaintext module can be used as a drop-in replacement when encryption is not needed.

Note:

Install

Include the following dependency in your Package.swift file

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/swift-libp2p/swift-libp2p-plaintext.git", .upToNextMajor(from: "0.1.0"))
    ],
        ...
        .target(
            ...
            dependencies: [
                ...
                .product(name: "LibP2PPlaintext", package: "swift-libp2p-plaintext"),
            ]),
    ...
)

Usage

Example


import LibP2PPlaintext

/// Tell libp2p that it can use plaintext...
app.security.use( .plaintext )

API

Not Applicable

Contributing

Contributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critques, are welcome!

Let's make this code better together! 🤝

Credits

License

MIT © 2022 Breth Inc.

GitHub

link
Stars: 0
Last commit: 5 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics