Shopify / Shopify/shopify-app-template-php
Different scopes
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 340
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
I have an application that performs certain tasks. It requires the following permissions:
write_shipping
read_orders
write_orders
As the app develops and new plans with new functionalities are added, the application requires additional permissions:
write_content
However, when executing the code:
$session = Utils::loadOfflineSession('');
we will not get a session.
The problem arises from the fact that in Session::isValid(), we verify the scopes that are stored in the db with the scopes from the configuration file:
Context::$SCOPES->equals($this->scope)
Should these be related to each other and should this validation be performed?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Utils::loadOfflineSession('') into Session::isValid() and inspect how the database scope is compared with Context::$SCOPES. Reproduce the case where write_content is added to configuration, then determine the intended behavior for previously stored sessions before updating the relevant validation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication, authorization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100