Skip to content
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

[r/boards] initialize UserDirectory #3144

Open
7 tasks
salmad3 opened this issue Nov 18, 2024 · 0 comments
Open
7 tasks

[r/boards] initialize UserDirectory #3144

salmad3 opened this issue Nov 18, 2024 · 0 comments

Comments

@salmad3
Copy link
Member

salmad3 commented Nov 18, 2024

Context:

The UserDirectory is intended to serve as an interface or mechanism for looking up and managing user data within the r/boards realm. This would integrate with the /r/gnoland/users realm, which is responsible for managing user accounts, usernames, and potentially team names. The UserDirectory helps link board operations (like creating, posting, and membership management) with verified user data, facilitating consistency and access control.

Acceptance Criteria:

  • Implements the UserDirectory interface with the following core methods:

    • Lookup(addr Address) User: Retrieves the User object associated with a specific address.
    • GetUserName(addr Address) string: Returns the display name (username) for the given address.
    • GetUserRole(addr Address) []string: Provides a list of roles associated with the given address (e.g., Owner, Admin, Moderator).

    Example
    type UserDirectory interface {
        Lookup(addr Address) User
        GetUserName(addr Address) string
        GetUserRole(addr Address) []string
    }
  • Integrate UserDirectory with the Board struct to ensure user-related data is accessible for board operations.

    Example
    type Board struct {
        ID            int64
        Name          string
        Creator       Address
        UserDirectory UserDirectory
    }
  • Ensures UserDirectory validates users during board operations to confirm that only recognized users can create boards, post, or manage members.

  • UserDirectory can adapt to potential for future integration with external or federated user sources.

  • Optimizes user lookup processes to handle frequent queries efficiently and mitigate potential performance bottlenecks.

  • Includes error handling for cases where a user address is not found or roles cannot be determined.

  • Implements integration tests for user lookups, role checks, and validations within r/boards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant