Skip to content

[Messenger] Permit creating queue when an account is provided #44021

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

Closed
wants to merge 1 commit into from
Closed

[Messenger] Permit creating queue when an account is provided #44021

wants to merge 1 commit into from

Conversation

nuvolapl
Copy link

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix #42208
License MIT
Doc PR

@carsonbot
Copy link

Hey!

I think @WaylandAce has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@fabpot fabpot modified the milestones: 5.4, 6.1 Nov 16, 2021
@Kocal
Copy link
Member

Kocal commented Mar 14, 2022

Hi everyone, what is the state of this PR?
Should it target 5.4 instead of 6.1? To me it looks like a bug fix and not a new feature. The current behaviour is broken.

I can confirm the provided patch works, a non-existent queue is created when calling ->setup() if needed.

Friendly ping @fabpot @jderusse @Nyholm 🙏

Thanks!

@Nyholm
Copy link
Member

Nyholm commented Mar 14, 2022

This was part of the original PR by @jderusse. It is not a bug it is a new feature.

I dont remember why this was added. Jeremy, do you know?

@chalasr
Copy link
Member

chalasr commented Mar 14, 2022

This is for 5.4. It just misses a test case (if possible)

@Kocal
Copy link
Member

Kocal commented Mar 14, 2022

I will create a new PR with @nuvolapl's commit + a new test case.

@chalasr
Copy link
Member

chalasr commented Mar 14, 2022

Sorry Tobias, I missed your comment. If creating the queue on the fly was not expected to work, then it is indeed a new feature.

@Kocal
Copy link
Member

Kocal commented Mar 14, 2022

Then what's the meaning of having an option auto_setup (which is true by default), if the auto-setup is not allowed?

@jderusse
Copy link
Member

This was part of the original PR by @jderusse. It is not a bug it is a new feature.

At this time, the DSN for the queue was sqs://default/queue_name OR sqs://default/owner_id/queue_name.
When owner_id was present, we presumed that it was somebodyelse's queue (like referencing the queue from another account). And, in that case, it was not possible de create the queue.

Since then, things changed:

  • first, the owner_id could be us, and the presumption is wrong.
  • the DSN could be now https://sqs.eu-west-1.amazonaws.com/owner_id/queue_name, and presumption is wrong again.

I believe this check should not be ignored because: If the code run with credentials belonging to account 1234, but queue is /9876/foo, the Symfony will create the queue foo on account 1234 which is wrong.

This line should be replaced by checking if the ownerId is identical to the currently connected account (see StsClient::getCallerIdentity).

@Nyholm
Copy link
Member

Nyholm commented Mar 14, 2022

Thank you for the clarification.

@Kocal do you understand and are happy moving forward in this way?

@chalasr With this new information (for both of us), do you agree on targeting 6.1?

@Kocal
Copy link
Member

Kocal commented Mar 14, 2022

Thanks everyone!

@Nyholm: yeah I'm fine with those explanations, I will try to send a PR ASAP.

@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nuvolapl nuvolapl closed this by deleting the head repository Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messenger Amazon SQS Connection::setup() throws exception when needing to create a queue
8 participants