Repository navigation
Security round 1 and plan limits - #52
Draft
iman-nebulr wants to merge 3 commits into
Draft
iman-nebulr wants to merge 3 commits into
iman-nebulr wants to merge 3 commits into
Conversation
QuotaGate, Entitled and useEntitlements are back with 0.9's names, props and behaviour, built on auth-core's quota store and entitlements (the flag bridge:billing.entitlement.<key>, never the plan). - useQuota reads auth-core's quota snapshots and follows billing.quota_updated / access_changed: loading, unlimited, used, limit, remaining, warningLevel, kind and snapshot, plus ratio and state. It always returns an object. - QuotaBanner shows approaching, critical, reached, over and a metered limit's overage, with 0.9's copy; BridgeQuotaBanner and BridgeUpgradeDialog are aliases. - BillingNotice follows the billing lock (every role, and at once on a 402 BILLING_GATE_ENGAGED through bridgeFetch); mode="hard" is 0.9's lockscreen. useBillingGate / useBillingLocked. - onBridgeQuotaExceeded / parseQuotaRefusal for apps with their own dialog; the upgrade dialog still opens on a 402 QUOTA_EXCEEDED. - Unit tests against the fake issuer, a Playwright spec on the local issuer, docs. No-ticket: public repo, the work is tracked internally Claude-Session: https://claude.ai/code/session_01G1bV8Xv8bNjMNToHyYYCgW
…useBridgeBilling 0.9 exported these; they are exported again so an app written for 0.9 still compiles. - BridgeBillingNotice (and its props type BridgeBillingNoticeProps) is BillingNotice. - dismissQuotaRefusal() closes the upgrade dialog a plan-limit refusal opened, as in 0.9; it is closeUpgrade(). - useBridgeBilling() is the 0.9 billing handle: quota(metric), quotas, entitlements, handle, isLocked(), gateState() and assertNotLocked(). It is not a React hook, always answers, and follows the page's client. It has no `subscription`; useBilling() has the billing facts. No-ticket: public repo Claude-Session: https://claude.ai/code/session_01G1bV8Xv8bNjMNToHyYYCgW
…ed (TBP-909) Raise the auth-core pin from alpha.8 to alpha.11. No version bump or tag: this PR waits for the PR it is stacked on. Refs: TBP-909 Claude-Session: https://claude.ai/code/session_01G1bV8Xv8bNjMNToHyYYCgW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings back the plan limit and plan feature gates of 0.9, on the 1.0 line and auth-core's quota store:
QuotaGate,Entitled,useEntitlements(the flagbridge:billing.entitlement.<key>, never the plan)useQuotawithloading,unlimited,used,limit,remaining,warningLevel,kind,snapshot;QuotaBanner(also asBridgeQuotaBanner); live on quota and access noticesBillingNoticefor every role,mode="hard"lockscreen,useBillingGate, at once on a 402BILLING_GATE_ENGAGEDthroughbridgeFetchonBridgeQuotaExceeded, and the upgrade dialog on a 402QUOTA_EXCEEDEDNeeds the auth-core release with plan limits, entitlements and the billing lock (not published yet). Stacked on the open 1.0 PR (#51), which is why the base is
feat/v1-alpha:v1still holds the 0.9 code.Tested: 68 unit tests, build, typecheck, demo check, publint, docs links; the demo's 54 Playwright specs on the local issuer.
https://claude.ai/code/session_01G1bV8Xv8bNjMNToHyYYCgW