Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6401182
feat: Docker build fixes - atlas_observability integration, prerender…
Senthil455 May 25, 2026
9fa3b38
fix: next.config.mjs issue fixed
Senthil455 May 26, 2026
ba0f042
chore: add local stdout and stderr diagnostic logs for Next.js build …
Senthil455 May 31, 2026
ea81231
feat: update header section UI with sticky scroll shadow, user dropdo…
DivyashreeR008 Jun 14, 2026
72084ac
Merge pull request #1 from DivyashreeR008/feature/header-section-ui-u…
Senthil455 Jun 14, 2026
e422ef4
add: Authentication/Authorization
Senthil455 Jun 14, 2026
ee0dc2d
Merge pull request #2 from Senthil455/Add-Authentication/Authorization
Senthil455 Jun 14, 2026
0b356da
feat: scaffold architecture for microservices and initialize Next.js …
Senthil455 Jun 14, 2026
633f931
feat: implement frontend dashboard layout, navigation components, and…
Senthil455 Jun 14, 2026
255c955
fix: add SAML response XML digital signature verification to prevent …
DivyashreeR008 Jun 14, 2026
cbdf6fb
Merge branch 'main' into fix/saml-acs-signature-verification
DivyashreeR008 Jun 14, 2026
227a98b
Merge pull request #3 from DivyashreeR008/fix/saml-acs-signature-veri…
Senthil455 Jun 14, 2026
cfccf21
feat: implement sidebar navigation component with persistent state an…
Senthil455 Jun 14, 2026
a18dabc
feat: initialize Integration Service and scaffold frontend dashboard …
Senthil455 Jun 14, 2026
06f651b
feat: scaffold dashboard modules, AI features, backend microservices,…
Senthil455 Jun 15, 2026
4588642
chore: add Next.js TypeScript environment declarations
Senthil455 Jun 15, 2026
e131d29
feat: implement dashboard layout with authentication, sidebar, and er…
Senthil455 Jun 15, 2026
1f8eb50
Add spring-boot-starter-security to payroll, leave, and performance s…
Senthil455 Jun 15, 2026
e4f54e2
Resolve merge conflicts: keep security deps, adopt hardcoded-secrets fix
Senthil455 Jun 15, 2026
844fa47
Resolve merge conflicts: keep spring-boot-starter-security in pom.xml…
Senthil455 Jun 15, 2026
c6fa0be
fix: validate JWT exp claim in Go services using ParseWithClaims
Senthil455 Jun 15, 2026
3f33f76
Merge origin/main: keep spring-boot-starter-security and add spring-b…
Senthil455 Jun 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions services/attendance-service/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import (
"github.com/golang-jwt/jwt/v5"
)

type internalClaims struct {
jwt.RegisteredClaims
UserID string `json:"user_id"`
UserRole string `json:"user_role"`
TenantID string `json:"tenant_id"`
}

var internalJWTSecret []byte

