File tree Expand file tree Collapse file tree 11 files changed +18
-18
lines changed Expand file tree Collapse file tree 11 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 44 "net/http"
55 "time"
66
7- "github.com/PythonHacker24/linux-acl-management-backend/internal/authentication "
7+ "github.com/PythonHacker24/linux-acl-management-backend/internal/auth "
88 "go.uber.org/zap"
99)
1010
@@ -36,7 +36,7 @@ func AuthenticationMiddleware(next http.HandlerFunc) http.HandlerFunc {
3636 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
3737
3838 /* authenticate the request through JWT */
39- username , err := authentication .ExtractUsernameFromRequest (r )
39+ username , err := auth .ExtractUsernameFromRequest (r )
4040 if err != nil {
4141 zap .L ().Error ("Error during authentication" ,
4242 zap .Error (err ),
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import (
44 "net/http"
55
66 "github.com/PythonHacker24/linux-acl-management-backend/api/middleware"
7- "github.com/PythonHacker24/linux-acl-management-backend/internal/handlers "
7+ "github.com/PythonHacker24/linux-acl-management-backend/internal/health "
88)
99
1010func RegisterRoutes (mux * http.ServeMux ) {
1111 mux .Handle ("GET /health" , http .HandlerFunc (
12- middleware .LoggingMiddleware (handlers .HealthHandler ),
12+ middleware .LoggingMiddleware (health .HealthHandler ),
1313 ))
1414}
Original file line number Diff line number Diff line change 1- package authentication
1+ package auth
22
33import (
44 "fmt"
Original file line number Diff line number Diff line change 1+ package auth
Original file line number Diff line number Diff line change 1- package ldap
1+ package auth
22
33import (
44 "os"
Original file line number Diff line number Diff line change 1- package models
2-
3-
4- /* health response */
5- type HealthResponse struct {
6- Status string `json:"status"`
7- }
1+ package auth
82
93/* username and password */
104type User struct {
Original file line number Diff line number Diff line change 1+ package auth
Original file line number Diff line number Diff line change 1- package handlers
1+ package health
22
33import (
44 "encoding/json"
55 "net/http"
66
77 "go.uber.org/zap"
88
9- "github.com/PythonHacker24/linux-acl-management-backend/internal/models"
9+ // "github.com/PythonHacker24/linux-acl-management-backend/internal/models"
1010)
1111
1212/* health handler provides status check on the backend server */
1313func HealthHandler (w http.ResponseWriter , r * http.Request ) {
14- var response models. HealthResponse
14+ var response HealthResponse
1515
1616 w .Header ().Set ("Content-Type" , "application/json" )
1717 w .WriteHeader (http .StatusOK )
Original file line number Diff line number Diff line change 1+ package health
2+
3+ /* health response */
4+ type HealthResponse struct {
5+ Status string `json:"status"`
6+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments