Package Registry Guest Access Control Enhancement
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Enhance package registry access controls by extending the existing package_registry_access_level setting to support granular guest access permissions for private projects, providing alignment between GitLab.com and self-managed instances without introducing breaking changes.
Background
- Currently, GitLab.com does not allow guest users to pull packages from private projects
- Self-managed instances support this functionality via internal projects
- Need to align behavior while respecting customer preferences and avoiding breaking changes
- Performance considerations at scale are critical
Proposal
Extend the existing package_registry_access_level setting to include a new state:
- Current states:
DISABLED,PUBLIC - New state:
ENABLED(allows project-viewable users, including guests, to pull packages)
Key Benefits
-
No Breaking Changes
- Maintains current default behavior for existing projects
- Introduces new functionality as an opt-in feature
- Eliminates need for complex migration planning
-
Platform Flexibility
- Leverages existing infrastructure
- Maintains consistent behavior across GitLab.com and self-managed
- Supports future extensibility for group-level controls
-
Performance Considerations
- Uses existing database schema
- Minimal impact on query complexity
- Scalable approach compared to feature flags
-
Enhanced Control
- Project-level granularity
- Explicit opt-in for enhanced access
- Clear security boundaries
Technical Implementation
Phase 1: Project Level
-
UI Changes
- Convert existing toggle to select dropdown
- Options: Disabled, Public, Guest Pull
- Clear documentation of each option's impact
-
Backend Changes
- Extend
package_registry_access_levelenum withENABLEDstate - Update permission evaluation logic
- Add new policy checks for guest access
- Extend
Phase 2: Group Level
-
Package Finder Updates
- Enhance finders to respect new access level
- Optimize queries for performance
- Add caching where appropriate
-
Group Policy Integration
- Support inheritance rules
- Maintain performance at scale
- Consider future group-level toggle
Performance Considerations
-
Database Impact
- No schema changes required
- Leverage existing indexes
- Monitor query performance
-
Caching Strategy
- Utilize existing cache mechanisms
- Consider additional caching layers
- Plan for cache invalidation
Security Considerations
-
Access Control
- Maintain strict permission boundaries
- Clear audit logging
- Explicit opt-in only
-
Visibility
- Empty repository view for guests
- Clear UI indicators of access levels
- Audit trail of changes
Migration Path
-
For GitLab.com
- Default to current behavior
- Allow opt-in via UI
- No forced changes
-
For Self-Managed
- Maintain existing functionality
- Provide upgrade path
- Document new capabilities
Next Steps
-
Technical Review
-
Review database impact -
Assess caching strategy -
Validate permission model
-
-
Implementation Planning
-
Define implementation phases -
Set performance benchmarks -
Plan monitoring strategy
-
-
Documentation
-
Update technical docs -
Create UI/UX guidelines -
Prepare admin guides
-
Questions to Address
- Performance impact at scale for large groups
- Caching strategy for permission checks
- Future group-level control requirements
- Monitoring and alerting needs