servo/components/net
arthmis aa40b8f820
Prompt user for credentials when http request needs it (#34620)
* prompt user to get their credentials

Signed-off-by: Lloyd Massiah artmis9@protonmail.com

move credential prompt to a function

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* add prompt for step 15.4

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* add new prompt definition for user credentials

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* remove default implementation for HttpState which allowed making the embedder_proxy non-optional

- default implementation was only used in tests so created an alternative create_http_state function

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

add credentials to authentication cache

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* add tests that are successful for the happy path

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* add test for user cancels prompt and user inputs incorrect credentials, and refactor shared code between tests

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* handle error when setting username and password in Url and ran formatting

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

renaming test functions

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* change authentication flag to false for proxy authentication. The spec doesn't specify that the flag should be true, and the flag is by default false

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* clean up test code a bit

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* add skeleton implementation to support open harmony and android

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* update warning message to include Android

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* fix build error for OH os and Android

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

* remove unused import to fix warning

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>

---------

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>
Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
2024-12-28 20:24:11 +00:00
..
fetch Optimize mutex usage in fetch by locking once and using scoped MutexGuard (#34737) 2024-12-22 11:14:57 +00:00
protocols Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
tests Prompt user for credentials when http request needs it (#34620) 2024-12-28 20:24:11 +00:00
async_runtime.rs Add prefs to limit threadpool sizes (#34478) 2024-12-07 05:25:17 +00:00
Cargo.toml Remove some unused dependencies (#34355) 2024-11-25 10:29:58 +00:00
connector.rs Net: fold websocket and http tokio runtime into one (#31771) 2024-03-21 06:13:03 +00:00
cookie.rs Fix handling of __Secure- and __Host- Cookie prefixes (#33717) 2024-10-09 04:52:48 +00:00
cookie_storage.rs net: Stop using both versions of the time crate in the cookie code (#33260) 2024-08-30 17:15:47 +00:00
decoder.rs net: Refactor Decoder (#33611) 2024-10-02 16:59:31 +00:00
filemanager_thread.rs Stop using time@0.1 in Servo (#33394) 2024-09-11 07:09:56 +00:00
hosts.rs Replace the lazy_static crate with std::sync::LazyLock in components/net (#33046) 2024-08-14 12:15:55 +00:00
hsts.rs doc(resources): Preferences, HstsPreloadList, RippyPNG (#33775) 2024-10-10 18:19:41 +00:00
http_cache.rs Fork Stylo's malloc_size_of into Servo (#34332) 2024-11-22 14:57:55 +00:00
http_loader.rs Prompt user for credentials when http request needs it (#34620) 2024-12-28 20:24:11 +00:00
image_cache.rs build: upgrade rustc to 1.81.0 (#34270) 2024-12-12 07:26:16 +00:00
lib.rs net: Refactor Decoder (#33611) 2024-10-02 16:59:31 +00:00
local_directory_listing.rs clippy: Fix a bunch of warnings in script (#32680) 2024-07-04 11:40:23 +00:00
mime_classifier.rs clippy: Fix a bunch of warnings in script (#32680) 2024-07-04 11:40:23 +00:00
resource_thread.rs Prompt user for credentials when http request needs it (#34620) 2024-12-28 20:24:11 +00:00
storage_thread.rs build: upgrade rustc to 1.81.0 (#34270) 2024-12-12 07:26:16 +00:00
subresource_integrity.rs clippy: Fix warnings in components/net (#31626) 2024-03-13 09:40:04 +00:00
websocket_loader.rs websocket: Revert use of h2 in websocket ALPN. (#34634) 2024-12-16 06:47:33 +00:00