-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some README info too.
- Loading branch information
Showing
3 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "webfinger-rs" | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,6 @@ Any parameters of the query component other than `resource` and `rel` are ignore | |
|
||
A successful response is indicated by HTTP 200 (OK) and includes the HTTP headers `Access-Control-Allow-Origin: *` and `Content-Type: application/jrd+json`. The response body consists of the JRD, or a subset of the JRD if the request included `rel` parameters. | ||
|
||
## Building | ||
|
||
This server is written in Rust. After [installing Rust](https://www.rust-lang.org/tools/install), | ||
build the server by issuing the `cargo` command in the root directory of a clone of this repository: | ||
~~~ | ||
cargo build --release | ||
~~~ | ||
|
||
This will build the `webfinger-rs` server executable in `target/release`. | ||
|
||
## Usage | ||
|
||
Start the `webfinger-rs` server by executing the following command: | ||
|
@@ -74,6 +64,40 @@ For example: | |
|
||
In the example, each URI in the top-level map is an account equal to the subject, but the URIs need not be accounts and need not be equal to the subject. See the WebFinger [RFC 7033](https://www.rfc-editor.org/rfc/rfc7033.html) for more information about URIs and subjects and [RFC 7565](https://www.rfc-editor.org/rfc/rfc7565.html) for details of the 'acct' URI scheme. | ||
|
||
## Trying it out | ||
|
||
Run the server with port 8095 (or any other suitable port) and the example JRD map above: | ||
~~~ | ||
webfinger-rs --port 8095 --jrd-map-path example.json | ||
~~~ | ||
|
||
Then issue a WebFinger request using `curl` and see the response: | ||
~~~ | ||
curl -i -H 'Accept: application/jrd+json' http://localhost:8095/.well-known/webfinger\?resource\=acct:[email protected] | ||
HTTP/1.1 200 OK | ||
content-type: application/jrd+json | ||
access-control-allow-origin: * | ||
content-length: 194 | ||
date: Fri, 28 Jun 2024 11:33:51 GMT | ||
{"subject":"acct:[email protected]","aliases":["acct:[email protected]"],"links":[{"rel":"http://webfinger.net/rel/avatar","type":"image/jpeg","href":"https://example.com/alice-avatar.jpeg"}]} | ||
~~~ | ||
(the `-i` switch displays the response headers) | ||
|
||
## Building | ||
|
||
Binary builds for Linux and Windows are available in [published releases](https://github.com/glyn/webfinger-rs/releases). However, if you need to | ||
build for a different platform or with a pre-release level of code, please | ||
read on. | ||
|
||
This server is written in Rust. After [installing Rust](https://www.rust-lang.org/tools/install), | ||
build the server by issuing the `cargo` command in the root directory of a clone of this repository: | ||
~~~ | ||
cargo build --release | ||
~~~ | ||
|
||
This will build the `webfinger-rs` server executable in `target/release`. | ||
|
||
## Development | ||
|
||
See the [Contributor Guide](./CONTRIBUTING.md) if you'd like to submit changes | ||
|