From cc47dfe3a7ef749b6e9dfb026b77d7035de6b07e Mon Sep 17 00:00:00 2001
From: Andrej Rasevic <andrej@rasevicengineering.com>
Date: Thu, 20 Jan 2022 13:21:57 -0500
Subject: [PATCH] updating exercise3 and adding exercise4

---
 exercises/exercise3/Exercise3_Description.md |  3 ++-
 exercises/exercise4/Exercise4_Description.md | 16 ++++++++++++++++
 exercises/exercise4/cmd/server/main.go       | 12 ++++++++++++
 exercises/exercise4/data.go                  |  1 +
 exercises/exercise4/go.mod                   |  3 +++
 exercises/exercise4/handlers.go              |  1 +
 6 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 exercises/exercise4/Exercise4_Description.md
 create mode 100644 exercises/exercise4/cmd/server/main.go
 create mode 100644 exercises/exercise4/data.go
 create mode 100644 exercises/exercise4/go.mod
 create mode 100644 exercises/exercise4/handlers.go

diff --git a/exercises/exercise3/Exercise3_Description.md b/exercises/exercise3/Exercise3_Description.md
index ecd5c66..f39a95f 100644
--- a/exercises/exercise3/Exercise3_Description.md
+++ b/exercises/exercise3/Exercise3_Description.md
@@ -14,7 +14,8 @@ Details:
 
 1. You are given a go module: __exercise3__. You need to implement your application in 2 files. Inside of __main.go__ you need to implement the interface for your CLI. Your CLI should implement the following flags:  
     *   request - Http verb (type) for your request. Only need to support GET, POST, PUT and DELETE)  
-    *   endpoint - The url of the endpoint you are trying to hit  
+    *   endpoint - The url of the endpoint you are trying to hit 
+    *   body - The body for a PUT or POST request 
     *   logs - output the log of all of your session requests  
     *   additionally your CLI should provide the user Usage information similar to the functionality in exercise 2  
 
diff --git a/exercises/exercise4/Exercise4_Description.md b/exercises/exercise4/Exercise4_Description.md
new file mode 100644
index 0000000..42a6744
--- /dev/null
+++ b/exercises/exercise4/Exercise4_Description.md
@@ -0,0 +1,16 @@
+# Exercise 4: 
+
+## Due Date: Friday, January 21, 2022 11:59 PM
+## Objectives: To get familiar with creating a restful service that handles basic authentication and implements simple authorization.
+
+## Specifications/Requirements
+In this exercise you will be creating a REST API in Go that will check for authentication and then if properly authenticated, check for the proper authorization when making requests to the endpoints the service provides. You have been provided a basic file layout structure but if you need to add more files for your design feel free to do so. You must use the __net/http__ package that is part of the standard Go library. You cannot use any third part Go packages.  
+
+Details:  
+
+1. You will be mocking a realtime database by storing the objects you will be creating, updating and deleting in a file named __database.json__.
+
+
+To deliver your submission you will need to commit your changes locally and push to your repo on the university gitlab server.  
+__NOTE__: You should not commit any executables or binaries as a result of compiling and building your application. 
+
diff --git a/exercises/exercise4/cmd/server/main.go b/exercises/exercise4/cmd/server/main.go
new file mode 100644
index 0000000..2d0934c
--- /dev/null
+++ b/exercises/exercise4/cmd/server/main.go
@@ -0,0 +1,12 @@
+package main
+
+import (
+  "net/http"
+  "fmt"
+  "os"
+
+  "gitlab.cs.umd.edu/arasevic/cmsc398Bwinter2022-student/exercises/exercise3"
+)
+
+// Default file name
+var log = "database.json"
\ No newline at end of file
diff --git a/exercises/exercise4/data.go b/exercises/exercise4/data.go
new file mode 100644
index 0000000..3b499af
--- /dev/null
+++ b/exercises/exercise4/data.go
@@ -0,0 +1 @@
+package data
\ No newline at end of file
diff --git a/exercises/exercise4/go.mod b/exercises/exercise4/go.mod
new file mode 100644
index 0000000..5ffdd17
--- /dev/null
+++ b/exercises/exercise4/go.mod
@@ -0,0 +1,3 @@
+module gitlab.cs.umd.edu/arasevic/cmsc398Bwinter2022-student/exercises/exercise4
+
+go 1.17
diff --git a/exercises/exercise4/handlers.go b/exercises/exercise4/handlers.go
new file mode 100644
index 0000000..28ae6f5
--- /dev/null
+++ b/exercises/exercise4/handlers.go
@@ -0,0 +1 @@
+package handlers
\ No newline at end of file
-- 
GitLab