<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mverma4</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mverma4"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mverma4"/>
	<updated>2026-08-12T08:00:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102309</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102309"/>
		<updated>2016-04-26T02:19:33Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Implementation / Design Decisions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we have created the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
''' The Pull Requests for these steps can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Initial_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we created a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We then first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we then display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we open or create a file for each data set we are saving.  After each file is opened or created we serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use is used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs is the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory is opened and deserialized using the serialize rust library. The data is then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
'''The Pull Requests for these steps can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Subsequent_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps and the subsequent steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the Final steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10328 401 authorization UI]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10661 Writing the serialized data in separate files inside the profile directory]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10800 Deserializing the data and populating the appropriate fields]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
We have successfully completed all the steps mentioned in the [https://github.com/servo/servo/wiki/Persistent-sessions-student-project NCSU Student Projects Page]. All the Pull requests have been accepted and merged with the servo master branch. &lt;br /&gt;
&lt;br /&gt;
We have also created a [ Video] explaining our entire project&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102308</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102308"/>
		<updated>2016-04-26T02:18:46Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we have created the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
''' The Pull Requests for these steps can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Initial_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we created a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We then first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we then display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we open or create a file for each data set we are saving.  After each file is opened or created we serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use is used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs is the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory is opened and deserialized using the serialize rust library. The data is then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
'''The Pull Requests for these step can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Subsequent_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps and the subsequent steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the Final steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10328 401 authorization UI]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10661 Writing the serialized data in separate files inside the profile directory]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10800 Deserializing the data and populating the appropriate fields]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
We have successfully completed all the steps mentioned in the [https://github.com/servo/servo/wiki/Persistent-sessions-student-project NCSU Student Projects Page]. All the Pull requests have been accepted and merged with the servo master branch. &lt;br /&gt;
&lt;br /&gt;
We have also created a [ Video] explaining our entire project&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102307</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102307"/>
		<updated>2016-04-26T02:18:17Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we have created the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
''' The Pull Requests for these steps can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Initial_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we created a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We then first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we then display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we open or create a file for each data set we are saving.  After each file is opened or created we serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use is used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs is the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory is opened and deserialized using the serialize rust library. The data is then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
'''The Pull Requests for these step can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Subsequent_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps and the subsequent steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the Final steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10328 401 authorization UI]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10661 Writing the serialized data in separate files inside the profile directory]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10800 Deserializing the data and populating the appropriate fields]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
We have successfully completed all the steps mentioned in the [https://github.com/servo/servo/wiki/Persistent-sessions-student-project Ncsu Student Projects Page]. All the Pull requests have been accepted and merged with the servo master branch. &lt;br /&gt;
&lt;br /&gt;
We have also created a [ Video] explaining our entire project&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102301</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102301"/>
		<updated>2016-04-26T01:57:28Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
''' The Pull Requests for these steps can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Initial_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we created a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We then first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we then display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we open or create a file for each data set we are saving.  After each file is opened or created we serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use is used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs is the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory is opened and deserialized using the serialize rust library. The data is then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
'''The Pull Requests for these step can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Subsequent_Steps_Pull_Requests here]'''&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the Final steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[ Pull1 here  ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Pull2 here]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Pull3 here ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier we have completed the initial steps and they have been fully merged with the servo master branch.  We are in the process of completing the subsequent steps.  One pull request has been made and we are currently adding some changes to it in order to implement the first subsequent step &amp;quot;make an authorization UI appear when a 401 HTTP response is received &amp;quot;.  The pull request can be found [https://github.com/servo/servo/pull/10328 here].  We have also started work on the second step, however, have not made the second pull request yet.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102300</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102300"/>
		<updated>2016-04-26T01:54:52Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
''' The Pull Requests for these steps can be found [ http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Initial_Steps_Pull_Requests here ]'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we created a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We then first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we then display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we open or create a file for each data set we are saving.  After each file is opened or created we serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use is used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs is the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory is opened and deserialized using the serialize rust library. The data is then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
'''The Pull Requests for these step can be found [ http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Subsequent_Steps_Pull_Requests here ]'''&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the Final steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[ Pull1 here  ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Pull2 here]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Pull3 here ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier we have completed the initial steps and they have been fully merged with the servo master branch.  We are in the process of completing the subsequent steps.  One pull request has been made and we are currently adding some changes to it in order to implement the first subsequent step &amp;quot;make an authorization UI appear when a 401 HTTP response is received &amp;quot;.  The pull request can be found [https://github.com/servo/servo/pull/10328 here].  We have also started work on the second step, however, have not made the second pull request yet.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102299</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102299"/>
		<updated>2016-04-26T01:27:16Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we will create a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We will first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we will display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is now successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we will check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we will open or create a file for each data set we are saving.  After each file is opened or created we will serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use will be used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs will be the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we will check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory will be opened and deserialized using the serialize rust library. The data will then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
==='''Initial Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Subsequent Steps Pull Requests'''===&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Pull1 here  ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Pull2 here]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Pull3 here ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
==='''Testing the new command line flag --profile-dir'''===&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
=== '''Unit Test for set authorization header if url does not have credentials''' ===&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
=== '''GUI test for the tinyfiledialogs lib'''===&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier we have completed the initial steps and they have been fully merged with the servo master branch.  We are in the process of completing the subsequent steps.  One pull request has been made and we are currently adding some changes to it in order to implement the first subsequent step &amp;quot;make an authorization UI appear when a 401 HTTP response is received &amp;quot;.  The pull request can be found [https://github.com/servo/servo/pull/10328 here].  We have also started work on the second step, however, have not made the second pull request yet.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102180</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102180"/>
		<updated>2016-04-12T00:17:56Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Implementation / Design Decisions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we will create a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We will first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we will display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is now successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_1 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we will check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we will open or create a file for each data set we are saving.  After each file is opened or created we will serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_2 here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use will be used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs will be the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we will check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory will be opened and deserialized using the serialize rust library. The data will then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#UML_for_step_4 here]&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102179</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102179"/>
		<updated>2016-04-12T00:17:03Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Implementation / Design Decisions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we will create a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We will first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we will display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is now successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope here]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we will check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we will open or create a file for each data set we are saving.  After each file is opened or created we will serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope here]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use will be used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs will be the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we will check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory will be opened and deserialized using the serialize rust library. The data will then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
