Skip to content

App platform/update permissions token auth #14046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2019

Conversation

MeredithAnya
Copy link
Member

@MeredithAnya MeredithAnya commented Jul 16, 2019

Problems:

SentryAppPermission does not have an attribute scope_map so we were using the default scope map in ScopedPermission - which is no scopes.

Because has_permission gets called before has_object_permission, both SentryAppPermission and SentryAppsPermission fail here:

allowed_scopes = set(self.scope_map.get(request.method, []))
current_scopes = request.auth.get_scopes()
return any(s in allowed_scopes for s in current_scopes)

since 'GET': () is still no scopes.

Solution:

  • Add scope_map property that returns the published_scope_map
  • Add scopes that equal what a member has for the GET endpoints (this is not truly a public endpoint in this case but we can figure out what that looks like later)

@MeredithAnya MeredithAnya requested review from mnoble and scefali July 16, 2019 23:21
'event:admin',
'project:releases',
'project:read',
'org:read',
Copy link
Contributor

Choose a reason for hiding this comment

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

@MeredithAnya What about the org:write permission? Do all users who have org:write also have org:read?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mnoble
Copy link
Contributor

mnoble commented Jul 17, 2019

Can we add a comment in the code saying that this is just a stop-gap until we figure out how to do a truly public endpoint?

@MeredithAnya MeredithAnya force-pushed the app-platform/update-permissions-token-auth branch from 415323e to ae726d1 Compare July 18, 2019 18:19
@MeredithAnya MeredithAnya merged commit 8b0179d into master Jul 18, 2019
@MeredithAnya MeredithAnya deleted the app-platform/update-permissions-token-auth branch July 18, 2019 21:25
HazAT added a commit that referenced this pull request Jul 19, 2019
* master:
  ref(admin): Convert user edit page to react (#14074)
  ref: Remove unused Group.get_oldest_event and legacy events behavior (#14038)
  ref(api): Update DELETE users/ to support hard deleting (#14068)
  test(OrganizationDiscoverSavedQueryDetailTest): Stabilize put test (#14077)
  meta(readme): Sentry logo should link to sentry.io (#14076)
  ref: Remove duplicate column (#14073)
  App platform/update permissions token auth (#14046)
  feat: Support issue IDs as canonical parameters
  ref: Change to new traceparent header for Python SDK (#14070)
  feat: Use option to force-disable transaction events (#14056)
  feat(apm): Register option to force-disable transaction events (#14055)
  Feat/mark sentry app installed put route (#14060)
  ref: Remove unused Group.event_set property  (#14036)
  fix: Filter out groups that are pending deletion/merge from `by_qualified_short_id` (SEN-849)
  fix(ui): Fix resolve/ignore actions for accounts without multi… (#14058)
  Fix: Remove extra $.param introduced in GH-14051 (#14061)
  feat: Use Snuba for Group.from_event_id (#14034)
  fix(ui) Display implicit default sort and default to descending (#14042)
  fix(github) Fix 404s not being handled in repository search (#14030)
  fix: Pass an empty array to $.param instead of an empty string when options.query is falsey (#14051)

# Conflicts:
#	src/sentry/utils/sdk.py
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants