Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add comprehensive documentation and examples for user identification architecture#17

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-92cc1f10-3036-422e-a9bc-46e4ced41ddb

Conversation

Copy link

CopilotAI commentedOct 2, 2025
edited
Loading

This PR addresses the question about where user identification is positioned and implemented in this Vertical Slice Architecture by providing comprehensive documentation and working examples.

Changes Made

📚New Documentation

  • docs/UserIdentificationArchitecture.md - Complete guide explaining how user identification works in this architecture, including:

    • Core infrastructure components (ICurrentUserService,AuthorizationBehaviour)
    • Authorization pipeline and audit integration
    • Current capabilities vs. what's missing (no auth system by design)
    • Implementation patterns and examples
  • docs/AddingAuthenticationExample.md - Step-by-step guide for implementing JWT authentication while following vertical slice patterns:

    • Complete working example with User entity, JWT service, login/register features
    • Configuration setup and testing approaches
    • Demonstrates how to extend the existing infrastructure

🔧Working Example

  • src/Application/Features/TodoLists/GetMyTodoLists.cs - New feature demonstrating:
    • Using[Authorize] attribute to protect endpoints
    • Accessing current user viaICurrentUserService
    • Filtering data by authenticated user
    • Following established vertical slice patterns

📖Updated README

Added new section linking to the documentation with overview of user identification capabilities.

Key Architectural Insights

The user identification system is positioned as across-cutting concern across multiple layers:

  1. Infrastructure Services -ICurrentUserService extracts user from HTTP context claims
  2. Pipeline Behaviors -AuthorizationBehaviour automatically enforces authentication for[Authorize] decorated requests
  3. Database Integration -ApplicationDbContext automatically populates audit fields (CreatedBy/LastModifiedBy)
  4. Feature Level - Individual features can access current user and implement authorization logic

Current State

The architecture provides all theinfrastructure for user identification but intentionally leaves the authentication mechanism flexible:

  • ✅ User identification plumbing is complete and ready
  • ✅ Authorization system works with[Authorize] attributes
  • ✅ Automatic audit trail for all entities
  • ✅ Testing infrastructure supports mocked users
  • 🔧 Authentication system is pluggable (JWT, Identity, external providers)

This design allows developers to choose their preferred authentication approach while leveraging the existing user identification infrastructure that automatically handles authorization, auditing, and user context throughout the application.

The new/api/my-todo-lists endpoint visible in Swagger demonstrates the system working - it's protected by authorization and filters results by the current user, showcasing how user identification integrates seamlessly with business logic.

Original prompt

This section details on the original issue you should resolve

<issue_title>identity</issue_title>
<issue_description>hi.
In this architecture , where is the position of user identification? In which part is it implemented?</issue_description>

Comments on the Issue (you are@copilot in this section)

Fixes#11

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

@coderabbitai
Copy link

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the@coderabbitai review command.

You can disable this status message by setting thereviews.review_status tofalse in the CodeRabbit configuration file.


Comment@coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: nadirbad <33620914+nadirbad@users.noreply.github.com>
CopilotAI changed the title[WIP] identityAdd comprehensive documentation and examples for user identification architectureOct 2, 2025
CopilotAI requested a review fromnadirbadOctober 2, 2025 13:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nadirbadnadirbadAwaiting requested review from nadirbad

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

identity

2 participants

@nadirbad

[8]ページ先頭

©2009-2025 Movatter.jp