Skip to content

Implement Authentication System with JWT, gRPC API, and Configuration Management - #7

Merged
RD2W merged 2 commits into
devfrom
feature/auth-study
Nov 19, 2025
Merged

Implement Authentication System with JWT, gRPC API, and Configuration Management#7
RD2W merged 2 commits into
devfrom
feature/auth-study

Conversation

@RD2W

@RD2W RD2W commented Nov 12, 2025

Copy link
Copy Markdown
Owner

This PR implements a comprehensive authentication system with JWT tokens, adds configuration management using TOML files, and creates gRPC API definitions for authentication services. The changes include new modules for authentication, configuration handling, and gRPC services, along with updates to existing components to support the new features.

New Features

  • Authentication System: Complete JWT-based authentication with login, logout, refresh, and token validation endpoints
  • Configuration Management: TOML-based configuration with environment variable overrides
  • gRPC API: Protocol buffer definitions for authentication, notes, and user services
  • Token Management: Secure token creation, validation, and revocation mechanisms
  • Security Features: Password hashing, token blacklisting, and configurable security parameters

Configuration

The application now supports configuration through TOML files with the following sections:

  • Server settings (port, timeouts)
  • JWT configuration (secret keys, token TTL)
  • Database settings (PostgreSQL, Redis)
  • Security parameters (password requirements, login attempts)
  • Shutdown parameters (graceful shutdown timeout)

Security Features

  • JWT token-based authentication
  • Token refresh mechanism
  • Token revocation and blacklisting
  • Secure password hashing
  • Configurable security parameters
  • Rate limiting for login attempts

API Endpoints

  • HTTP endpoints: /api/auth/login, /api/auth/logout, /api/auth/refresh, /api/auth/validate
  • gRPC services: AuthService, NotesService, UserService
  • Protected endpoints using authentication middleware

Testing

  • Unit tests for authentication components
  • Token management tests
  • Authentication middleware tests
  • gRPC server tests

Dependencies Added

  • JWT handling libraries
  • Configuration parsing libraries
  • gRPC and Protocol Buffers
  • Additional testing utilities

Comment thread internal/auth/token_manager.go
@RD2W
RD2W merged commit 270df0e into dev Nov 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants