Shopify / Shopify/shopify-app-template-php

Different scopes

Open
#425 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.