@aglyn/aglyn 1.0.0-beta.160 → 1.0.0-beta.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1517,6 +1517,34 @@ export declare const SIGNUP_CANARY_ORG_SLUG_PREFIX = "signup-canary-";
1517
1517
  * number looks wrong.
1518
1518
  */
1519
1519
  export declare function isSignupCanaryOrgSlug(slug: string | null | undefined): boolean;
1520
+ /**
1521
+ * The plus tag every canary address carries.
1522
+ *
1523
+ * Identity Platform will not reuse an address, so the walk stamps a fresh one
1524
+ * per run by appending to the LOCAL PART of `SIGNUP_CANARY_EMAIL`:
1525
+ * `name+signup-canary@example.com` becomes
1526
+ * `name+signup-canary-m2rso9ab12@example.com`, which still reaches the same
1527
+ * mailbox. The tag is therefore the only part of a canary account that the
1528
+ * console can recognize at the moment it first sees one — there is no org yet,
1529
+ * no claim, and nothing on the token that says CI.
1530
+ *
1531
+ * The address is operator-supplied, so this is a convention rather than a
1532
+ * fact, and `tools/e2e/signup-canary.mjs` is what makes it one: it refuses to
1533
+ * start on a base address whose tag is not this. Held together by
1534
+ * `apps/console/specs/signup-canary-marker-wiring.spec.ts`, exactly as the
1535
+ * slug prefix above is.
1536
+ */
1537
+ export declare const SIGNUP_CANARY_EMAIL_TAG = "signup-canary";
1538
+ /**
1539
+ * Is this sign-up the canary's own?
1540
+ *
1541
+ * The cost mirrors the slug prefix's: a stranger who signs up as
1542
+ * `them+signup-canary@example.com` goes unannounced. That is bounded to the
1543
+ * one address, it cannot hide anything staff need — the account still exists,
1544
+ * still appears in the admin user list, and still bills — and it is the price
1545
+ * of a check that needs no secret and no second code path.
1546
+ */
1547
+ export declare function isSignupCanaryEmail(email: string | null | undefined): boolean;
1520
1548
  /**
1521
1549
  * How old the last walk may be before the check goes red.
1522
1550
  *
@@ -1806,6 +1806,42 @@ export async function writeCronBeat(store, jobId, now = Date.now()) {
1806
1806
  */ export function isSignupCanaryOrgSlug(slug) {
1807
1807
  return typeof slug === 'string' && slug.startsWith(SIGNUP_CANARY_ORG_SLUG_PREFIX);
1808
1808
  }
1809
+ /**
1810
+ * The plus tag every canary address carries.
1811
+ *
1812
+ * Identity Platform will not reuse an address, so the walk stamps a fresh one
1813
+ * per run by appending to the LOCAL PART of `SIGNUP_CANARY_EMAIL`:
1814
+ * `name+signup-canary@example.com` becomes
1815
+ * `name+signup-canary-m2rso9ab12@example.com`, which still reaches the same
1816
+ * mailbox. The tag is therefore the only part of a canary account that the
1817
+ * console can recognize at the moment it first sees one — there is no org yet,
1818
+ * no claim, and nothing on the token that says CI.
1819
+ *
1820
+ * The address is operator-supplied, so this is a convention rather than a
1821
+ * fact, and `tools/e2e/signup-canary.mjs` is what makes it one: it refuses to
1822
+ * start on a base address whose tag is not this. Held together by
1823
+ * `apps/console/specs/signup-canary-marker-wiring.spec.ts`, exactly as the
1824
+ * slug prefix above is.
1825
+ */ export const SIGNUP_CANARY_EMAIL_TAG = 'signup-canary';
1826
+ /**
1827
+ * Is this sign-up the canary's own?
1828
+ *
1829
+ * The cost mirrors the slug prefix's: a stranger who signs up as
1830
+ * `them+signup-canary@example.com` goes unannounced. That is bounded to the
1831
+ * one address, it cannot hide anything staff need — the account still exists,
1832
+ * still appears in the admin user list, and still bills — and it is the price
1833
+ * of a check that needs no secret and no second code path.
1834
+ */ export function isSignupCanaryEmail(email) {
1835
+ var _email_toLowerCase_split_;
1836
+ if (typeof email !== 'string') return false;
1837
+ const local = (_email_toLowerCase_split_ = email.toLowerCase().split('@')[0]) != null ? _email_toLowerCase_split_ : '';
1838
+ const plus = local.indexOf('+');
1839
+ if (plus < 0) return false;
1840
+ // `startsWith`, not equality: the walk's own address is the base tag plus a
1841
+ // stamp, and the base address itself must match too — a human reading the
1842
+ // mailbox should not find the two classified differently.
1843
+ return local.slice(plus + 1).startsWith(SIGNUP_CANARY_EMAIL_TAG);
1844
+ }
1809
1845
  /**
1810
1846
  * How old the last walk may be before the check goes red.
1811
1847
  *