pub struct AccountService<'a> {
pub database: &'a Arc<Database>,
pub audit: &'a Auditor,
pub profile: &'a Profile,
}Expand description
The account-side operations of one endpoint — the
OrderService shape.
Fields§
§database: &'a Arc<Database>§audit: &'a Auditor§profile: &'a ProfileImplementations§
Source§impl AccountService<'_>
impl AccountService<'_>
Sourcepub async fn new_account(
&self,
payload: NewAccountPayload,
header: &ProtectedHeader,
pubkey: &[u8],
client_ip: Option<IpAddr>,
request: &RequestContext,
) -> Result<(Account, bool), Error>
pub async fn new_account( &self, payload: NewAccountPayload, header: &ProtectedHeader, pubkey: &[u8], client_ip: Option<IpAddr>, request: &RequestContext, ) -> Result<(Account, bool), Error>
newAccount (RFC 8555 §7.3): finds the account pubkey holds at this
endpoint, or creates one. The bool is whether it was created — 201
against 200 at the edge.
onlyReturnExisting (§7.3.1) looks up and never creates. A refusal to
agree to configured terms is Error::TermsNotAgreed, since the
response it owes carries a Link a problem document cannot.
Sourcepub async fn update(
&self,
id: &str,
payload: UpdateAccountPayload,
pubkey: &[u8],
client_ip: Option<IpAddr>,
) -> Result<Account, Error>
pub async fn update( &self, id: &str, payload: UpdateAccountPayload, pubkey: &[u8], client_ip: Option<IpAddr>, ) -> Result<Account, Error>
POST /acct/{id} (RFC 8555 §7.3.2, §7.3.6): replaces the contact list, or
deactivates the account, for a request signed by the account’s own key.
Sourcepub async fn key_change(
&self,
cached: Option<Account>,
old_pubkey: &[u8],
header: &ProtectedHeader,
inner_jws: &KeyChangeJws,
) -> Result<Account, Error>
pub async fn key_change( &self, cached: Option<Account>, old_pubkey: &[u8], header: &ProtectedHeader, inner_jws: &KeyChangeJws, ) -> Result<Account, Error>
keyChange (RFC 8555 §7.3.5): moves the signer’s account onto the key the
nested JWS proves possession of.
A new key already held by another account is
Error::KeyChangeConflict, carrying the holder so the edge can answer
with its Location.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AccountService<'a>
impl<'a> !UnwindSafe for AccountService<'a>
impl<'a> Freeze for AccountService<'a>
impl<'a> Send for AccountService<'a>
impl<'a> Sync for AccountService<'a>
impl<'a> Unpin for AccountService<'a>
impl<'a> UnsafeUnpin for AccountService<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more