diff --git a/exercises/exercise3/Exercise3_Description.md b/exercises/exercise3/Exercise3_Description.md index ecd5c6661d97204852a9f5cd92670491212e098b..f39a95fdf3967b8b121d7588ac2ed6c23d86c56b 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 0000000000000000000000000000000000000000..42a6744ad7f919fb3324e66f5000008b2f19d24e --- /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 0000000000000000000000000000000000000000..2d0934c34f271b924e0aa120f20a06e198760b17 --- /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 0000000000000000000000000000000000000000..3b499afbf64b61751d787d618680fe7b7795e5ce --- /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 0000000000000000000000000000000000000000..5ffdd17717931ccf0bd5b1a70b1b99c3ea59ba57 --- /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 0000000000000000000000000000000000000000..28ae6f55c1db1b4286fc391e7254fab64051959a --- /dev/null +++ b/exercises/exercise4/handlers.go @@ -0,0 +1 @@ +package handlers \ No newline at end of file