{"id":20744409,"url":"https://github.com/authpass/macos_secure_bookmarks","last_synced_at":"2025-04-24T05:46:17.781Z","repository":{"id":45216777,"uuid":"208426885","full_name":"authpass/macos_secure_bookmarks","owner":"authpass","description":"Flutter plugin to create secure bookmarks to keep access to files in sandboxed apps.","archived":false,"fork":false,"pushed_at":"2022-09-17T11:37:30.000Z","size":11788,"stargazers_count":15,"open_issues_count":9,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T05:46:10.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/authpass.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-14T10:52:20.000Z","updated_at":"2025-04-06T13:26:56.000Z","dependencies_parsed_at":"2022-08-04T12:45:36.239Z","dependency_job_id":null,"html_url":"https://github.com/authpass/macos_secure_bookmarks","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authpass%2Fmacos_secure_bookmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authpass%2Fmacos_secure_bookmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authpass%2Fmacos_secure_bookmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authpass%2Fmacos_secure_bookmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/authpass","download_url":"https://codeload.github.com/authpass/macos_secure_bookmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573345,"owners_count":21452345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T07:15:25.266Z","updated_at":"2025-04-24T05:46:17.762Z","avatar_url":"https://github.com/authpass.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macos_secure_bookmarks\n\n[![Pub](https://img.shields.io/pub/v/macos_secure_bookmarks?color=green)](https://pub.dev/packages/macos_secure_bookmarks)\n\nFlutter plugin to create secure bookmarks to keep access to files in sandboxed apps.\n\n\n## Usage\n\n* Check the [documentation on security-scoped bookmarks](https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16)\n* Make sure to [enable the necessary entitlements](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW18)\n    * com.apple.security.files.bookmarks.app-scope\n\n### Creating Security Scoped Bookmarks\n\n```dart\n// First let the user choose a file, e.g. using the file chooser plugin.\n\nshowOpenPanel((result, files) {\n  if (result != FileChooserResult.ok || files.isEmpty) {\n    return;\n  }\n  \n  // Now create a security scoped bookmark\n  final secureBookmarks = SecureBookmarks();\n  final bookmark = await secureBookmarks.bookmark(File(_file));\n  \n  // Now store the bookmark somewhere for later invocations\n});\n```\n\n### Resolving and accessing bookmarks\n\n```dart\n// resolve bookmark from persistet 'bookmark' string from earlier\nfinal resolvedFile = await _secureBookmarks.resolveBookmark(_bookmark);\n// resolved is now a File object, but before accessing it, call:\nawait startAccessingSecurityScopedResource(resolvedFile);\n\n// now read/write the file\n\n// and later give up access.\nawait stopAccessingSecurityScopedResource(resolvedFile);\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthpass%2Fmacos_secure_bookmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthpass%2Fmacos_secure_bookmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthpass%2Fmacos_secure_bookmarks/lists"}