The UML Diagram for this implementation can be found [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope here]&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102178</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102178"/>
		<updated>2016-04-12T00:14:12Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* UML for step 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we will create a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We will first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we will display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is now successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we will check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we will open or create a file for each data set we are saving.  After each file is opened or created we will serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use will be used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs will be the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we will check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory will be opened and deserialized using the serialize rust library. The data will then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP4.png ]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:STEP4.png&amp;diff=102177</id>
		<title>File:STEP4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:STEP4.png&amp;diff=102177"/>
		<updated>2016-04-12T00:13:21Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=102176</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=102176"/>
		<updated>2016-04-12T00:05:58Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Final Project Design Document */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Active Job]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016/Mozilla Conforming Image Loading to HTML 5 Specs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional Tests for Questionnaire Controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 / Expertiza Self-Review Feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement private browsing]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Write automated tests for WebDriver]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor sign_up_sheet_controller.rb and sign_up_topic.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement Common Parts of the CSSOM API]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional tests for assignment creation function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/E1604. Functional tests for Calibration function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor and write unit tests for question type.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor response controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016_OSS_M1606]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016/OSS_E1601]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 M1602 Make image loads conform with the spec]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 E1624 Compose functional tests for Suggest topics of student functionality ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 E1631 Team-based reviewing]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 E1628 Visualization]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 E1625 Show confidence ratings for grade based on reputations of reviewers]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 E1629 Performance improvement for Course &amp;amp; Assignment Listing]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 M1603 Implement Common Parts of the CSSOM API]]&lt;br /&gt;
*[[M1606: Implementing HTTP authorization UI and persistent sessions]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102175</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=102175"/>
		<updated>2016-04-12T00:04:09Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* UML Diagrams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
The scope of the project comprises of the 4 steps listed below:&lt;br /&gt;
&lt;br /&gt;
1) Ensure the appearance of an authorization UI in case a [https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 401 HTTP response] is received. In load in the [https://github.com/servo/servo/blob/master/components/net/http_loader.rs http_loader.rs], immediately before attempting to process an HTTP redirection, the new [https://sourceforge.net/projects/tinyfiledialogs/ tinyfiledialogs] is made use of to make two prompts to pop up (for username and password), subsequently the request is restarted and the new authorization value present applied. If an authorization value was indeed present and the response is successful, the credentials are added to the authorization cache.&lt;br /&gt;
&lt;br /&gt;
2) If the command-line option of the profile directory is present when the ResourceThread is instructed to exit, the data contained in the cookie_storage, hsts_list, and the new HTTP authorization cache is serialized. This serialized data is then written in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
3) Perform similar serialization upon shutdown for local_data in [https://doc.servo.org/src/net_traits/storage_thread.rs.html storage_thread.rs], which represents the LocalStorage API.&lt;br /&gt;
&lt;br /&gt;
4) Check if the command-line option is present in the profile directory in the ResourceThreadconstructor and look for files that will contain serialized versions of the previous steps. If such files do exist, populate the appropriate fields with deserialized versions of the file’s contents.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
We do use a facade pattern by creating a safe RUST wrapper around the RUST FFI for the tinyfiledialogs library that we will use for the UI.  We could have just called the FFI functions from servo, but instead we created a safe and simple interface to call the library functions.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective: Make an authorization UI appear when a 401 HTTP response is received &lt;br /&gt;
&lt;br /&gt;
Using the tinyfiledialogs RUST FFI bindings that the team created in the initial steps we will create a UI for the user to enter his username and password when a 401 request is received for a basic HTTP authentication.  We will first check if the status code of the http response is &amp;quot;unauthorized&amp;quot;. If the code is unauthorized we will display the UI for the user to enter his username and password.  After the username and password are entered the request is restarted with the authentication header added.  If the request is now successful we create a new authentication entry struct and place it into the Authentication hash map for future use.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory.&lt;br /&gt;
&lt;br /&gt;
When a Resource Thread exits we will check if the opts structure located in opts.rs contains an entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present when the Resource Thread exits we will open or create a file for each data set we are saving.  After each file is opened or created we will serialize the data that corresponds to that file with the rust serialize library and save the serialized data to the file.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: On shutdown serialize the local_data in storage_thread.r&lt;br /&gt;
&lt;br /&gt;
This is similar to step 2 and some code re-use will be used.  However, the difference between this step and step 2 is that the local data contained in storage_thread.rs will be the data that is being serialized and saved into the same directory.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective: If the command line option for profile-dir is present then load the serialized data present in the directory that is given.&lt;br /&gt;
&lt;br /&gt;
When a resource thread is created we will check if the opts structure located in opts.rs contains a entry for the command line option &amp;quot;--profile dir&amp;quot;.  If the option is present then the data from each file contained in the directory will be opened and deserialized using the serialize rust library. The data will then be placed in the appropriate fields. i.e (cookie_storage, hsts_lists, authorization_cache)&lt;br /&gt;
&lt;br /&gt;
=='''UML Diagrams'''==&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 1'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 2'''===&lt;br /&gt;
&lt;br /&gt;
[[File:STEP2.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''UML for step 4'''===&lt;br /&gt;
&lt;br /&gt;
[[File:517project.png ]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:STEP2.png&amp;diff=102174</id>
		<title>File:STEP2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:STEP2.png&amp;diff=102174"/>
		<updated>2016-04-12T00:02:40Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_2.png&amp;diff=102154</id>
		<title>File:Step 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_2.png&amp;diff=102154"/>
		<updated>2016-04-11T22:20:51Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: uploaded a new version of &amp;amp;quot;File:Step 2.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_3.png&amp;diff=102153</id>
		<title>File:Step 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_3.png&amp;diff=102153"/>
		<updated>2016-04-11T22:19:58Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_2.png&amp;diff=102152</id>
		<title>File:Step 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_2.png&amp;diff=102152"/>
		<updated>2016-04-11T22:19:27Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101808</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101808"/>
		<updated>2016-04-04T18:06:15Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Related Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101807</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101807"/>
		<updated>2016-04-04T17:54:10Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101806</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101806"/>
		<updated>2016-04-04T17:53:25Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]'''&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101803</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101803"/>
		<updated>2016-04-04T17:44:14Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
Steps for Testing the new command line flag --profile-dir can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir here]&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
Steps for Unit Tests for set authorization header if url does not have credentials can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials here]&lt;br /&gt;
&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib ===&lt;br /&gt;
&lt;br /&gt;
Steps for GUI test for the tinyfiledialogs lib can be found  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib here ]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101801</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101801"/>
		<updated>2016-04-04T17:33:38Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ]&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
