Resolve import cycles and migrate to chorus.services module path

This comprehensive refactoring addresses critical architectural issues:

IMPORT CYCLE RESOLUTION:
• pkg/crypto ↔ pkg/slurp/roles: Created pkg/security/access_levels.go
• pkg/ucxl → pkg/dht: Created pkg/storage/interfaces.go
• pkg/slurp/leader → pkg/election → pkg/slurp/storage: Moved types to pkg/election/interfaces.go

MODULE PATH MIGRATION:
• Changed from github.com/anthonyrawlins/bzzz to chorus.services/bzzz
• Updated all import statements across 115+ files
• Maintains compatibility while removing personal GitHub account dependency

TYPE SYSTEM IMPROVEMENTS:
• Resolved duplicate type declarations in crypto package
• Added missing type definitions (RoleStatus, TimeRestrictions, KeyStatus, KeyRotationResult)
• Proper interface segregation to prevent future cycles

ARCHITECTURAL BENEFITS:
• Build now progresses past structural issues to normal dependency resolution
• Cleaner separation of concerns between packages
• Eliminates circular dependencies that prevented compilation
• Establishes foundation for scalable codebase growth

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-17 10:04:25 +10:00
parent e9252ccddc
commit d96c931a29
115 changed files with 1010 additions and 534 deletions

View File

@@ -30,9 +30,10 @@ import (
"sync"
"time"
"github.com/anthonyrawlins/bzzz/pkg/config"
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
"github.com/anthonyrawlins/bzzz/pkg/slurp/roles"
"chorus.services/bzzz/pkg/config"
"chorus.services/bzzz/pkg/security"
"chorus.services/bzzz/pkg/ucxl"
"chorus.services/bzzz/pkg/slurp/roles"
)
// AccessControlMatrix implements sophisticated access control enforcement
@@ -138,6 +139,26 @@ const (
RoleTypeEmergency RoleType = "emergency" // Emergency access role
)
// RoleStatus represents the status of a role
type RoleStatus string
const (
RoleStatusActive RoleStatus = "active" // Role is active and usable
RoleStatusInactive RoleStatus = "inactive" // Role is inactive
RoleStatusSuspended RoleStatus = "suspended" // Role is temporarily suspended
RoleStatusRevoked RoleStatus = "revoked" // Role has been revoked
RoleStatusPending RoleStatus = "pending" // Role is pending approval
)
// TimeRestrictions represents time-based access restrictions
type TimeRestrictions struct {
AllowedHours []int `json:"allowed_hours"` // 0-23 allowed hours
AllowedDays []time.Weekday `json:"allowed_days"` // Allowed days of week
AllowedTimeZone string `json:"allowed_timezone"` // Timezone for restrictions
StartDate *time.Time `json:"start_date"` // Role start date
EndDate *time.Time `json:"end_date"` // Role end date
}
// Delegation represents role delegation
type Delegation struct {
DelegationID string `json:"delegation_id"`
@@ -824,7 +845,7 @@ func NewRoleHierarchy(cfg *config.Config) (*RoleHierarchy, error) {
role := &Role{
ID: roleID,
Name: configRole.Name,
Description: configRole.Description,
Description: configRole.Name, // Use Name as Description since Description field doesn't exist
Type: RoleTypeStandard,
Status: RoleStatusActive,
DirectPermissions: []string{},