betterNAS/apps/control-plane/cmd/control-plane/export_routes.go
Harivansh Rathi ed40da7326 Secure first-loop control-plane auth and mount routing.
Protect the control-plane API with explicit bearer auth, add node-scoped
registration/heartbeat credentials, and make export mount paths an explicit
contract field so mount profiles stay correct across runtimes.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-04-01 14:13:14 +00:00

23 lines
435 B
Go

package main
import (
"net/url"
"strings"
)
const (
defaultWebDAVPath = "/dav/"
nextcloudExportPagePrefix = "/apps/betternascontrolplane/exports/"
)
func mountProfilePathForExport(mountPath string) string {
if strings.TrimSpace(mountPath) == "" {
return defaultWebDAVPath
}
return mountPath
}
func cloudProfilePathForExport(exportID string) string {
return nextcloudExportPagePrefix + url.PathEscape(exportID)
}