{"id":28384396,"url":"https://github.com/polyphony-chat/polyproto-rs","last_synced_at":"2025-06-25T23:31:03.356Z","repository":{"id":220410852,"uuid":"751560066","full_name":"polyphony-chat/polyproto-rs","owner":"polyphony-chat","description":"Reference implementation of polyproto in Rust","archived":false,"fork":false,"pushed_at":"2025-06-18T09:45:36.000Z","size":1260,"stargazers_count":50,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T02:16:23.457Z","etag":null,"topics":["polyphony","polyproto"],"latest_commit_sha":null,"homepage":"https://docs.polyphony.chat/Overviews/core/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polyphony-chat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-01T21:07:50.000Z","updated_at":"2025-06-18T21:01:54.000Z","dependencies_parsed_at":"2025-02-05T15:21:08.506Z","dependency_job_id":"06ebd9a6-bd4f-4e95-87e7-2c437d2d5dda","html_url":"https://github.com/polyphony-chat/polyproto-rs","commit_stats":null,"previous_names":["bitfl0wer/polyproto-rs","polyphony-chat/polyproto-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/polyphony-chat/polyproto-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-chat%2Fpolyproto-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-chat%2Fpolyproto-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-chat%2Fpolyproto-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-chat%2Fpolyproto-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyphony-chat","download_url":"https://codeload.github.com/polyphony-chat/polyproto-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-chat%2Fpolyproto-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261972565,"owners_count":23238537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["polyphony","polyproto"],"created_at":"2025-05-30T08:30:23.983Z","updated_at":"2025-06-25T23:31:03.347Z","avatar_url":"https://github.com/polyphony-chat.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://cloud.bitfl0wer.de/apps/files_sharing/publicpreview/2qCxoXJ27yW7QNR?file=/\u0026fileId=1143147\u0026x=256\u0026y=256\u0026a=true\" align=\"left\" alt=\"a purple cog, split in the middle along the horizontal axis with a gap inbetween the two halves. three overlayed, offset sinus-like waves travel through that gap. each wave has a different shade of purple\" width=\"128px\" height=\"auto\"\u003e\u003c/img\u003e\n\n### `polyproto`\n\n![dev-status]\n[![Discord]][Discord-invite]\n[![Build][build-shield]][build-url]\n[![Coverage][coverage-shield]][coverage-url]\n[![FAQ-shield]][FAQ]\n\nCrate supplying (generic) Rust types and traits to quickly get a\n[polyproto](https://docs.polyphony.chat/Protocol%20Specifications/core/) implementation up and\nrunning, as well as an HTTP client for the polyproto API.\n\n**[Overview/TL;DR][overview]** • **[crates.io][crates-link]** • **[Protocol Specification][docs]**\n\n## Crate overview\n\nBuilding upon types offered by the [der](https://crates.io/crates/der),\n[x509_cert](https://crates.io/crates/x509_cert) and [spki](https://crates.io/crates/spki) crates,\nthis crate provides a set of types and traits to quickly implement the polyproto specification.\nSimply add cryptography and signature algorithm crates of your choice to the mix, and you are ready\nto go.\n\nAll polyproto certificate types can be converted to and from the types offered by the `x509_cert`\ncrate.\n\n## Implementing polyproto\n\nStart by implementing the trait `[crate::signature::Signature]` for a signature algorithm of your\nchoice. Popular crates for cryptography and signature algorithms supply their own `PublicKey` and\n`PrivateKey` types. You should extend upon these types with your own structs and implement the\n`[crate::key]` traits for these new structs.\n\nYou can then use the `[crate::certs]` types to build certificates using your implementations of the\naforementioned traits.\n\n**View the [examples](./examples/)** directory for a simple example on how to implement and use this\ncrate with the ED25519 signature algorithm.\n\n## Cryptography\n\nThis crate provides no cryptographic functionality whatsoever; its sole purpose is to aid in\nimplementing polyproto by transforming the\n[polyproto specification](https://docs.polyphony.chat/Protocol%20Specifications/core/) into\nwell-defined yet adaptable Rust types.\n\n## Safety\n\nPlease refer to the documentation of individual functions for information on which safety guarantees\nthey provide. Methods returning certificates, certificate requests and other types where the\nvalidity and correctness of the data has a chance of impacting the security of a system always\nmention the safety guarantees they provide in their respective documentation.\n\nThis crate has not undergone any security audits.\n\n## WebAssembly\n\nThis crate is designed to work with the `wasm32-unknown-unknown` target. To compile for `wasm`, you\nwill have to use the `wasm` feature:\n\n```toml\n[dependencies]\npolyproto = { version = \"0\", features = [\"wasm\"] }\n```\n\nAdditionally, you will have to compile the project using the `--no-default-features` flag, to ensure\nthat `tokio/net` is not pulled in as a feature dependency. The `types`, `serde`, `reqwest` and `gateway`\nfeatures all work with WASM.\n\n## HTTP API client through `reqwest`\n\nIf the `reqwest` feature is activated, this crate offers a polyproto HTTP API client, using the\n`reqwest` crate.\n\n### Alternatives to `reqwest`\n\nIf you would like to implement an HTTP client using something other than `reqwest`, simply enable\nthe `types` and `serde` features. Using these features, you can implement your own HTTP client, with\nthe polyproto crate acting as a single source of truth for request and response types, as well as\nrequest routes and methods through the exported `static` `Route`s.\n\n## WebSocket Gateway client\n\nSince `v0.10`, this crate ships polyproto WebSocket Gateway client functionality, gated behind the `gateway` feature.\nThe implementation of this feature is super backend-agnostic—though, for now, we have sealed the needed traits, and are only shipping a `tokio-tungstenite` backend for testing.\n\nThe gateway handles establishing a connection to the server, sending regular heartbeats at the specified interval and responding to Opcode 11—the manual heartbeat request.\n\nApart from the Hello payload, library consumers can easily get access to all messages received from the gateway by calling `subscribe()` on the internal `tokio::sync::watch::Sender\u003cGatewayMessage\u003e`. This means that this crate handles only the bare necessities of connecting to the gateway, and that you are free to handle incoming messages however you would like to. Our `GatewayMessage` type is `.into()` and `From::\u003c\u003e`-compatible with `tokio_tungstenite::tungstenite::Message`, so that you are not locked into using our message types, should you not want that.\n\n## Versioning and MSRV\n\nSemver v2.0 is used for the versioning scheme for this crate.\n\nThe default feature set of this crate is used to determine, verify and update the MSRV and semver version\nof this crate.\n\n## Logo\n\nThe polyproto logo was designed by the wonderful [antidoxi](https://antidoxi.carrd.co/).\nThe polyproto logos provided in this document are not covered by the MPL-2.0 license covering the rest\nof this project.\n\n[dev-status]: https://img.shields.io/static/v1?label=Status\u0026message=Alpha\u0026color=blue\n[build-shield]: https://img.shields.io/github/actions/workflow/status/polyphony-chat/polyproto-rs/build_and_test.yml?style=flat\n[build-url]: https://github.com/polyphony-chat/polyproto-rs/blob/main/.github/workflows/build_and_test.yml\n[coverage-shield]: https://coveralls.io/repos/github/polyphony-chat/polyproto-rs/badge.svg?branch=main\n[coverage-url]: https://coveralls.io/github/polyphony-chat/polyproto-rs?branch=main\n[Discord]: https://dcbadge.vercel.app/api/server/m3FpcapGDD?style=flat\n[Discord-invite]: https://discord.com/invite/m3FpcapGDD\n[crates-link]: https://crates.io/crates/polyproto\n[docs]: https://docs.polyphony.chat/Protocol%20Specifications/core/\n[overview]: https://docs.polyphony.chat/Overviews/core/\n[FAQ-shield]: https://img.shields.io/badge/Frequently_Asked_Questions_(FAQ)-ff62bd\n[FAQ]: https://github.com/polyphony-chat/.github/blob/main/FAQ.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyphony-chat%2Fpolyproto-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyphony-chat%2Fpolyproto-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyphony-chat%2Fpolyproto-rs/lists"}