core/auth/public_users.go
Alex Dunmow 917eee13a2 feat: add menus, subscriptions, public users, and plugin bridge to SDK
New capability interfaces:
- menus.Menus: menu/nav access (GetMenuByName, GetMenuItems)
- subscriptions.Subscriptions: tier/plan access (GetUserTierLevel, GetTierBySlug, ListActivePlans)
- auth.PublicUsers: public user profiles (GetByUsername, GetByID)
- plugin.PluginBridge: inter-plugin service registry with typed GetServiceAs[T] helper

All added to ServiceDeps for plugin consumption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 12:36:13 +08:00

26 lines
597 B
Go

package auth
import (
"context"
"github.com/google/uuid"
)
// PublicUsers provides public/community user profile access for plugins.
type PublicUsers interface {
GetByUsername(ctx context.Context, username string) (*PublicUserProfile, error)
GetByID(ctx context.Context, id uuid.UUID) (*PublicUserProfile, error)
}
// PublicUserProfile is a plugin-facing view of a public user.
type PublicUserProfile struct {
ID uuid.UUID
Email string
Username string
DisplayName string
AvatarURL string
Bio string
EmailVerified bool
Role string
}