[WIP] Add documentation for Maestro permissions system#151
Closed
Copilot wants to merge 1 commit into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
User requests a full write-up explaining how the permissions system works in Maestro, detailed enough to recreate a similar system from scratch with comparable functionality. Repository explicitly provided: callstackincubator/voltra on ref main. Create a pull request that adds documentation covering:
all/ grant-all flow.If code/docs changes are needed, add or update documentation files in the repository accordingly.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Find the logic responsible for granting permissions for iOS and Android. I'm interested in the 'grantAll' flow - is there a predefined set of permissions? What are the CLI commands executed by the permissions API?
Assistant: The permission-granting logic lives mostly in
maestro-client/for Android and inmaestro-ios-driver/+maestro-ios/+ the XCTest runner for iOS. ForgrantAll/all, yes, there is a predefined set of permissions, but it is different per platform and per iOS execution path.Also: the code-search tool only returned a limited subset of matches, so these results may be incomplete. You can inspect more in GitHub code search here:
https://github.com/search?q=repo%3Amobile-dev-inc%2FMaestro+grantAll+OR+permissions+OR+grantPermission&type=code.Where
all/ “grant all” is triggeredWhen
launchAppruns without explicit permissions, Maestro defaults to:So the “grantAll” behavior is effectively
mapOf("all" to "allow").There is also a direct
setPermissionscommand path:Android: predefined permission set and CLI commands
The Android implementation is in:
maestro-client/src/main/java/maestro/drivers/AndroidDriver.ktIs there a predefined set for
all?Yes. Android expands friendly names and also appears to treat
"all"specially earlier in the permission collection flow, then iterates the resulting permission list and callssetPermissionInternal(...). The key execution path is:And for app-ops based permissions: