From d28b0e10dd949715f81e196c7a1dc283ffe5373a Mon Sep 17 00:00:00 2001 From: "pr-automation-bot-public[bot]" Date: Tue, 24 Nov 2026 09:10:52 +0000 Subject: [PATCH] chore: sync II spec to dfinity/internet-identity release-2026-11-19 --- .sources/VERSIONS | 2 +- .sources/internetidentity | 2 +- public/references/internet-identity.did | 304 +++++++++++++++++++++++- 3 files changed, 293 insertions(+), 15 deletions(-) diff --git a/.sources/VERSIONS b/.sources/VERSIONS index b3754a04..10a931e2 100644 --- a/.sources/VERSIONS +++ b/.sources/VERSIONS @@ -39,4 +39,4 @@ # ------------------------------------------------------- motoko v1.16.1 01aee06 -internetidentity release-2026-11-06 6eda54fa +internetidentity release-2026-11-19 f24a052d diff --git a/.sources/internetidentity b/.sources/internetidentity index 6eda54fa..f24a052d 160000 --- a/.sources/internetidentity +++ b/.sources/internetidentity @@ -1 +1 @@ -Subproject commit 6eda54fadafa1d4c2e05522f84fed03705459e76 +Subproject commit f24a052d37fc2963c10bd6a763c363ec8b74c29a diff --git a/public/references/internet-identity.did b/public/references/internet-identity.did index a0ecb3d0..2b1818b1 100644 --- a/public/references/internet-identity.did +++ b/public/references/internet-identity.did @@ -337,10 +337,10 @@ type InternetIdentityInit = record { // stored value across an upgrade, `opt null` clears it, `opt opt c` // sets it to `c`. dnssec_config : opt opt DnssecConfig; - // DoH (DNS-over-HTTPS) fallback configuration. Allowlists the - // domains for which the canister may fetch DKIM/DMARC TXT records - // via HTTP outcalls when no DNSSEC chain is available — see - // `docs/ongoing/email-recovery.md` §7.6. Same set/clear pattern. + // DoH (DNS-over-HTTPS) configuration. While set, the canister fetches + // DKIM/DMARC TXT records via HTTP outcalls for any email domain when no + // DNSSEC chain is available; while unset, it doesn't. Same set/clear + // pattern. doh_config : opt opt DohConfig; // URL of the official MCP connector the deployment ships, if any. Same // set/clear pattern as `dnssec_config`: null keeps the previously stored @@ -372,14 +372,15 @@ type DnssecRootAnchor = record { digest : blob; }; -// DoH (DNS-over-HTTPS) fallback configuration. +// DoH (DNS-over-HTTPS) configuration. // -// The canister will only fetch DKIM/DMARC TXT records via HTTP outcalls -// for an FQDN whose registered domain is in `allowed_domains`. Cache -// entries are populated on demand and re-used until `max_cache_age_secs` -// elapses (default 3600s when null, capped at 24h). +// Lookups for a registered domain in `reserved_domains` (matched +// case-insensitively) draw from an outcall budget of their own, so lookups +// for other domains can never use up the capacity these domains rely on. +// Null reserves no domain. Cache entries are populated on demand and re-used +// until `max_cache_age_secs` elapses (default 3600s when null). type DohConfig = record { - allowed_domains : vec text; + reserved_domains : opt vec text; max_cache_age_secs : opt nat64; }; @@ -747,7 +748,6 @@ type EmailChallengeError = variant { Unauthorized : principal; NonceUnknown; NonceExpired; - DomainNotAllowlisted : text; DohFetchFailed : DohFailureReason; DomainNotSupported : text; EmailVerificationFailed : text; @@ -2081,6 +2081,148 @@ type GetWebPushSubscriptionStatusRequest = record { // still live from one another identity's re-subscribe left behind. type WebPushSubscriptionStatus = record { endpoint : text; // compared against the one the browser holds + // Null where the notification of every push posted through it has been removed since. + unanswered_pushes : opt UnansweredPushes; + // When the push service last accepted Internet Identity's own notification, sent + // through it to check it. Null once a notification pushed through it has been + // removed since: that is the answer. + probe_sent_at_ns : opt Timestamp; +}; + +// Pushes posted through one subscription whose notifications nothing has removed since. +type UnansweredPushes = record { + count : nat32; + first_sent_at_ns : Timestamp; + // At least 3 of them, the first sent at least an hour ago: worth a probe. + is_past_limit : bool; +}; + +// A way this identity's notifications reach the calling browser's device. +type NotificationPath = variant { + // Where this browser's wake-ups go: its own subscription, or the ICP Alerts app it + // routes through. + ThisBrowser; + // That app's installed web apps on the entries linked to this browser entry as sharing + // its device, that deliver for one account. An installed app that shares this browser + // entry itself checks its own path, and is not on this one. + InstalledApps : InstalledAppsPath; +}; + +type InstalledAppsPath = record { + origin : FrontendHostname; + // The account at that app whose installed web apps these are. + account_principal : principal; +}; + +type GetNotificationPathStatusRequest = record { + anchor_number : UserNumber; + path : NotificationPath; +}; + +type NotificationPathStatus = record { + // One per subscription on the path that can deliver now. Empty where none can. + subscriptions : vec SubscriptionDeliveryStatus; +}; + +type SubscriptionDeliveryStatus = record { + // Null where the notification of every push posted through it has been removed since. + unanswered_pushes : opt UnansweredPushes; + // When the push service last accepted Internet Identity's own notification, sent + // through it to check it. Null once a notification pushed through it has been + // removed since: that is the answer. + probe_sent_at_ns : opt Timestamp; + // Whether that probe, unanswered, has been out 10 seconds by the canister's clock, the + // least time it is given to be answered before remove_unanswered_pwa_webpush_subscriptions + // removes its subscription. False where no probe is outstanding. + has_probe_had_its_answer_time : bool; +}; + +type GetNotificationPathStatusError = variant { + // The caller signs with no key this identity is signed in from. + InvalidBrowserKey; + InternalCanisterError : text; +}; + +type ProbeNotificationPathRequest = record { + anchor_number : UserNumber; + path : NotificationPath; +}; + +type ProbeNotificationPathError = variant { + // The caller signs with no key this identity is signed in from. + InvalidBrowserKey; + // Nothing on the path can be woken now. + NotReachable; + InternalCanisterError : text; +}; + +type RemoveUnansweredPwaWebPushSubscriptionsRequest = record { + anchor_number : UserNumber; + origin : FrontendHostname; + // The account at that app whose installed web apps to remove. + account_principal : principal; +}; + +type RemoveUnansweredPwaWebPushSubscriptionsError = variant { + // The caller signs with no key this identity is signed in from. + InvalidBrowserKey; + InternalCanisterError : text; +}; + +// Whether the calling installed web app's browser entry shares its device with another +// way this identity is notified. NoOtherPath wherever the identity has not allowed the +// app to notify it. +type SameDeviceLinkStatus = variant { + // This entry is already linked to another entry of the identity. + Linked; + // Another signed-in entry of the identity may deliver this app's notifications: + // through ICP Alerts it has switched on, or through its own subscription. + OtherPathMayDeliver; + NoOtherPath; +}; + +type AppGetSameDeviceLinkStatusError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + InternalCanisterError : text; +}; + +type AppPrepareSameDeviceLinkRequest = record { + // A one-shot P-256 public key, DER-encoded SPKI as WebCrypto exports it. Accepted by + // claim_same_device_link for 30 minutes. + link_public_key : blob; +}; + +type AppPrepareSameDeviceLinkError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + InternalCanisterError : text; +}; + +type ClaimSameDeviceLinkRequest = record { + anchor_number : UserNumber; + link_public_key : blob; + // By the one-shot key, over "ii-same-device-link", anchor_number as 8 big-endian + // bytes, the length of the caller's principal as one byte, and that principal. + signature : blob; +}; + +type ClaimSameDeviceLinkError = variant { + // The caller signs with no key this identity is signed in from. + InvalidBrowserKey; + // No other entry of this identity awaits that key, or its 30 minutes are up. + NoPendingLink; + // Also what the text names when an entry is already linked, the caller holds an + // installed web app of its own, or the signature is not that key's over this claim. + InternalCanisterError : text; +}; + +type AppProbePwaWebPushSubscriptionError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + // The session's installed web app has no subscription that can be woken now. + NotReachable; + InternalCanisterError : text; }; // ===== Notifications sent by an app ===== @@ -2276,6 +2418,94 @@ type RemoveNotificationError = variant { InternalCanisterError : text; }; +// ===== Notifications to an app's own installed web app ===== + +type AppPreparePwaWebPushSubscriptionError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + // The identity has not allowed this app to notify it. + NotificationsNotAllowed; + InternalCanisterError : text; +}; + +// What an installed web app's page registers. Null removes the subscription held for the +// calling session's browser and account. +type AppSetPwaWebPushSubscriptionRequest = record { + subscription : opt PwaWebPushSubscription; +}; + +// The fields and encodings of SetWebPushSubscriptionRequest, with sealed_auth encrypted +// to the transport key app_prepare_pwa_webpush_subscription answered. +type PwaWebPushSubscription = record { + endpoint : text; + p256dh : blob; // 65 bytes + transport_key : blob; // 65 bytes + sealed_auth : blob; // 32 bytes +}; + +type AppSetPwaWebPushSubscriptionError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + // The identity has not allowed this app to notify it. + NotificationsNotAllowed; + // Nothing here can open sealed_auth: the transport key it was encrypted to has + // expired, or a later prepare replaced it. Prepare again and re-send. + TransportKeyExpired; + // Another subscription holds this endpoint with other keys or for another app. + // Subscribe again for a fresh endpoint and re-send. + EndpointInUse; + InternalCanisterError : text; +}; + +type AppGetPwaWebPushSubscriptionStatusError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + InternalCanisterError : text; +}; + +type AppGetPwaNotificationRequest = record { + // As the wake-up that announced it named it. + inbox_notification_id : InboxNotificationId; +}; + +// Both null where the named entry is gone, or is not this app's for this session. +type AppGetPwaNotificationResponse = record { + notification : opt PwaNotification; + // Set where Internet Identity sent this itself, and what it has to say. + event : opt PwaNotificationEvent; +}; + +// Something Internet Identity tells an installed web app's user. +type PwaNotificationEvent = variant { + // This installed web app receives notifications. + NotificationsOn; +}; + +// Which notification to fetch the content of, and from which canister. +type PwaNotification = record { + canister_id : principal; + id : NotificationId; +}; + +type AppGetPwaNotificationError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + InternalCanisterError : text; +}; + +type AppRemovePwaNotificationRequest = record { + // As the wake-up that announced it named it. + inbox_notification_id : InboxNotificationId; + // Why the worker could not show it. Absent where it did. + not_shown : opt NotShownReason; +}; + +type AppRemovePwaNotificationError = variant { + // No live session behind this caller: expired, idle, revoked, or never one at all. + NoSuchSession; + InternalCanisterError : text; +}; + service : (opt InternetIdentityInit) -> { // Legacy identity management API // ============================== @@ -2791,8 +3021,9 @@ service : (opt InternetIdentityInit) -> { // An update call, because a query reply is signed by one replica. One that answered // with a VAPID key of its own choosing would bind the subscription to it permanently, // and the browser has nothing to check the answer against. - // A cold randomness pool yields the `Pending` result arm — a retry signal, not an - // error: asking put the draw in flight, so the caller re-calls the method. + // Pending: II is fetching its VAPID key, or has no fresh randomness to make the + // transport key. Asking puts what is missing in flight, so call again shortly. Once a + // fetch of the VAPID key has failed, this answers InternalCanisterError with the reason. prepare_webpush_subscription : (UserNumber) -> (variant { Ok : PrepareWebPushSubscriptionResponse; Pending; Err : PrepareWebPushSubscriptionError }); // Called by the browser, or by the Home Screen app it points at: what the app // registers belongs to its own record, which every identity pointing at it is @@ -2832,6 +3063,22 @@ service : (opt InternetIdentityInit) -> { enable_notification_app : (EnableNotificationAppRequest) -> (variant { Ok : NotificationId; Err : EnableNotificationAppError }); disable_notification_app : (DisableNotificationAppRequest) -> (variant { Ok; Err : DisableNotificationAppError }); + // Called by the browser that the installed web app's link names. Links the entry + // that registered the key to the caller's: an app's notification skips the caller's + // entry while that entry's installed web app can deliver it. + claim_same_device_link : (ClaimSameDeviceLinkRequest) -> (variant { Ok; Err : ClaimSameDeviceLinkError }); + + // Called by the browser. The path's subscriptions and their unanswered pushes. + get_notification_path_status : (GetNotificationPathStatusRequest) -> (variant { Ok : NotificationPathStatus; Err : GetNotificationPathStatusError }) query; + // Sends Internet Identity's own notification through every subscription on the path + // that can deliver now. Removing a notification pushed through one resets its + // unanswered pushes. + probe_notification_path : (ProbeNotificationPathRequest) -> (variant { Ok; Err : ProbeNotificationPathError }); + // Removes that app's installed web app subscriptions on the entries linked to the + // caller's that can deliver now and have a probe nobody removed in the 10 seconds + // after the push service accepted it. + remove_unanswered_pwa_webpush_subscriptions : (RemoveUnansweredPwaWebPushSubscriptionsRequest) -> (variant { Ok; Err : RemoveUnansweredPwaWebPushSubscriptionsError }); + // Called by the browser, which watches for the answer leaving its own queue: that // is what says the app this browser points at is still installed. probe_notification_app : (ProbeNotificationAppRequest) -> (variant { Ok : NotificationId; Err : ProbeNotificationAppError }); @@ -2840,4 +3087,35 @@ service : (opt InternetIdentityInit) -> { // Called by an app's frontend, as its session. app_notification_consent_status : () -> (variant { Ok : AppNotificationConsentStatusResponse; Err : AppNotificationConsentStatusError }) query; app_revoke_notification_consent : () -> (variant { Ok; Err : AppRevokeNotificationConsentError }); + + // Called by an app's installed web app, signed by its session. The identity, browser + // and account are the session's. + // + // Returns II's VAPID public key, which the app passes to PushManager.subscribe, and a + // new one-time transport public key. The app encrypts the subscription's auth secret + // to that key and sends it with app_set_pwa_webpush_subscription within 5 minutes. + // It replaces this browser's existing subscription, if any, so the installed web app + // gets no pushes until app_set_pwa_webpush_subscription succeeds. + // Pending: II is fetching its VAPID key, or has no fresh randomness to make the + // transport key. Call again shortly. Once a fetch of the VAPID key has failed, this + // answers InternalCanisterError with the reason. + app_prepare_pwa_webpush_subscription : () -> (variant { Ok : PrepareWebPushSubscriptionResponse; Pending; Err : AppPreparePwaWebPushSubscriptionError }); + // Sets or, with null, removes the subscription of the session's browser and account. + app_set_pwa_webpush_subscription : (AppSetPwaWebPushSubscriptionRequest) -> (variant { Ok; Err : AppSetPwaWebPushSubscriptionError }); + // The endpoint the session's browser and account are subscribed at. Null where nothing + // is subscribed, where the subscription awaits its app_set_pwa_webpush_subscription, or + // where it delivers for another account. + app_get_pwa_webpush_subscription_status : () -> (variant { Ok : opt WebPushSubscriptionStatus; Err : AppGetPwaWebPushSubscriptionStatusError }) query; + // Sends Internet Identity's own notification to the session's installed web app. + // Removing it with app_remove_pwa_notification resets its unanswered pushes. + app_probe_pwa_webpush_subscription : () -> (variant { Ok; Err : AppProbePwaWebPushSubscriptionError }); + app_get_same_device_link_status : () -> (variant { Ok : SameDeviceLinkStatus; Err : AppGetSameDeviceLinkStatusError }) query; + // Registers a one-shot key for this entry, replacing any earlier one. Another entry of + // the identity on the same device proves it with claim_same_device_link. + app_prepare_same_device_link : (AppPrepareSameDeviceLinkRequest) -> (variant { Ok; Err : AppPrepareSameDeviceLinkError }); + // The notification a wake-up named, where it is this app's for the session's browser + // and account. + app_get_pwa_notification : (AppGetPwaNotificationRequest) -> (variant { Ok : AppGetPwaNotificationResponse; Err : AppGetPwaNotificationError }) query; + // Removes the notification a wake-up named once the worker has handled it. + app_remove_pwa_notification : (AppRemovePwaNotificationRequest) -> (variant { Ok : RemoveNotificationResponse; Err : AppRemovePwaNotificationError }); };