Skip to content

Allow one app group on free teams - #284

Open
cesardev31 wants to merge 1 commit into
xtool-org:mainfrom
cesardev31:free-team-app-groups
Open

cesardev31 wants to merge 1 commit into
xtool-org:mainfrom
cesardev31:free-team-app-groups

Conversation

@cesardev31

@cesardev31 cesardev31 commented Sep 28, 2026 •

Copy link
Copy Markdown

What does this PR do?

Resolves the FIXME in DeveloperServicesCapability: App Groups are no longer filtered out on free teams, and DeveloperServicesAddAppOperation assigns at most one group per app on a free team (the constraint the FIXME mentioned).

Free teams can register and assign app groups through the Xcode DeveloperServices API (as AltStore/SideStore do), so a widget and its app can share UserDefaults(suiteName:) with a free Apple ID.

How was it tested?

Built on Linux from main (4d0c429). Installed a Flutter app with a WidgetKit extension on an iPhone (iOS 27.2) with a free Apple ID: the app gets group.XTL-<team>.<id> in its entitlements and the widget reads the app's data through it. make lint not run (no SwiftLint on this machine).

AI tool usage

How much of this PR was AI-assisted? (check one)

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Summary by CodeRabbit

  • Bug Fixes
    • App Groups are now available to free teams, with at most one group assigned per app.

Resolves the FIXME in DeveloperServicesCapability: free teams can register and assign app groups through the Xcode DeveloperServices API, so App Groups are no longer filtered out for them, and DeveloperServicesAddAppOperation assigns at most one group per app on a free team.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: eb282024-142a-4f0d-80e4-dbc5973a463b

📥 Commits

Reviewing files that changed from the base of the PR and between 4d0c429 and 887e958.

📒 Files selected for processing (2)
  • Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift
  • Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

App Groups are now marked as available to free teams. When an app is added for a free team, the operation passes at most the first group from its existing entitlement.

Changes

Free Team App Groups

Layer / File(s) Summary
Free-team capability and assignment
Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift, Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift
The capability declaration marks App Groups as available to free teams. App creation passes at most the first existing app-group entitlement for free teams, and passes all groups for other teams.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 887e9

The examined paths do not leave extra App Groups assigned or in the returned entitlement. No actionable merge-blocking issue remains after normal checks.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 887e9

Free teams gain an intended shared-data capability. The one-group limit is applied to each provisioning request, but it is unclear whether it remains effective when an existing app is provisioned again with a different group.

Retained concerns

  • Medium · security · inferred: The one-group limit constrains each free-team request, not demonstrably the app’s persisted group associations. Re-provisioning with a different group could leave an earlier association in place if the remote service does not replace or reject it.
Security review details

Security Blast Radius

  • inferred — The changed eligibility affects apps and extensions provisioned under a free team that request App Groups. The intended outcome is sharing data through a group entitlement; evidence does not establish cross-team reachability.

Security Findings and Attack Paths

  • inferred — An executable can request a different first group on a later provisioning run. The client submits that group but does not remove earlier app assignments; whether this results in excess effective access depends on remote assignment and profile-generation behavior, which is not established.

Trust Boundaries and Controls

  • observed — The assignment operation requires Xcode authentication, lists groups for the authenticated team, and uses that team ID in group creation and assignment requests. It still relies on the remote service to validate supplied app and group identifiers.

Resilience and Maintainability Implications

  • inferred — Limiting the submitted list to one makes ordinary AddApp requests narrower, but without known remote uniqueness or replacement semantics, retries and changed requests do not demonstrate an at-most-one persisted-assignment invariant.

Hardening Proposals

  • proposed — Establish the service’s assignment and profile semantics, then enforce or reconcile the one-group rule at the boundary that owns persisted app-group associations; account for retries and direct consumers of the existing public assignment operation.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: allowing one App Group on free teams.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

cesardev31 added a commit to cesardev31/xlinux that referenced this pull request Sep 28, 2026
The patch is now the diff of xtool-org/xtool#284: besides allowing App
Groups on free teams, it assigns at most one group per app, as the FIXME it
resolves asked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbkuTKpirPsGTLYJjm6UAB

@kabiroberai kabiroberai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, small suggestions

// but we need to always assign only one group
DeveloperServicesCapability(.appGroups, isFree: false)
// Free teams can use App Groups too; DeveloperServicesAddAppOperation
// assigns them at most one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this comment is unnecessary

let groupsEntitlement = entitlementsArray[groupsIdx] as? AppGroupEntitlement {
let groups = groupsEntitlement.rawValue
// Free teams get at most one app group per app.
let groups = isFreeTeam ? Array(groupsEntitlement.rawValue.prefix(1)) : groupsEntitlement.rawValue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer throwing if there's more than one group. using prefix(1) means the other groups will just silently fail to be created.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants