pub struct LnurlAuthToJwtProvider { /* private fields */ }
Expand description
Provides a JWT token based on LNURL Auth.
Implementations§
Source§impl LnurlAuthToJwtProvider
impl LnurlAuthToJwtProvider
Sourcepub fn new(
parent_key: Xpriv,
url: String,
default_headers: HashMap<String, String>,
) -> Result<LnurlAuthToJwtProvider, VssHeaderProviderError>
pub fn new( parent_key: Xpriv, url: String, default_headers: HashMap<String, String>, ) -> Result<LnurlAuthToJwtProvider, VssHeaderProviderError>
Creates a new JWT provider based on LNURL Auth.
The LNURL Auth keys are derived as children from a hardened parent key,
following LUD-05.
The hardened parent extended key is given here as an argument, and is suggested to be the
m/138'
derivation from the wallet master key as in the specification.
However, users are free to choose a consistent hardened derivation path.
The LNURL with the challenge will be retrieved by making a request to the given URL. The JWT token will be returned in response to the signed LNURL request under a token field. The given set of headers will be used for LNURL requests, and will also be returned together with the JWT authorization header for VSS requests.
Trait Implementations§
Source§impl VssHeaderProvider for LnurlAuthToJwtProvider
impl VssHeaderProvider for LnurlAuthToJwtProvider
Source§fn get_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, VssHeaderProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, VssHeaderProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the HTTP headers to be used for a VSS request.
This method is called on each request, and should likely perform some form of caching. Read more
Auto Trait Implementations§
impl !Freeze for LnurlAuthToJwtProvider
impl !RefUnwindSafe for LnurlAuthToJwtProvider
impl Send for LnurlAuthToJwtProvider
impl Sync for LnurlAuthToJwtProvider
impl Unpin for LnurlAuthToJwtProvider
impl !UnwindSafe for LnurlAuthToJwtProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more