Repository navigation
feat: domain provider role - #47
Merged
Merged
Conversation
- Add 'domain_provider' to users role CHECK constraint with migration for existing databases - New adminAssignDomainProvider function: admin-only, assigns or removes a domain provider by linking provider_user_id/email on Domain entity; enforces that the target user already has the domain_provider role before assignment - New /api/domain-provider/stats and /api/domain-provider/domains routes: returns per-domain and total stats (active subdomains, pending requests, DNS records, new requests in 7 days) scoped to the authenticated provider; admins can query any provider via ?user_id= - entity-routes: domain providers see record_count and last_synced for their assigned domains (zone_id, nameservers, notes still redacted) - rootminsterClient: domainProvider.stats() and domainProvider.domains() API - DomainProviderDashboard page: stat cards, per-domain breakdown, refresh - AdminUsers: domain_provider badge (emerald), 'Domain Provider' action button for user-role accounts, demote path, Domain Providers count in stats bar - AdminDomains: 'Assign/Provider' button per domain opens a modal that lists domain_provider users and shows/removes the current assignment - App.jsx: /domain-provider-dashboard route protected by domain_provider|admin - Layout.jsx: 'Domain Provider' sidebar section and command palette entry Validated: eslint clean, 309/309 tests pass, production build emits 0 source maps
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.
Domain Provider Role
Adds a new
domain_providerrole for users who donate a domain for use on the platform.How it works
Role assignment (admin-only):
domain_providerroleuseris also supported via the existing "Demote" buttonDomain provider experience:
/domain-provider-dashboardpage shows real-time stats: active subdomains, pending requests, DNS record count, new requests in the past 7 days — broken down per domainChanges
Backend
schema.sql:domain_provideradded to role CHECK constraint with idempotent migration block for existing databasesserver/functions/adminAssignDomainProvider.js: assigns/removesprovider_user_id/provider_user_email/provider_assigned_aton Domain entity; validates the target user hasdomain_providerrole before linking; writes AuditLog entries for both assign and unassignserver/domain-provider-routes.js:GET /api/domain-provider/statsandGET /api/domain-provider/domains— scoped to the authenticated provider, admins can query any provider via?user_id=server/entity-routes.js: domain providers seerecord_countandlast_syncedfor their own domain; zone_id and other infra fields still redactedserver/function-runner.js: registersadminAssignDomainProviderserver/index.js: registers domain provider routesFrontend
src/pages/DomainProviderDashboard.jsx: new page with stat cards (totals) and per-domain breakdown cardssrc/pages/AdminUsers.jsx: domain_provider badge (emerald), "Domain Provider" action button for plain users, demote path, Domain Providers count statsrc/pages/AdminDomains.jsx: "Assign/Provider" button per domain row opens modal showing current provider + list of domain_provider users to assign; remove provider buttonsrc/api/rootminsterClient.js:domainProvider.stats()anddomainProvider.domains()src/App.jsx:/domain-provider-dashboardroute protected bydomain_provider|adminsrc/components/Layout.jsx: Domain Provider sidebar section and command palette entryValidation