credential broker: Play tokens from POST /api/google/token (cached, single flight, local key fallback), grants and APIs per package in validate, Play write preflight, apps check and the desktop Accounts view; Google 403 names the API or grant, no retry

This commit is contained in:
CRTkafa 2026-10-25 22:50:52 +07:00
parent 304407e523
commit 2c5e30090f
27 changed files with 1145 additions and 43 deletions

View file

@ -92,6 +92,7 @@ function AccountRow({ a, busy, setBusy, onError }: { a: Account; busy: string |
{used ? ` · ${t('acct.folders', { count: used })}` : ''}
{a.kind === 'play' && (a.developerId ? <> · <span className="mono-id selectable" title={t('acct.devIdHint')}>{t('acct.devId', { id: a.developerId })}</span></> : <> · <span title={t('acct.devIdHint')}>{t('acct.noDevId')}</span></>)}
{check?.principal ? <> · <span className="mono-id selectable">{check.principal}</span></> : null}
{a.kind === 'play' && check?.source ? ` · ${check.source === 'broker' ? t('acct.viaBroker') : t('acct.viaFile')}` : ''}
</div>
</div>
<div className="actions">
@ -122,6 +123,22 @@ function AccountRow({ a, busy, setBusy, onError }: { a: Account; busy: string |
</Notice>
</div>
)}
{check?.grants && check.grants.length > 0 && (
<div className="acct-fix acct-grants">
<div className="small strong">{t('acct.grantsTitle')}</div>
<ul className="small">
{check.grants.map(g => (
<li key={g.packageName}>
<span className="mono-id selectable">{g.packageName}</span>{': '}
{!g.registered ? <span className="muted">{t('acct.notRegistered')}</span>
: g.missing.length ? <Chip tone="warn">{t('acct.grantsMissing', { list: g.missing.join(', ') })}</Chip>
: g.grants ? <Chip tone="ok">{t('acct.grantsOk')}</Chip> : <span className="muted">{t('acct.grantsNone')}</span>}
{g.grants && g.grants.length > 0 && <span className="muted mono-id" title={(g.enabledApis ?? []).join(', ')}>{` ${g.grants.join(', ')}`}</span>}
</li>
))}
</ul>
</div>
)}
{h?.error && <div className="acct-fix"><Notice tone="bad">{h.error}</Notice></div>}
</div>
);