Question

Submission instructions:

You are required to provide the source code including concise instructions on how to build and run

the software and the unit tests. All build time and run time dependencies should be provided in the

form of Docker containers so that the GTA doesn't have to install anything other than Docker. In

addition to the code and instructions, you must also turn in a report that describes your submission.

This report should include a description of how your code works, the design of your regular

expressions, any assumptions you have made, and the pros/cons of your approach./nTo provide an opportunity to demonstrate other skills learned this semester, the following are

additional requirements that must be met:

• Create an audit log to contain timestamped log entries written anytime a user adds a name,

removes a name, or lists the names. For add/remove entries, include the name of the person

that was added/removed in the log.

If you do use a client/server database product, you should create a config file to contain database

connectivity information and have your script read that rather than hardcoding those values in the

application.

Permissible languages: C/C++, Any .Net Language, Java, Perl, Python, Go, others with permission.

You may use one of the starter projects written in C#, Java, Python, or Go if you like (attached to

assignment in Canvas). These implement all of the basic PhoneBook functions as a REST API but do

not perform any input validation or audit logging and stores the entries in an in-memory dictionary.

You MUST use Docker container images to build and run your solution and must include the

Dockerfile(s) necessary to produce the images. This is important for easing the burden of testing

by the GTA when grading your assignment. These Docker containers should include all necessary

dependencies for whatever technology stack you are using for your implementation.

You must also add automated security-focused unit tests using a testing framework to test at least

all of the inputs provided in this assignment and verify proper handling of them along with some of

your own inputs. This could be also be accomplished using an API testing tool such as Postman (be

sure to provide the collection for Postman if you use this method).

Requirements for Phone Numbers:

The following are some rules to follow for phone numbers:

• The country code may or may not be preceded by a + which indicates that an international

dialing prefix, such as 00 or 011, must be included when dialing. If not using the plus, the

dialing prefix itself may be included.

• Some organizations use 5-digit extensions only for dialing from one internal phone to

another.

• North American phone numbers dialed within the countries of North America use a

country code of 1, have a 3-digit area code, and a 7-digit subscriber number. Calls to local

numbers in the same area code may omit the area code if not in a metro area; therefore, a

subscriber only format may be used. Acceptable entry for North American phone numbers

are as follows:

o (e.g. 123-4567)

o () (e.g. (670)123-4567)

o - (e.g. 670-123-4567)

o 1-- (e.g. 1-670-123-4567)

o 1() (e.g. 1(670)123-4567)

o (e.g. 670 123 4567)/nThe goal of this assignment is to produce a REST API that validates its input using regular

expressions.

This will be an individual assignment (no teams).

Detail:

Produce a REST API application that maintains a phone book of names and phone numbers. The

program shall be capable of receiving and storing a list of people with their full name and telephone.

The application shall include the following API endpoints:

GET /PhoneBook/list - Produce a list of the members of the database.

• POST /PhoneBook/add - Add a new person to the database.

o Argument is an object with name and phone number string elements (represented in

JSON).

PUT /PhoneBook/delete ByName - Remove someone from the database by name.

o Argument is the name as a string.

PUT /PhoneBook/delete ByNumber - Remove someone by telephone #.

o Argument is the phone number as a string.

See the PhoneBook.json file attached to the assignment in Canvas for a full OpenAPI 3.0 spec to be

used as requirements for the interface. Return values should all be in JSON per the spec.

Create regular expressions for and . Use these regular expressions to

verify that the user is supplying valid data. More flexible specifications will be graded higher. For

example:

Allowing for international or US format telephone numbers

Allowing for , or )

Reject any attempts to provide invalid data. When valid input is provided, the server shall return a

status code of 200; when invalid input is provided, the server shall return a status code of 400 and

an appropriate error message included in the response. An attempt to remove a non-existent name

from

shall return a status code of 404.

the

directory

You have the freedom to choose the implementation that you are comfortable with for persisting

the phonebook to disk (e.g. XML, text file, binary file, CSV, database, etc.). If you are attempting the

bonus at the bottom of the assignment, you might choose to use a SQL database initially to avoid

rework later (our recommendation would be to use SQLite as it is portable and doesn't require

excessive setup steps).

Question image 1Question image 2Question image 3