Fix: Support ABAC-enabled registries
Summary
- Removed wildcard repository scopes (
repository:*:*) that are incompatible with ABAC-enabled registries - Implemented repository-specific token scoping for all repository operations
- Maintained catalog access with
registry:catalog:*scope only
Changes
- Modified initial authentication to only request
registry:catalog:*scope - Updated token refresh to use repository-specific scopes (
repository:<name>:*) for each operation - Added helper functions
refreshTokenForRepositoryandrefreshTokenForCatalogfor cleaner scope management - Updated all repository operation methods to request appropriate scopes
Test Plan
- [x] Run existing unit tests (
go test ./internal/api/...) - [x] Run command tests (
go test ./cmd/acr/...) - [x] Build binary successfully (
go build) - [x] Manual testing with ABAC-enabled registry
- [x] Manual testing with regular (non-ABAC) registry
- [ ] Verify
acr purgecommand works with identity having full data plane permissions
Fixes #501
Hi Team,
@balcsida thank you for working on this. My team encountered this blocker 3 months ago while implementing ACR tasks on an ABAC-enabled repo. I previously discussed this with @johnsonshi via email, and I appreciate the quick response in logging the issue.
As our team is eager to utilize this feature, could you provide an estimate on when this PR might be merged?
Thanks again for the hard work on this fix!🙏🏽
Hi @vipin-vd, our engineer @lizMSFT is currently out of office and will be back in 2 weeks. I'll coordinate with @lizMSFT once she is back from vacation. FYI @feynmanzhou and @huanwu
Hi @balcsida , @vipin-vd , we will plan a new release of v0.18 for acr-cli once this PR along with @lizMSFT 's enhancement are merged.
what is the ETA for the fix?
Duplicate of #577