italia / eudi-wallet-it-python

Python toolchain for building an OpenID4VP RP with a SATOSA backend compliant with the Italian Wallet implementation profile
Apache License 2.0
16 stars 8 forks source link

`./tests/satosa/test_backend.py:223`: # TODO: this test case must implement the backend requests in the correct order and with the correct nonce and state #146

Closed salvatorelaiso closed 7 months ago

salvatorelaiso commented 8 months ago

Il test test_redirect_endpoint invoca il metodo redirect_endpoint passando, all'interno del context, il request URI inizializzato come segue:

https://github.com/italia/eudi-wallet-it-python/blob/799138cba228eb9aee10372c6f1944670f399999/pyeudiw/tests/satosa/test_backend.py#L207

prendendo dal settings.py:

https://github.com/italia/eudi-wallet-it-python/blob/799138cba228eb9aee10372c6f1944670f399999/pyeudiw/tests/settings.py#L298-L300 Il valore corrisponde a https://example.com/OpenID4VP/redirect-uri .

Il backend, nella funzione oggetto del test, trasforma questo valore mettendo come prefisso l'URL del server:

https://github.com/italia/eudi-wallet-it-python/blob/799138cba228eb9aee10372c6f1944670f399999/pyeudiw/satosa/backend.py#L354

ottenendo così un endpoint errato https://example.comhttps://example.com/OpenID4VP/redirect-uri (con status di ritorno 400, "request_uri not valid").

Come sistemiamo, eliminando la riga 354 all'interno del backend oppure modificando il file settings.py, @peppelinux?

peppelinux commented 8 months ago

il construttore del satosa backend costruisce gli url, pertanto agirei sul settings riproducendo il medesimo approccio che abbiamo nella configurazione yml