===Testing the new command line flag --profile-dir===&lt;br /&gt;
&lt;br /&gt;
'''[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Testing_the_new_command_line_flag_--profile-dir Testing the new command line flag --profile-dir]'''&lt;br /&gt;
&lt;br /&gt;
=== Unit Test for set authorization header if url does not have credentials ===&lt;br /&gt;
&lt;br /&gt;
'''[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#Unit_Test_for_set_authorization_header_if_url_does_not_have_credentials Unit Test for set authorization header if url does not have credentials]'''&lt;br /&gt;
=== GUI test for the tinyfiledialogs lib===&lt;br /&gt;
&lt;br /&gt;
'''[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606#GUI_test_for_the_tinyfiledialogs_lib GUI test for the tinyfiledialogs lib]'''&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101799</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101799"/>
		<updated>2016-04-04T17:26:04Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
'''A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ] .&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101797</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101797"/>
		<updated>2016-04-04T17:25:41Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
A Wiki Page regarding this work can be found [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ] .&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101796</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101796"/>
		<updated>2016-04-04T17:25:24Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
A Wiki Page regarding this work can be found [ http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016_OSS_M1606 here ] .&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101795</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101795"/>
		<updated>2016-04-04T17:22:25Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Implementation / Design Decisions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [http://wiki.expertiza.ncsu.edu/index.php/M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions#Scope Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101794</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101794"/>
		<updated>2016-04-04T17:21:59Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
&lt;br /&gt;
== '''Implementation / Design Decisions''' ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the design decisions that we have made for implementing the steps mentioned in [https://en.wikipedia.org/wiki/Web_page Scope] :&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Objective: &lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Objective:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101793</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101793"/>
		<updated>2016-04-04T17:13:57Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creates the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
2) Created [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
3) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, defined an HTTP authorization cache storage (username, password, URL) and instantiated it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implemented the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using the authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design Patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101792</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101792"/>
		<updated>2016-04-04T17:06:00Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Previous Work''' ==&lt;br /&gt;
&lt;br /&gt;
1) Added a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of this project is to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Mverma4&amp;diff=101791</id>
		<title>User talk:Mverma4</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Mverma4&amp;diff=101791"/>
		<updated>2016-04-04T17:00:53Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved User talk:Mverma4 to Talk:M1606: Implementing HTTP authorization UI and persistent sessions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:M1606: Implementing HTTP authorization UI and persistent sessions]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Talk:M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101790</id>
		<title>Talk:M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Talk:M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101790"/>
		<updated>2016-04-04T17:00:53Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved User talk:Mverma4 to Talk:M1606: Implementing HTTP authorization UI and persistent sessions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Fall 2016/ OSS M1606]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Mverma4&amp;diff=101789</id>
		<title>User:Mverma4</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Mverma4&amp;diff=101789"/>
		<updated>2016-04-04T17:00:52Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved User:Mverma4 to M1606: Implementing HTTP authorization UI and persistent sessions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[M1606: Implementing HTTP authorization UI and persistent sessions]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101788</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101788"/>
		<updated>2016-04-04T17:00:52Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved User:Mverma4 to M1606: Implementing HTTP authorization UI and persistent sessions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on &amp;lt;code&amp;gt;tests/html/about-mozilla.html&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
This is a quick summary of the changes.  Not all code is shown. To see a more detailed view of the code changes look at the pull requests or commits in the repo.&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
An example program that uses the tinyfiledialogs bindings has been placed in /examples/tinytest&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101787</id>
		<title>M1606: Implementing HTTP authorization UI and persistent sessions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=M1606:_Implementing_HTTP_authorization_UI_and_persistent_sessions&amp;diff=101787"/>
		<updated>2016-04-04T17:00:11Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: M1606: Implementing HTTP authorization UI and persistent sessions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on &amp;lt;code&amp;gt;tests/html/about-mozilla.html&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
This is a quick summary of the changes.  Not all code is shown. To see a more detailed view of the code changes look at the pull requests or commits in the repo.&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
An example program that uses the tinyfiledialogs bindings has been placed in /examples/tinytest&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Requests''' ==&lt;br /&gt;
All pull requests that fully implement the initial steps have been accepted by a servo maintainer and successfully merged to the servo master branch&lt;br /&gt;
&lt;br /&gt;
These are the pull requests that complete the initial steps of the project:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Testing the new command line flag --profile-dir'''==&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo.git&lt;br /&gt;
&lt;br /&gt;
    cd servo&lt;br /&gt;
&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html --profile-dir [directory name]&lt;br /&gt;
&lt;br /&gt;
    //A new folder should be created if it does not exist with the directory name&lt;br /&gt;
&lt;br /&gt;
== '''Unit Test for set authorization header if url does not have credentials''' ==&lt;br /&gt;
The project maintainer instructed us to add one unit test to test the initial step functionality.  We have added a unit test to test that the authentication header is being set if credentials are contained in the cache &lt;br /&gt;
&lt;br /&gt;
It can be run with the other unit tests with the command &lt;br /&gt;
&lt;br /&gt;
    ./mach test-unit -p net&lt;br /&gt;
&lt;br /&gt;
The unit test can be found in /servo/tests/unit/net/http_loader.rs&lt;br /&gt;
&lt;br /&gt;
== '''GUI test for the tinyfiledialogs lib'''==&lt;br /&gt;
In addition to creating the rust FFI bindings for the tinyfiledialog C library our team also created a example rust program to test the new rust library.&lt;br /&gt;
&lt;br /&gt;
To run the example and see all of the tinyfiledialog windows do the following.&lt;br /&gt;
&lt;br /&gt;
    Git clone https://github.com/jdm/tinyfiledialogs.git&lt;br /&gt;
&lt;br /&gt;
    cd tinyfiledialogs/examples/tinytest&lt;br /&gt;
&lt;br /&gt;
    cargo run&lt;br /&gt;
