Skip to content

Commit

Permalink
rename service for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Jun 19, 2021
1 parent b4fe78e commit 7b448ac
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lnurl"
version = "0.1.1"
version = "0.2.0"
authors = ["Edouard Paris <[email protected]>"]
description = "Helpers for LNURL"
readme = "README.md"
Expand All @@ -15,7 +15,7 @@ name = "lnurl"
[features]
# Include nothing by default
default = []
service = ["hex", "secp256k1"]
auth = ["hex", "secp256k1"]

[dependencies]
hex = { version = "0.4.2", optional = true }
Expand All @@ -39,4 +39,4 @@ warp = "0.2.4"

[[example]]
name = "lnurl_auth"
required-features = ["service"]
required-features = ["auth"]
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _Readings about **lnurl**_
## Progress

- [x] lnurl-withdraw
- [ ] lnurl-auth
- [x] lnurl-auth
- [ ] lnurl-pay
- [ ] lnurl-channel

Expand Down Expand Up @@ -57,6 +57,3 @@ if let Err(_) = invoice.parse::<lightning_invoice::SignedRawInvoice>() {
.body(Body::from(res)).unwrap())
}
```

See [lnurl-examples](https://github.com/edouardparis/lnurl-examples)

6 changes: 3 additions & 3 deletions examples/lnurl_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async fn main() {
.init();

let url = env::var("SERVICE_URL").unwrap();
let verifier = lnurl::service::AuthVerifier::new();
let verifier = lnurl::auth::AuthVerifier::new();
let db = model::new_db();
let api = filter::api(url, db, verifier).with(warp::log("api"));
warp::serve(api).run(([127, 0, 0, 1], 8383)).await;
Expand All @@ -23,7 +23,7 @@ mod filter {
use super::auth;
use super::handler;
use super::model::DB;
use lnurl::service::AuthVerifier;
use lnurl::auth::AuthVerifier;
use warp::Filter;

pub fn api(
Expand Down Expand Up @@ -104,7 +104,7 @@ mod handler {

pub async fn auth(
db: DB,
verifier: lnurl::service::AuthVerifier,
verifier: lnurl::auth::AuthVerifier,
credentials: auth::Auth,
) -> Result<impl warp::Reply, Infallible> {
let mut sessions = db.lock().await;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};

#[cfg(feature = "service")]
pub mod service;
#[cfg(feature = "auth")]
pub mod auth;

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum Event {
Expand Down

0 comments on commit 7b448ac

Please sign in to comment.