Module 4 Journal Entry
.docx
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
CS255
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
2
Uploaded by MinisterMonkeyPerson767
Brandon Hobbs
CS-230
Jan 28, 2022
Module 4 Journal
During week 4 a REST API was designed to act as an interface between the client browser and the server. This brings quite a few benefits by separating the concerns into a server-client relationship. This server-client relationship allows there to be a distributed workload as the client does not share resources with the server. The client sends request for data to the server that is then processed and returned.
There are a few disadvantages to the server-client relationship:
Separation allows each side of the to be distinctly attacked: viruses present in the client may be uploaded to the server or server Denial of Service (DOS) attacks may prevent communication back to the client
Phishing and Man-in-the-Middle attacks allow the information to be captured at some midpoint and the useful pieces, e.g., login credentials, stolen
Transmission may be compromised with spoofed packets or even modified
Even though there are disadvantages to this arrangement it has been widely adopted because it has allowed:
For a centralized system with all the data in a single place
The server and clients to scale or evolve differently
Language agnostic communications There are often two separate approaches to this online data communication: SOAP and RESTful. SOAP is an actual protocol maintain by the W3C Consortium and RESTful is more of an architectural framework. SOAP brings a few benefits, built in security and transaction compliance, but can be slower and heavier to implement.
The RESTful API architecture has 6 attributes:
There are separate client ad servers
Each request is stateless – meaning each request contains all the necessary information and does not rely on previous transmissions
Caching is expected to be used for fast response
Uniform interface to allow predictable API behavior must allow for unique identification of resources and a common vocabulary for manipulating those resources
Any layers, e.g., caching security, etc., must be transparent to the client and server
The server may, optionally, return code for the client to run, such as JavaScript
The REST API used in this assignment was designed to authenticate and authorize certain behavior to differing accounts. This implementation follows the pattern shown in here: https://howtodoinjava.com/dropwizard/dropwizard-basic-auth-security-example/
The principal object in security represents the user whose credentials have been supplied in the API request. The Authenticator class is responsible for the actual authentication of the username and password. The designed API uses role-based authentication and the Authorizer class, used here, performs the role matching and decides if a user is allowed to perform a certain action.
Dropwizard then uses theses classes to authenticate and authorize any user trying to make a request on the API. To invoke this behavior the @AUTH annotation is used in conjunction with the roles annotation,
@RolesPermitted, to authorize only certain roles. This is in stark contrast to the @PermitAll annotation which allows all roles access. This pattern and implementation across multiple client-types would be possible. Because the RESTful API
is not a protocol it should be transparent to the client. For example, if the API was to be implemented on
XPOX or PS4, as long as those platforms could formulate the request and receive the response no changes would be needed on the server.
The gameauth
service would need some additional work, however. Usernames of guest, user, admin are
of little use and therefore an interface to allow new usernames/accounts and their associated roles to be added. Moreover, these actions, adding users, and then assigning roles also needs to be controlled – you wouldn’t want a guest to be able to make an admin account for themselves. This might be done through an API but does pose a “juicy target” for someone with nefarious intentions. Instead, a user interface to the backend to control enrollment and entitlements behind multiple layers of security might
offer a better solution.
References
:
Unknown Author. (n.d.). Dropwizard – BasicAuth Security Example.
HoToDoInJava. Retrieved January 29,
2022 from https://howtodoinjava.com/dropwizard/dropwizard-basic-auth-security-example/
.
Unknown Author. (2019, November 19). Client-Server Model
. GeeksForGeeks. Retrieved January 29,
2022 from https://www.geeksforgeeks.org/client-server-model/
.
Unknown Author. (2021, October 19). What is REST
. RESTfulAPI.net Retrieved January 29, 2022 from
https://restfulapi.net/
.
Unknown Author. (2020, May 8). What is a REST API
. RedHat. Retrieved January 29, 2022 from
https://www.redhat.com/en/topics/api/what-is-a-rest-api
.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Lab Manual
223CCS-3 Advanced Object Oriented Programming
Laboratory 11
Networking and threads Cont...
Objective:
Creation of a chat application using networking and threads.
Activity Outcomes:
This lab teaches you the following topics:
Combining two concepts, Threads and Networking, in one java application
Lab Activities:
Based on the previous lab on networking, write a program corresponding to a chat application
where a server and a client will communicate through a TCP connection.
Note that in a chatting application, every side of the connection can send messages at any time and
the other side will receive and display it. To do this, we need two thread classes, one for writing in
the socket and the other for reading from it. These two threads will be executed together by both
the client and the server.
Thus, you have to develop the following classes:
Two thread classes. The first one, called SenderThread, will be used to send messages to
the other side through a socket infinitely…
arrow_forward
Write a Java program using Thread with single Server and Multiple Clients
NOTE: Client must be running until Bye message is sent. Server should never stop
I need answer question pls
arrow_forward
This is an application required to be completed on NetBeans apache 12.5 (Java)
arrow_forward
Q2:A company supplies a Tax Returns Automation process to its clients, visiting their sites andinspecting their revenues for a given year, giving advice and completing the necessary formsfor Tax Returns purposes. Once the forms have been completed, they are saved as papercopies; one is kept by the client, the other is filed locally within the company’s paper-basedarchives. The corresponding electronic copies are also saved in a word-processor format andsaved on a local computer.The company is seeking to develop a more fully automated process: the tax consultantvisiting the client's premises periodically would log-in to an on-line application (within thecompany website) and input the data to an on-line form. The data collected would be usedto keep the clients informed of the results of the consultant’s visits and the date of the nextvisit.Considering the above scenario:a) List and describe at least THREE possible risks that the company will be likely to facewhen the new more…
arrow_forward
data comunication
A program for communication between server and client will be developed. Multiclients (more than 1 client) can communicate with server simultaneously. While a client communication with the server, another clients should communicate with the server. The communication should be seen in consoles. TCP protocol will be used.. Thread functions should be used for the simultaneous communication
arrow_forward
Write a Java program using Thread with single Server and Multiple Clients
NOTE: Client must be running until Bye message is sent. Server should never stop
I need answer question pls
one server
two client
arrow_forward
Dynamic scoping: What is it, when does it work, and how can it be made to work even better than before?
arrow_forward
What is the concept of "overcommitting" in a virtual environment?
arrow_forward
Dynamic scoping: what is it, when is it used, and how can it be optimized?
arrow_forward
data flow diagram
arrow_forward
Socket programming
The application consists of two parts: Server and Client. Each part can run independently on separate computers.
Server manages the chat session. It maintains a list of the active clients and forwards incoming messages. The Server is multithreaded - communication with each client is through a separate thread. When Server is started, it starts to wait for client connections.
This thread continues forever to listen for clients. When a connection request is received, the server starts a thread to service the client. This is necessary for each client to have its own socket. When the thread is started, a Client object is created containing all the relevant info about each client and saved in a list.
The ServiceClient() thread is where all the work is done. ServiceClient() defines the implementation of the server side of the application protocol
arrow_forward
a) Draw a well-labelled diagram to indicate the five states of a thread. In the drawing, indicate at least one method that can change the state of a previous state to the next state of the thread.
b) Multithreading is one of the two ways that multitasking can be achieved. Using Java code snippets, describe two ways that a thread can be created.
c) Describe the function that a Daemon thread in Java is assigned to, then using Java code snippet, create a thread using any of the two common ways and assign it to be a Daemon thread using the appropriate method.
arrow_forward
In computer graphics when looking at synchronizations when building a renderer in engine development, what are moments where locks and unlocks from mutex's would not always work when looking at synchronization for a renderer in an engine?What I mean is when developing a game engine and you'll want there to be synchronization from a renderer thread and a main thread. Where renderer thread handles flushing and executing all of the concurrent tasks, whereas main thread would handle more of the querying tasks to a render command queue, and handling how these operations are operated within the engine.Can you give me some ideas on when mutex's may not be enough in a more complex? Where you may have multiple scenes, where animation physics are applied, and various vast ideas in this perspective?On another can you give me in great details what are uses of ref counters and different variations of implementations (in C++), and why reference counters are used? And what purpose do they have, as…
arrow_forward
If a JVM's method area is global to all of the threads that are running in the environment of a virtual machine, why do you think this is the case?
arrow_forward
How do handler interfaces manage resource allocation in environments with heterogeneous hardware components?
arrow_forward
Multi-threading
A) Write a Thread class (called worker) that takes two numbers (A and B, A < B) and calculates the products of all numbers between A and B. the result is stored in a local variable than can be accessed through a get method.
B) Write a main program to calculate the factorial of a given number n (). The main thread reads n from the user, then creates two instances of Worker. Each one is requested to calculate the half of numbers between 1 and n. Once they finish, the main thread will gather their results and print the final result (result1 x result2).
Example when n=10
arrow_forward
Java Programming 2/Mobile Device Programming
2) Threads are a relatively recent invention in the computer
science world. Although processes, their larger parent, have
been around for decades, threads have only recently been
accepted into
the mainstream.
Perhaps the best example of threading is a WWW browser. Can
your browser download an indefinite number of files and Web
pages at once while still enabling you to continue browsing?
While these pages are downloading, can your browser
download all the pictures, sounds, and so forth in parallel,
interleaving the fast and slow download times of multiple
Internet servers?
Discuss about this.
arrow_forward
Explain the potential issues and best practices related to versioning when dealing with serialized objects.
arrow_forward
Context:
One operating system (Linux) treats processes and threads in the same way, allowing a task to be more akin to a process or a thread (as described in our text) depending on flags passed to the system call that creates it. Another operating system (Windows) treat processes and threads quite differently. The Process Control Block contains pointers to the separate threads belonging to the process.Question:
Contrast these two approaches for modeling processes and threads within the kernel. What differences do the two approaches make? What are some consequences?
(Operating system and concept )
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Lab Manual 223CCS-3 Advanced Object Oriented Programming Laboratory 11 Networking and threads Cont... Objective: Creation of a chat application using networking and threads. Activity Outcomes: This lab teaches you the following topics: Combining two concepts, Threads and Networking, in one java application Lab Activities: Based on the previous lab on networking, write a program corresponding to a chat application where a server and a client will communicate through a TCP connection. Note that in a chatting application, every side of the connection can send messages at any time and the other side will receive and display it. To do this, we need two thread classes, one for writing in the socket and the other for reading from it. These two threads will be executed together by both the client and the server. Thus, you have to develop the following classes: Two thread classes. The first one, called SenderThread, will be used to send messages to the other side through a socket infinitely…arrow_forwardWrite a Java program using Thread with single Server and Multiple Clients NOTE: Client must be running until Bye message is sent. Server should never stop I need answer question plsarrow_forwardThis is an application required to be completed on NetBeans apache 12.5 (Java)arrow_forward
- Q2:A company supplies a Tax Returns Automation process to its clients, visiting their sites andinspecting their revenues for a given year, giving advice and completing the necessary formsfor Tax Returns purposes. Once the forms have been completed, they are saved as papercopies; one is kept by the client, the other is filed locally within the company’s paper-basedarchives. The corresponding electronic copies are also saved in a word-processor format andsaved on a local computer.The company is seeking to develop a more fully automated process: the tax consultantvisiting the client's premises periodically would log-in to an on-line application (within thecompany website) and input the data to an on-line form. The data collected would be usedto keep the clients informed of the results of the consultant’s visits and the date of the nextvisit.Considering the above scenario:a) List and describe at least THREE possible risks that the company will be likely to facewhen the new more…arrow_forwarddata comunication A program for communication between server and client will be developed. Multiclients (more than 1 client) can communicate with server simultaneously. While a client communication with the server, another clients should communicate with the server. The communication should be seen in consoles. TCP protocol will be used.. Thread functions should be used for the simultaneous communicationarrow_forwardWrite a Java program using Thread with single Server and Multiple Clients NOTE: Client must be running until Bye message is sent. Server should never stop I need answer question pls one server two clientarrow_forward
- data flow diagramarrow_forwardSocket programming The application consists of two parts: Server and Client. Each part can run independently on separate computers. Server manages the chat session. It maintains a list of the active clients and forwards incoming messages. The Server is multithreaded - communication with each client is through a separate thread. When Server is started, it starts to wait for client connections. This thread continues forever to listen for clients. When a connection request is received, the server starts a thread to service the client. This is necessary for each client to have its own socket. When the thread is started, a Client object is created containing all the relevant info about each client and saved in a list. The ServiceClient() thread is where all the work is done. ServiceClient() defines the implementation of the server side of the application protocolarrow_forwarda) Draw a well-labelled diagram to indicate the five states of a thread. In the drawing, indicate at least one method that can change the state of a previous state to the next state of the thread. b) Multithreading is one of the two ways that multitasking can be achieved. Using Java code snippets, describe two ways that a thread can be created. c) Describe the function that a Daemon thread in Java is assigned to, then using Java code snippet, create a thread using any of the two common ways and assign it to be a Daemon thread using the appropriate method.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education