func initAuth() {
Expand All @@ -28,25 +35,25 @@ func authMiddleware(c *fiber.Ctx) error {
return c.Status(401).JSON(fiber.Map{"error": "Missing internal authentication"})
}

token, err := jwt.Parse(internalToken, func(token *jwt.Token) (interface{}, error) {
token, err := jwt.ParseWithClaims(internalToken, &internalClaims{}, func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fiber.NewError(401, "Invalid signing method")
}
return internalJWTSecret, nil
})

if err != nil || !token.Valid {
if err != nil {
return c.Status(401).JSON(fiber.Map{"error": "Invalid internal authentication"})
}

claims, ok := token.Claims.(jwt.MapClaims)
claims, ok := token.Claims.(*internalClaims)
if !ok {
return c.Status(401).JSON(fiber.Map{"error": "Invalid token claims"})
}

userID, _ := claims["user_id"].(string)
userRole, _ := claims["user_role"].(string)
tenantID, _ := claims["tenant_id"].(string)
userID := claims.UserID
userRole := claims.UserRole
tenantID := claims.TenantID

if tenantID == "" {
tenantID = "default"
Expand Down
4 changes: 4 additions & 0 deletions services/leave-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
Expand Down
19 changes: 13 additions & 6 deletions services/lms-service/middleware/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import (
"github.com/golang-jwt/jwt/v5"
)

type internalClaims struct {
jwt.RegisteredClaims
UserID string `json:"user_id"`
UserRole string `json:"user_role"`
TenantID string `json:"tenant_id"`
}

var internalJWTSecret []byte

func InitAuth() {
Expand All @@ -29,25 +36,25 @@ func AuthMiddleware() fiber.Handler {
return c.Status(401).JSON(fiber.Map{"error": "Missing internal authentication"})
}

token, err := jwt.Parse(internalToken, func(token *jwt.Token) (interface{}, error) {
token, err := jwt.ParseWithClaims(internalToken, &internalClaims{}, func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fiber.NewError(401, "Invalid signing method")
}
return internalJWTSecret, nil
})

if err != nil || !token.Valid {
if err != nil {
return c.Status(401).JSON(fiber.Map{"error": "Invalid internal authentication"})
}

claims, ok := token.Claims.(jwt.MapClaims)
claims, ok := token.Claims.(*internalClaims)
if !ok {
return c.Status(401).JSON(fiber.Map{"error": "Invalid token claims"})
}

userID, _ := claims["user_id"].(string)
userRole, _ := claims["user_role"].(string)
tenantID, _ := claims["tenant_id"].(string)
userID := claims.UserID
userRole := claims.UserRole
tenantID := claims.TenantID

if tenantID == "" {
tenantID = "default"
Expand Down
34 changes: 22 additions & 12 deletions services/notification-go-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,22 @@ var (
mutex = &sync.Mutex{}
)

func validateJWT(tokenString string) (jwt.MapClaims, error) {
type wsClaims struct {
jwt.RegisteredClaims
TenantID string `json:"tenant_id"`
}

type internalAuthClaims struct {
jwt.RegisteredClaims
TenantID string `json:"tenant_id"`
}

func validateJWT(tokenString string) (*wsClaims, error) {
secret := os.Getenv("JWT_SECRET")
if secret == "" {
return nil, fmt.Errorf("JWT_SECRET not configured")
}
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
token, err := jwt.ParseWithClaims(tokenString, &wsClaims{}, func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
}
Expand All @@ -124,10 +134,11 @@ func validateJWT(tokenString string) (jwt.MapClaims, error) {
if err != nil {
return nil, err
}
if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid {
return claims, nil
claims, ok := token.Claims.(*wsClaims)
if !ok {
return nil, fmt.Errorf("invalid token claims")
}
return nil, fmt.Errorf("invalid token")
return claims, nil
}

func internalAuthMiddleware(next http.HandlerFunc) http.HandlerFunc {
Expand All @@ -144,27 +155,26 @@ func internalAuthMiddleware(next http.HandlerFunc) http.HandlerFunc {
return
}

token, err := jwt.Parse(internalToken, func(token *jwt.Token) (interface{}, error) {
token, err := jwt.ParseWithClaims(internalToken, &internalAuthClaims{}, func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
}
return []byte(internalKey), nil
})

if err != nil || !token.Valid {
if err != nil {
http.Error(w, `{"error":"Invalid internal authentication"}`, http.StatusUnauthorized)
return
}

claims, ok := token.Claims.(jwt.MapClaims)
claims, ok := token.Claims.(*internalAuthClaims)
if !ok {
http.Error(w, `{"error":"Invalid token claims"}`, http.StatusUnauthorized)
return
}

tenantID, _ := claims["tenant_id"].(string)
if tenantID != "" {
r.Header.Set("X-Tenant-Id", tenantID)
if claims.TenantID != "" {
r.Header.Set("X-Tenant-Id", claims.TenantID)
}

next(w, r)
Expand Down Expand Up @@ -236,7 +246,7 @@ func handleConnections(w http.ResponseWriter, r *http.Request) {
return
}

tenantID, _ := claims["tenant_id"].(string)
tenantID := claims.TenantID
if tenantID == "" {
tenantID = "default"
}
Expand Down
4 changes: 4 additions & 0 deletions services/payroll-java-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions services/performance-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
Expand Down
Loading