-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The code is set up to handle authorization easily, but it's not implemented. The general outline is this:
Create a new struct like so:
pub struct AuthorizedClient<'a> {
underlying: SnapdClient,
macaroon: Macaroon<'a>
}Where Macaroon is a newtype over a Cow. Then you can implement GetClient (etc) as for SnapdClient, but override attach_headers to also attach the auth header.
As for getting the credentials, use the /v2/login API, which can be implemented under the hood as a Get, and put a convenience method on SnapdClient called login<'a>(&self) -> AuthorizedClient<'a> {} which creates the client with an owned macaroon.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels