Conversation
Owner
Author
|
Hey hey, nice catch. I fixed the authorization bug on the service and now it has a normal looking response body :D |
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.

Task 7 - Authorization Service Implementation
Overview
Implemented a complete authorization system for the Import Service with Basic Authentication, including Lambda authorizer, API Gateway integration, and client-side authorization handling.
Tasks Completed
Task 7.1 - Authorization Service Setup ✅
Backend Structure
Created authorization-service at the same level as product-service and import-service:
Environment Configuration
.envfile with credentials:damirstan=TEST_PASSWORD.envto.gitignoreto prevent credentials exposure.envfile during deploymentLambda Implementation
basicAuthorizerlambda function with:Task 7.2 - Import Service Authorization Integration ✅
API Gateway Configuration
/importendpoint with CUSTOM authorization typeEnvironment Variable Loading
env-loader.tsto read.envfile dynamicallyTask 7.3 - Client Application Integration ✅
Authorization Service
AuthServicewith:damirstan:TEST_PASSWORD→ Base64)authorization_tokenkey)HTTP Interceptor
AuthInterceptorto automatically add Authorization headers to/importrequestsError Handling
ErrorPrintInterceptorwith specific 401/403 alertsTechnical Implementation Details
Backend Changes
Authorization Service (
infra/lib/authorization-service/)Import Service Stack Updates (
infra/lib/import-service/import-service-stack.ts)Frontend Changes
Authorization Service (
FE/src/app/core/auth.service.ts)Auth Interceptor (
FE/src/app/core/interceptors/auth.interceptor.ts)Error Handling (
FE/src/app/core/interceptors/error-print.interceptor.ts)Deployment & Testing
Infrastructure Deployment
.envfileTesting Results
All authorization scenarios tested and verified:
API Endpoints
https://duivy9lb5sq2a.cloudfront.nethttps://i6nl249ace.execute-api.us-east-1.amazonaws.com/prod/importEvaluation Criteria Compliance
Authorization Service Setup (40/40 points) ✅
Import Service Authorization Integration (20/20 points) ✅
Client Application Update (20/20 points) ✅
Enhancements (20/20 points) ✅
Total Score: 100/100 points ✅
Security Considerations
.envfile.envfile gitignored to prevent exposureFiles Changed
Backend
infra/lib/authorization-service/(new directory)handler.ts- Basic Authorizer Lambdapackage.json- Dependencies.env- Environment variables (gitignored)infra/lib/import-service/import-service-stack.ts- Updated with authorizerinfra/lib/import-service/env-loader.ts- Environment variable loaderinfra/.gitignore- Added.envpatternFrontend
FE/src/app/core/auth.service.ts(new) - Authorization serviceFE/src/app/core/interceptors/auth.interceptor.ts(new) - HTTP auth interceptorFE/src/app/core/interceptors/error-print.interceptor.ts- Enhanced error handlingFE/src/main.ts- Registered auth interceptorFE/src/app/app.component.ts- Initialize auth serviceBranch Information
task-7This implementation provides a complete, secure, and production-ready authorization system that meets all evaluation criteria and follows AWS security best practices.