feat: cloud API - #102
Open
supun-io wants to merge 21 commits into
Open
Conversation
Member
Author
|
@Nadil-K review needed:
|
9 tasks
Nadil-K
reviewed
Jul 30, 2026
|
|
||
| public function from(): array | ||
| { | ||
| return []; |
| $this->em->clear(); | ||
| } | ||
|
|
||
| public function createMock(string $originalClassName): MockObject |
Member
There was a problem hiding this comment.
- What is the reason to replace this with
createStub()?
| use Hyvor\Internal\Tests\Unit\CloudApi\CloudApiAuth\ConsoleApiAuthTrait; | ||
| use PHPUnit\Framework\TestCase; | ||
| use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | ||
|
|
| use PHPUnit\Framework\Attributes\CoversClass; | ||
|
|
||
| #[CoversClass(ScopeBuilder::class)] | ||
| class ScopeBuilderTest extends SymfonyTestCase |
Member
There was a problem hiding this comment.
- Cover the following paths:
-
->addScopes(Component::TALK, [TalkScope::WEBSITE_READ, TalkScope::WEBSITE_WRITE, PostScope::NEWSLETTER_READ]) -
->fromScopeString('talk:website.read invalid-component:website.write post:newsletter.read')
| if (!Component::tryFrom($component)) { | ||
| continue; | ||
| } | ||
| $scopeBuilder->scopes[$component][] = $scopeName; |
Member
There was a problem hiding this comment.
- Shouldn't we validate the scope against the component here?
|
|
||
| public function __invoke(ControllerEvent $event): void | ||
| { | ||
| if (!str_starts_with($event->getRequest()->getPathInfo(), $this->getBasePath())) { |
Member
There was a problem hiding this comment.
$request = $event->getRequest();
$path = $request->getPathInfo();- Use these variables below. No need to call the same function multiple times.
|
|
||
| private function handleResourceApiKey(ControllerEvent $event, string $apiKey): ConsoleAuthResults | ||
| { | ||
| $orgEndpoint = $event->getAttributes(OrgEndpoint::class)[0] ?? null; |
Member
There was a problem hiding this comment.
count($event->getAttributes(OrgEndpoint::class)) > 0
|
|
||
| private function handleCloudToken(ControllerEvent $event, string $jwtToken): ConsoleAuthResults | ||
| { | ||
| $orgEndpoint = $event->getAttributes(OrgEndpoint::class)[0] ?? null; |
Member
There was a problem hiding this comment.
count($event->getAttributes(OrgEndpoint::class)) > 0
| private function handleSession(ControllerEvent $event): ConsoleAuthResults | ||
| { | ||
| $request = $event->getRequest(); | ||
| $orgEndpoint = $event->getAttributes(OrgEndpoint::class)[0] ?? null; |
Member
There was a problem hiding this comment.
count($event->getAttributes(OrgEndpoint::class)) > 0
| */ | ||
| public function resolve(Request $request, ArgumentMetadata $argument): iterable | ||
| { | ||
| // get the argument type (e.g. BookingId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.