Browse Source

Add OAuth crate

master
Puck Meerburg 1 year ago
parent
commit
5c4af66c4e
3 changed files with 26 additions and 1 deletions
  1. 17
    0
      Cargo.lock
  2. 3
    1
      Cargo.toml
  3. 6
    0
      src/main.rs

+ 17
- 0
Cargo.lock View File

@@ -396,6 +396,7 @@ dependencies = [
"futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)",
"kroeg-mastodon 0.1.0",
"kroeg-oauth 0.1.0",
"kroeg-server 0.1.0",
]

@@ -427,6 +428,22 @@ dependencies = [
"serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "kroeg-oauth"
version = "0.1.0"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonld 0.1.0",
"kroeg-mastodon 0.1.0",
"kroeg-server 0.1.0",
"kroeg-tap 0.1.0",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "kroeg-server"
version = "0.1.0"

+ 3
- 1
Cargo.toml View File

@@ -4,11 +4,13 @@ version = "0.1.0"
authors = ["Puck Meerburg <puck@puckipedia.com>"]

[features]
default = []
default = ["mastodon", "oauth"]
mastodon = ["kroeg-mastodon"]
oauth = ["kroeg-oauth"]

[dependencies]
kroeg-mastodon = { path = "../mastodon", optional = true }
kroeg-oauth = { path = "../oauth", optional = true }
kroeg-server = { path = "../server" }
hyper = "0.12"
futures = "0.1"

+ 6
- 0
src/main.rs View File

@@ -6,6 +6,9 @@ extern crate kroeg_server;
#[cfg(feature = "mastodon")]
extern crate kroeg_mastodon;

#[cfg(feature = "oauth")]
extern crate kroeg_oauth;

use futures::{future, Future};
use hyper::{Body, Response, Server};
use kroeg_server::{
@@ -48,6 +51,9 @@ fn listen_future(
#[cfg(feature = "mastodon")]
kroeg_mastodon::register(&mut builder);

#[cfg(feature = "oauth")]
kroeg_oauth::register(&mut builder);

println!(" [+] listening at {}", addr);

Server::bind(&addr).serve(builder).map_err(|_| ())

Loading…
Cancel
Save