feat(login): el login va por @faable/auth-sdk e identifica al CLI como faable-cli - #8
Merged
Merged
Conversation
…o faable-cli `src/api/auth.ts` era un axios a pelo contra faable.auth.faable.link, así que todo el login del CLI (device code, token, refresh, /me) llegaba a auth como «not identified». Ahora son dos `FaableAuthApi`: uno anónimo para el device flow y el refresh (POST, que el fetcher no reintenta — cada `authorization_pending` es un error esperado) y otro con `authBearer` para `/me` y `faable auth`, con el getter de `loadLiveCredentials`. Ambos mandan `x-faable-client: faable-cli/<version>` y ningún `x-faable-instance`, que en un portátil sería el hostname del usuario en nuestro log de auditoría. `session.ts` sigue leyendo `user_suspended` de `response.data`.
boyander
marked this pull request as ready for review
September 15, 2026 15:35
|
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Borrador hasta que
@faable/auth-sdk2.6.0 esté en npm (authBearery el fix de precedencia declientInfo.client); entoncesnpm installpara refrescar el lockfile — hoy apunta a^2.6.0ynpm cifallará.Qué cambia
src/api/auth.ts: dosFaableAuthApi— anónimo (device code,/oauth/token, refresh; POST, sin reintentos) yauthBearer(/me, yfaable authvíaauth_admin.ts, con el getter deloadLiveCredentials).clientInfo: { client: 'faable-cli/<version>', instance: '' }: identificado como el CLI y sinx-faable-instance(sería el hostname del usuario).session.ts: la detección deuser_suspendedleeresponse.dataigual que antes; solo cambia el tipo del catch.Verificación
src/api/auth.test.ts(adapter, sin red): cabecerafaable-cli/<version>dentro del tope de 32, sinx-faable-instance, bearer +x-faableauth-account, y unauthorization_pendingconserva el cuerpo OAuth y no se reintenta.tsclimpio.Tras desplegar: la fila del CLI en la sección SDKs del tenant faable debe resolver a su app; si dice «No application identified», el UUID a fuego (
c879023b-…) no es elclient_iddeclient_69d68dc6ce7927172854acf2.