Merged
Conversation
Introduces the core Identity and Access Management (IAM) service. Defines `auth/v1/auth.proto` with the `IAMService` gRPC interface, including methods for user registration, login, session validation (`Whoami`), and user retrieval. Also includes related message structures like `RegisterRequest`, `LoginResponse`, `NotificationMethod`, and `ProviderName` enum. Generates the corresponding Go Protobuf, gRPC, and validation code. Integrates the new `iam` module into the Go workspace. Removes redundant `common/v1/session.proto`, `common/v1/user.proto`, and `user/v1/user.proto` definitions, consolidating authentication and user management under the new `auth/v1` schema.
- Refactors the IAM service into distinct gRPC services for authentication (Login, Whoami) and user management (Register, GetUser). - Implements a comprehensive dependency injection (DI) container to manage application components such as PostgreSQL, Redis, repositories, and services. - Integrates Redis for efficient session management, leveraging a new platform-level Redis client. - Establishes a structured application lifecycle with graceful shutdown, centralized environment-based configuration, and a robust resource closing mechanism. - Introduces common protobuf definitions for `User` and `NotificationMethod` under `pkg/proto/common/v1` for reusability across services. - Updates PostgreSQL schema and migrations to include a `
Updates the gRPC service name from `AuthService` to `IAMService` for login and whoami operations within the integration tests. This change reflects a refactoring of the authentication service endpoint.
This commit applies consistent code formatting across the `iam` and `order` modules. Key changes include: * Reordering of import statements to maintain consistency. * Removal of `\ No newline at end of file` comments. * Minor whitespace and line-breaking adjustments for improved readability. * Simplified function parameter declarations (e.g., `param1, param2 string`). * Updates `order/go.mod` to reflect `goose/v3` as an indirect dependency.
Introduces authentication across services using a new IAM gRPC client and middleware. The Inventory service's gRPC server now authenticates incoming requests by validating a `session-uuid` from gRPC metadata with the IAM service. The Order service's HTTP API is updated to require an `X-Session-Uuid` header for all operations. A new HTTP middleware handles authentication by calling the IAM service and injecting user and session data into the request context. This session UUID is then forwarded to downstream gRPC calls, such as to the Inventory service, ensuring end-to-end session propagation. API consistency is improved by renaming the `order_uuid` path parameter to `uuid` in the OpenAPI specification and generated code. New configuration variables are added to specify IAM gRPC service addresses for both Inventory and Order services.
Enhances robustness by explicitly handling errors during JSON (un)marshalling of user notification methods and session management. Previously ignored errors now result in default values being set, with a placeholder for future logging, preventing silent failures. Reflects a protobuf field name change by updating `OrderUUID` to `UUID` in the `notification` service's order converter. Includes minor import statement reordering across `inventory` and `order` services for code consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.