-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Auth 인증/인가 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Docstrings generation was requested by @ImGdevel. * #5 (comment) The following files were modified: * `ProjectVG.Api/ApiServiceCollectionExtensions.cs` * `ProjectVG.Api/Controllers/AuthController.cs` * `ProjectVG.Api/Controllers/ChatController.cs` * `ProjectVG.Api/Controllers/OAuthController.cs` * `ProjectVG.Api/Filters/JwtAuthenticationFilter.cs` * `ProjectVG.Api/Middleware/GlobalExceptionHandler.cs` * `ProjectVG.Api/Middleware/WebSocketMiddleware.cs` * `ProjectVG.Api/Models/Auth/Request/RegisterRequest.cs` * `ProjectVG.Application/ApplicationServiceCollectionExtensions.cs` * `ProjectVG.Application/Models/Chat/ChatMessageSegment.cs` * `ProjectVG.Application/Models/Chat/ChatProcessContext.cs` * `ProjectVG.Application/Models/Chat/ProcessChatCommand.cs` * `ProjectVG.Application/Models/Chat/UserInputAnalysis.cs` * `ProjectVG.Application/Models/User/UserDto.cs` * `ProjectVG.Application/Services/Auth/AuthService.cs` * `ProjectVG.Application/Services/Auth/IAuthService.cs` * `ProjectVG.Application/Services/Auth/IOAuth2Provider.cs` * `ProjectVG.Application/Services/Auth/IOAuth2Service.cs` * `ProjectVG.Application/Services/Auth/OAuth2ProviderFactory.cs` * `ProjectVG.Application/Services/Auth/OAuth2Service.cs` * `ProjectVG.Application/Services/Auth/Providers/AppleOAuth2Provider.cs` * `ProjectVG.Application/Services/Auth/Providers/GoogleOAuth2Provider.cs` * `ProjectVG.Application/Services/Chat/ChatService.cs` * `ProjectVG.Application/Services/Chat/CostTracking/ChatMetricsService.cs` * `ProjectVG.Application/Services/Chat/CostTracking/CostTrackingDecorator.cs` * `ProjectVG.Application/Services/Chat/CostTracking/CostTrackingDecoratorFactory.cs` * `ProjectVG.Application/Services/Chat/CostTracking/IChatMetricsService.cs` * `ProjectVG.Application/Services/Chat/CostTracking/ICostTrackingDecorator.cs` * `ProjectVG.Application/Services/Chat/Factories/ChatLLMFormat.cs` * `ProjectVG.Application/Services/Chat/Factories/ILLMFormat.cs` * `ProjectVG.Application/Services/Chat/Factories/UserInputAnalysisLLMFormat.cs` * `ProjectVG.Application/Services/Chat/Handlers/ChatFailureHandler.cs` * `ProjectVG.Application/Services/Chat/Preprocessors/MemoryContextPreprocessor.cs` * `ProjectVG.Application/Services/Chat/Preprocessors/UserInputAnalysisProcessor.cs` * `ProjectVG.Application/Services/Chat/Processors/ChatLLMProcessor.cs` * `ProjectVG.Application/Services/Chat/Processors/ChatResultProcessor.cs` * `ProjectVG.Application/Services/Chat/Processors/ChatTTSProcessor.cs` * `ProjectVG.Application/Services/Chat/Validators/ChatRequestValidator.cs` * `ProjectVG.Application/Services/Session/ConnectionRegistry.cs` * `ProjectVG.Application/Services/Session/IConnectionRegistry.cs` * `ProjectVG.Application/Services/User/IUserService.cs` * `ProjectVG.Application/Services/User/UserService.cs` * `ProjectVG.Application/Services/WebSocket/IWebSocketManager.cs` * `ProjectVG.Application/Services/WebSocket/WebSocketManager.cs` * `ProjectVG.Common/Constants/ErrorCodes.cs` * `ProjectVG.Common/Constants/LLMModelInfo.cs` * `ProjectVG.Common/Constants/TTSCostInfo.cs` * `ProjectVG.Common/Exceptions/AuthenticationException.cs` * `ProjectVG.Common/Exceptions/ValidationException.cs` * `ProjectVG.Common/Models/Session/IClientConnection.cs` * `ProjectVG.Common/Utils/UidGenerator.cs` * `ProjectVG.Infrastructure/Auth/IRefreshTokenStorage.cs` * `ProjectVG.Infrastructure/Auth/ITokenService.cs` * `ProjectVG.Infrastructure/Auth/InMemoryRefreshTokenStorage.cs` * `ProjectVG.Infrastructure/Auth/JwtProvider.cs` * `ProjectVG.Infrastructure/Auth/JwtService.cs` * `ProjectVG.Infrastructure/Auth/RedisRefreshTokenStorage.cs` * `ProjectVG.Infrastructure/Auth/TokenService.cs` * `ProjectVG.Infrastructure/InfrastructureServiceCollectionExtensions.cs` * `ProjectVG.Infrastructure/Integrations/LLMClient/LLMClient.cs` * `ProjectVG.Infrastructure/Integrations/MemoryClient/IMemoryClient.cs` * `ProjectVG.Infrastructure/Integrations/MemoryClient/VectorMemoryClient.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Data/ProjectVGDbContext.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825023623_AddUIDToUser.Designer.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825023623_AddUIDToUser.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825023833_AddUIDToUserTable.Designer.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825023833_AddUIDToUserTable.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825023955_AddUIDFieldToUser.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825051022_UpdateUserEntityWithUIDAndStatus.Designer.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825135004_IncreaseUIDLength.Designer.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/20250825135004_IncreaseUIDLength.cs` * `ProjectVG.Infrastructure/Persistence/EfCore/Migrations/ProjectVGDbContextModelSnapshot.cs` * `ProjectVG.Infrastructure/Persistence/Repositories/Character/SqlServerCharacterRepository.cs` * `ProjectVG.Infrastructure/Persistence/Repositories/User/IUserRepository.cs` * `ProjectVG.Infrastructure/Persistence/Repositories/User/SqlServerUserRepository.cs` * `ProjectVG.Infrastructure/Persistence/Session/InMemorySessionStorage.cs` * `ProjectVG.Infrastructure/Realtime/WebSocketConnection/WebSocketClientConnection.cs` * `test-clients/start-oauth2-client.py`
📝 Add docstrings to `feature/auth`
|
Caution Review failedThe pull request is closed. WalkthroughOAuth2 authentication flow is implemented with new controller endpoints and service logic. Chat and user subsystems gain new helpers and behavioral tweaks (cost tracking via reflection, result persistence, UID generation, repository filters). Token issuance/refresh/revocation is completed. EF Core model configuration and seed data are expanded. Numerous XML docs were added. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant OAuthController
participant OAuth2Service
participant Provider as OAuth2 Provider
participant AuthService
participant TokenStore as RefreshTokenStorage
rect rgb(245,248,255)
note over Client,OAuthController: Authorization (PKCE)
Client->>OAuthController: GET /auth/oauth2/authorize?provider&state&code_challenge&code_challenge_method=S256
OAuthController->>OAuth2Service: BuildAuthorizationUrlAsync(...)
OAuth2Service-->>OAuthController: auth_url
OAuthController-->>Client: { auth_url }
end
rect rgb(245,255,245)
note over Client,Provider: User authorizes
Client->>Provider: Open auth_url
Provider-->>OAuthController: GET /auth/oauth2/callback?code&state
OAuthController->>OAuth2Service: HandleOAuth2CallbackAsync(code,state)
OAuth2Service->>Provider: ExchangeAuthorizationCodeAsync
Provider-->>OAuth2Service: tokens
OAuth2Service->>Provider: GetUserInfoAsync
Provider-->>OAuth2Service: user info
OAuth2Service->>AuthService: LoginWithOAuthAsync(...)
AuthService-->>OAuth2Service: AuthResult (access/refresh)
OAuth2Service->>TokenStore: StoreTokenDataAsync(state, tokens)
OAuth2Service-->>OAuthController: RedirectUrl
OAuthController-->>Client: 302 Redirect
end
rect rgb(255,249,243)
note over Client,OAuthController: Token retrieval
Client->>OAuthController: GET /auth/oauth2/token?state
OAuthController->>OAuth2Service: GetTokenDataAsync(state)
OAuth2Service-->>OAuthController: tokens
OAuthController->>OAuth2Service: DeleteTokenDataAsync(state)
OAuthController-->>Client: 200 + headers (X-Access-Token, X-Refresh-Token,...)
end
sequenceDiagram
autonumber
participant Caller as ChatComponent
participant Decorator as CostTrackingDecorator<T>
participant Inner as Wrapped Service
participant Metrics as ChatMetricsService
rect rgb(245,248,255)
note over Decorator,Inner: Reflection-based delegation
Caller->>Decorator: ProcessAsync(context)
Decorator->>Metrics: StartProcessMetrics(processName)
Decorator->>Inner: Invoke via reflection (ProcessAsync)
Inner-->>Decorator: Task completes
Decorator->>Decorator: ExtractCost(context/result)
Decorator->>Metrics: EndProcessMetrics(cost)
Decorator-->>Caller: return
end
alt Error
Decorator->>Metrics: EndProcessMetrics(cost=0, errorMessage)
Decorator-->>Caller: rethrow
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit