aws / aws/amazon-q-developer-cli

bug: Headless login fails on Mac

Aperta
#948 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

MacOsx (Sequoia)

### Expected behaviour

`q login` should work on a headless SSH session

### Actual behaviour

When trying to login with `q login` using a headless SSH session to my Mac - it fails on the OIDC call to `CreateToken` - I traced this back through the code-path and found that the `device_registration` is not persisting properly to the `secret_store`, when this [line](https://github.com/aws/amazon-q-developer-cli/blob/0497da7b6443481f2a1de28a132e94b4ed20b4e4/crates/fig_auth/src/builder_id.rs#L198) runs, an error is thrown :

```
SecKeychainItemModifyContent: User interaction is not allowed
```

As a result, the polling call for create-token creates a new client-registration - which obviously results in a `client_id` / `client_secret` that doesn't match the original call to `StartDeviceAuthorization` call - and the service errors. This effectively means I can't login to Q in headless mode.

### Steps to reproduce

(On Mac)
1. `ssh localhost`
2. `q login`

### Environment

```yaml

```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in crates/fig_auth/src/builder_id.rs intorno alla riga 198 e ispeziona come device_registration viene persistito in secret_store durante `q login`. Riproduci il problema con `ssh localhost` seguito da `q login`; il lavoro è completato quando il login headless su Mac termina senza l'errore `SecKeychainItemModifyContent` e la richiesta di polling utilizza la registrazione del dispositivo originale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
macos, rust
Ambito
authentication, cli
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.