&lt;br /&gt;
This will run tinytest which is a rust program that show cases the different GUI windows that the new rust tinyfiledialogs library has.&lt;br /&gt;
&lt;br /&gt;
== '''Design patterns''' ==&lt;br /&gt;
The team was not given much freedom for design patterns.  We followed and used the existing servo design strategy.  You can read about the servo design [https://github.com/servo/servo/wiki/Design here]&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101501</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101501"/>
		<updated>2016-03-30T16:27:18Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: /* Writing Assignment 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Active Job]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional Tests for Questionnaire Controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 / Expertiza Self-Review Feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement private browsing]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Write automated tests for WebDriver]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor sign_up_sheet_controller.rb and sign_up_topic.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement Common Parts of the CSSOM API]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional tests for assignment creation function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/E1604. Functional tests for Calibration function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor and write unit tests for question type.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor response controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016_OSS_M1606]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101099</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101099"/>
		<updated>2016-03-22T23:40:49Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Web_page Web pages] make use of [https://en.wikipedia.org/wiki/Session_(computer_science) sessions] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on &amp;lt;code&amp;gt;tests/html/about-mozilla.html&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101096</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101096"/>
		<updated>2016-03-22T23:38:09Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
[ https://en.wikipedia.org/wiki/Web_page Web pages ] make use of [ https://en.wikipedia.org/wiki/Session_(computer_science) sessions ] all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on &amp;lt;code&amp;gt;tests/html/about-mozilla.html&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create [http://doc.rust-lang.org/book/ffi.html  Rust FFI bindings] for the &amp;lt;code&amp;gt;[https://github.com/jdm/tinyfiledialogs tinyfiledialogs] &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the [https://fetch.spec.whatwg.org/#http-network-or-cache-fetch appropriate specification ] using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101092</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101092"/>
		<updated>2016-03-22T23:27:17Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser.&amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' == &lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
5.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101079</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101079"/>
		<updated>2016-03-22T23:14:32Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. &lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
[[File:Step2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-1Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Step3-2Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
[[File:Step4Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
[[File:Step5Wiki2spring16.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step5Wiki2spring16.jpg&amp;diff=101075</id>
		<title>File:Step5Wiki2spring16.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step5Wiki2spring16.jpg&amp;diff=101075"/>
		<updated>2016-03-22T23:10:48Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step4Wiki2spring16.jpg&amp;diff=101074</id>
		<title>File:Step4Wiki2spring16.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step4Wiki2spring16.jpg&amp;diff=101074"/>
		<updated>2016-03-22T23:10:29Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step3-2Wiki2spring16.jpg&amp;diff=101073</id>
		<title>File:Step3-2Wiki2spring16.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step3-2Wiki2spring16.jpg&amp;diff=101073"/>
		<updated>2016-03-22T23:10:08Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step3-1Wiki2spring16.jpg&amp;diff=101072</id>
		<title>File:Step3-1Wiki2spring16.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step3-1Wiki2spring16.jpg&amp;diff=101072"/>
		<updated>2016-03-22T23:09:09Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2Wiki2spring16.jpg&amp;diff=101071</id>
		<title>File:Step2Wiki2spring16.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2Wiki2spring16.jpg&amp;diff=101071"/>
		<updated>2016-03-22T23:08:42Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101065</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101065"/>
		<updated>2016-03-22T23:01:38Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.This is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. &lt;br /&gt;
&lt;br /&gt;
With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added Rust FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101062</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101062"/>
		<updated>2016-03-22T22:57:34Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.&lt;br /&gt;
&lt;br /&gt;
The above is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
Rust is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Persistent-sessions-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101060</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101060"/>
		<updated>2016-03-22T22:55:21Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.&lt;br /&gt;
&lt;br /&gt;
The above is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
Rust is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag &amp;lt;code&amp;gt; --profile-dir [path]&amp;lt;/code&amp;gt; that stores an optional directory path in the Opts struct in &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs &amp;lt;/code&amp;gt;library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an &amp;lt;code&amp;gt;Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In &amp;lt;code&amp;gt;modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file &amp;lt;code&amp;gt;resource_thread.rs&amp;lt;/code&amp;gt;, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the&amp;lt;code&amp;gt; modify_request_headers&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authorization cache to resources &amp;amp; set authorization header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the &amp;lt;code&amp;gt;http_loader.rs&amp;lt;/code&amp;gt;, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the &amp;lt;code&amp;gt;tinyfiledialogs&amp;lt;/code&amp;gt; library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The&amp;lt;code&amp;gt; –profile-dir [path]&amp;lt;/code&amp;gt; command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101059</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101059"/>
		<updated>2016-03-22T22:50:13Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' M1606: Implementing HTTP authorization UI and persistent sessions '''&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.&lt;br /&gt;
&lt;br /&gt;
The above is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
Rust is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag --profile-dir [path] that stores an optional directory path in the Opts struct in opts.rs, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the tinyfiledialogs library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In resource_thread.rs, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In modify_request_headers in http_loader.rs, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: === &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: === &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: ===&lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the tinyfiledialogs library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: ===&lt;br /&gt;
&lt;br /&gt;
In the file resource_thread.rs, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
=== Step 5: ===&lt;br /&gt;
&lt;br /&gt;
In the modify_request_headers in http_loader.rs, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)    &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10087 Added a new command line flag --profile-dir ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/jdm/tinyfiledialogs/pull/1 Added FFI bindings to lib.rs ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)	&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/servo/servo/pull/10111 Added authentication cache to resources &amp;amp; set authentication header from it if url does not have credentials ]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the http_loader.rs, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the tinyfiledialogs library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The –profile-dir [path] command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/_OSS_M1606&amp;diff=101057</id>
		<title>CSC/ECE 517 Fall 2016/ OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/_OSS_M1606&amp;diff=101057"/>
		<updated>2016-03-22T22:43:29Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved CSC/ECE 517 Fall 2016/ OSS M1606 to CSC/ECE 517 Spring 2016 OSS M1606&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2016 OSS M1606]]&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101056</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101056"/>
		<updated>2016-03-22T22:43:29Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: moved CSC/ECE 517 Fall 2016/ OSS M1606 to CSC/ECE 517 Spring 2016 OSS M1606&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' M1606: Implementing HTTP authorization UI and persistent sessions ''' ==&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.&lt;br /&gt;
&lt;br /&gt;
The above is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
Rust is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag --profile-dir [path] that stores an optional directory path in the Opts struct in opts.rs, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the tinyfiledialogs library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In resource_thread.rs, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In modify_request_headers in http_loader.rs, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' &lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the tinyfiledialogs library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
'''Step 4:''' &lt;br /&gt;
&lt;br /&gt;
In the file resource_thread.rs, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
'''Step 5:''' &lt;br /&gt;
&lt;br /&gt;
In the modify_request_headers in http_loader.rs, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)	Added a new command line flag --profile-dir [path]:&lt;br /&gt;
&lt;br /&gt;
https://github.com/servo/servo/pull/10087&lt;br /&gt;
&lt;br /&gt;
2)	Added FFI bindings to lib.rs:&lt;br /&gt;
&lt;br /&gt;
https://github.com/jdm/tinyfiledialogs/pull/1&lt;br /&gt;
&lt;br /&gt;
3)	Added auth cache to resources + set auth header from it if url does not have credentials:&lt;br /&gt;
&lt;br /&gt;
https://github.com/servo/servo/pull/10111&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the http_loader.rs, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the tinyfiledialogs library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The –profile-dir [path] command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101054</id>
		<title>CSC/ECE 517 Spring 2016 OSS M1606</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_OSS_M1606&amp;diff=101054"/>
		<updated>2016-03-22T22:42:31Z</updated>

		<summary type="html">&lt;p&gt;Mverma4: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' M1606: Implementing HTTP authorization UI and persistent sessions ''' ==&lt;br /&gt;
&lt;br /&gt;
Web pages make use of sessions all the time. These are required to persist throughout the life of the user's interaction with the web site or web application.&lt;br /&gt;
&lt;br /&gt;
The above is supported by Servo as of today. However it doesn't support the persistence of data upon the closing and reopening of the web browser. With this project we aim to create the necessary infrastructure to support this.&lt;br /&gt;
&lt;br /&gt;
== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is a web browser layout engine written in Rust and is currently being developed by Mozilla Research. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
&lt;br /&gt;
Rust is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&lt;br /&gt;
&lt;br /&gt;
== '''Scope''' ==&lt;br /&gt;
&lt;br /&gt;
The scope of the project is limited to the steps mentioned below:&lt;br /&gt;
&lt;br /&gt;
1) Compile Servo and ensure that it runs on tests/html/about-mozilla.html.&lt;br /&gt;
&lt;br /&gt;
2) Add a new command line flag --profile-dir [path] that stores an optional directory path in the Opts struct in opts.rs, creating the directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
3) Create Rust FFI bindings for the tinyfiledialogs library to allow calling the C methods from Servo.&lt;br /&gt;
&lt;br /&gt;
4) In resource_thread.rs, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an Arc&amp;lt;Rwlock&amp;lt;&amp;gt;&amp;gt; value, to enable sharing it between threads).&lt;br /&gt;
&lt;br /&gt;
5) In modify_request_headers in http_loader.rs, implement the remaining pieces of step 12 of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' &lt;br /&gt;
&lt;br /&gt;
The project requirement initially stated that we build and Compile servo. Servo is built with Cargo, the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' &lt;br /&gt;
&lt;br /&gt;
The project required us to add a new command line flag that stored an optional directory path. The job of this flag was to create a directory in the absence of it.&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' &lt;br /&gt;
&lt;br /&gt;
To create the Rust FFI bindings for the tinyfiledialogs library so as to allow the C methods to be called from Servo.&lt;br /&gt;
&lt;br /&gt;
'''Step 4:''' &lt;br /&gt;
&lt;br /&gt;
In the file resource_thread.rs, we were required to define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member. &lt;br /&gt;
&lt;br /&gt;
'''Step 5:''' &lt;br /&gt;
&lt;br /&gt;
In the modify_request_headers in http_loader.rs, we were required to implement a portion of the appropriate specification using this new authorization cache.&lt;br /&gt;
&lt;br /&gt;
== '''Pull Request''' ==&lt;br /&gt;
&lt;br /&gt;
These are the pull requests for the modifications we’ve made:&lt;br /&gt;
&lt;br /&gt;
1)	Added a new command line flag --profile-dir [path]:&lt;br /&gt;
&lt;br /&gt;
https://github.com/servo/servo/pull/10087&lt;br /&gt;
&lt;br /&gt;
2)	Added FFI bindings to lib.rs:&lt;br /&gt;
&lt;br /&gt;
https://github.com/jdm/tinyfiledialogs/pull/1&lt;br /&gt;
&lt;br /&gt;
3)	Added auth cache to resources + set auth header from it if url does not have credentials:&lt;br /&gt;
&lt;br /&gt;
https://github.com/servo/servo/pull/10111&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The definition of the HTTP authorization cache and the implementation of the appropriate specification in the http_loader.rs, ensures the authorization UI will appear when a 401 HTTP response is received. &lt;br /&gt;
&lt;br /&gt;
The Rust FFI Bindings for the tinyfiledialogs library will ultimately help with the dialogue box that will pop up in event of a 401 HTTP response. &lt;br /&gt;
&lt;br /&gt;
The –profile-dir [path] command line flag will store an optional directory path, creating the directory in case it doesn’t exist.&lt;/div&gt;</summary>
		<author><name>Mverma4</name></author>
	</entry>
</feed>