- Added configuration options for Stalwart hosted mail in .env.example. - Updated Docker Compose to include Stalwart service with health checks. - Introduced new API endpoints for managing mail domains and migration projects. - Enhanced Authentik blueprints for user enrollment and post-migration security. - Updated OAuth handling for Google and Microsoft migration processes. - Improved error handling and response structures in the mail API. - Added integration tests for email claiming and migration workflows.
23 lines
477 B
Go
23 lines
477 B
Go
package migration
|
|
|
|
import (
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
func graphUserBase(userUPN string) string {
|
|
userUPN = strings.TrimSpace(userUPN)
|
|
if userUPN == "" {
|
|
return "/v1.0/me"
|
|
}
|
|
return "/v1.0/users/" + url.PathEscape(userUPN)
|
|
}
|
|
|
|
func graphMicrosoftURL(userUPN, suffix string) string {
|
|
suffix = strings.TrimSpace(suffix)
|
|
if suffix != "" && !strings.HasPrefix(suffix, "/") {
|
|
suffix = "/" + suffix
|
|
}
|
|
return "https://graph.microsoft.com" + graphUserBase(userUPN) + suffix
|
|
}
|