rdev/internal/port/notify_provisioner.go
jordan 4f01015132
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: implement project access enforcement and management API
- Fix no-op RequireProjectAccess middleware to enforce project_ids
- Apply project access middleware to all project-scoped routes
- Filter GET /projects by allowed project IDs for restricted keys
- Add GET /me endpoint with key identity, scopes, and project access info
- Add PATCH /keys/{id} for partial key updates (name, scopes, project_ids, allowed_ips, expires_in)
- Add GET/POST/DELETE /projects/{id}/access for project-centric access management
- Auto-grant creating key access when using POST /project/create-and-build
- Accept grant_to_key_ids in create-and-build to grant multiple keys on project creation
- Move newProvisionerWithDeps test helper from production code to test file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 15:38:37 -07:00

27 lines
1.1 KiB
Go

package port
import (
"context"
"github.com/orchard9/rdev/internal/domain"
)
// NotifyProvisioner manages per-project email delivery on the notify service.
// Each project gets its own isolated sending host (mail.{slug}.threesix.ai),
// Resend domain with DKIM/SPF, and a dedicated notify account with send key.
type NotifyProvisioner interface {
// CreateProjectNotify provisions a notify host, Resend domain, DNS records,
// and account with send key for the project.
CreateProjectNotify(ctx context.Context, projectID, slug string) (*domain.NotifyCredentials, error)
// DeleteProjectNotify removes all notify resources for a project:
// the notify account, the per-project host, the Resend domain, and DNS records.
DeleteProjectNotify(ctx context.Context, projectID, slug, resendDomainID string) error
// GetProjectNotify returns notify credentials for a project, or nil if not provisioned.
GetProjectNotify(ctx context.Context, projectID string) (*domain.NotifyCredentials, error)
// TestConnection verifies the admin API key and notify service are reachable.
TestConnection(ctx context.Context) error
}