Skip to content

Commit 073389e

Browse files
committed
chore: PR review
1 parent dfbf1ab commit 073389e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/Http/Utils/FilterAvailableSummitsStrategy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* limitations under the License.
1313
**/
1414
use App\Security\SummitScopes;
15-
use Illuminate\Support\Facades\Config;
1615
use models\oauth2\IResourceServerContext;
1716
/**
1817
* Class FilterAvailableSummitsStrategy
@@ -30,4 +29,4 @@ static public function shouldReturnAllSummits(IResourceServerContext $resource_s
3029
$needed_scope = SummitScopes::ReadAllSummitData;
3130
return in_array($needed_scope, $scopes);
3231
}
33-
}
32+
}

app/Providers/AppServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ public function register()
719719
{
720720

721721
if (!defined('SCOPE_BASE_REALM')) {
722-
define('SCOPE_BASE_REALM', config('app.scope_base_realm'));
722+
$scopeBaseRealm = rtrim((string) config('app.scope_base_realm', ''), '/');
723+
if ($scopeBaseRealm === '')
724+
throw new \RuntimeException('Missing required config: app.scope_base_realm');
725+
define('SCOPE_BASE_REALM', $scopeBaseRealm);
723726
}
724727

725728
App::singleton(IResourceServerContext::class, ResourceServerContext::class);

tests/ProtectedApiTestCase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use App\Models\Foundation\Main\IGroup;
2828
use App\Security\CompanyScopes;
2929
use App\Security\SponsoredProjectScope;
30-
use App\Security\GroupsScopes;
3130
use App\Security\TeamScopes;
3231
use Mockery;
3332
/**
@@ -192,7 +191,6 @@ public function get($token_value)
192191
SummitScopes::ReadSummitsConfirmExternalOrders,
193192
SummitScopes::WriteSummitsConfirmExternalOrders,
194193
SummitScopes::WriteVideoData,
195-
SummitScopes::WriteVideoData,
196194
SummitScopes::MeRead,
197195
SummitScopes::ReadNotifications,
198196
MemberScopes::ReadMemberData,
@@ -347,4 +345,4 @@ protected function getAuthHeaders():array{
347345
"CONTENT_TYPE" => "application/json"
348346
];
349347
}
350-
}
348+
}

0 commit comments

Comments
 (0)