Masked email: Fastmail's Masked Email API, MaskedEmail/get and /set (ME-1, ME-7a, ME-16)

Advertised as https://www.fastmail.com/dev/maskedemail in the session and on
every account that may hold masks. Masks created through it start pending
unless the create sets a state; pending can't be set again once left; state
and the other mutable fields map onto the same records the x: API uses.
This commit is contained in:
2026-09-18 16:29:47 -07:00
parent 7080028437
commit d04aafd3d7
16 changed files with 626 additions and 5 deletions
+12 -1
View File
@@ -69,6 +69,8 @@ impl JmapAuthorization for AccessToken {
GetRequestMethod::PushSubscription(_) => Permission::JmapPushSubscriptionGet,
GetRequestMethod::Sieve(_) => Permission::JmapSieveScriptGet,
GetRequestMethod::VacationResponse(_) => Permission::JmapVacationResponseGet,
// inbuxa: Fastmail's MaskedEmail (ME-18)
GetRequestMethod::MaskedEmail(_) => Permission::SysMaskedEmailGet,
GetRequestMethod::Principal(_) => Permission::JmapPrincipalGet,
GetRequestMethod::Quota(_) => Permission::JmapQuotaGet,
GetRequestMethod::Blob(_) => Permission::JmapBlobGet,
@@ -141,6 +143,14 @@ impl JmapAuthorization for AccessToken {
Permission::JmapSieveScriptUpdate,
Permission::JmapSieveScriptDestroy,
),
// inbuxa: Fastmail's MaskedEmail (ME-18)
SetRequestMethod::MaskedEmail(s) => validate_set(
s,
self,
Permission::SysMaskedEmailCreate,
Permission::SysMaskedEmailUpdate,
Permission::SysMaskedEmailDestroy,
),
SetRequestMethod::VacationResponse(s) => validate_set(
s,
self,
@@ -247,7 +257,8 @@ impl JmapAuthorization for AccessToken {
| MethodObject::PushSubscription
| MethodObject::SearchSnippet
| MethodObject::VacationResponse
| MethodObject::SieveScript => Permission::JmapEmailChanges,
| MethodObject::SieveScript
| MethodObject::MaskedEmail => Permission::JmapEmailChanges,
// inbuxa: x:MaskedEmail/changes reads what /get reads
MethodObject::Registry(object_type) => object_type.get_permission(),
},