8000 [Mailer] [Azure] Fix resource name validation by t9toqwerty · Pull Request #53388 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] [Azure] Fix resource name validation #53388

8000 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

Merged

Conversation

t9toqwerty
Copy link
Contributor
@t9toqwerty t9toqwerty commented Jan 3, 2024
Q A
Branch? 7.1
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #53385
License MIT

Remove validation where Azure Email Communication Resource with dot in name is not being allowed to use.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title Remove validation where Azure Email Communication Resource with dot in name is not being allowed to use [Mailer] Remove validation where Azure Email Communication Resource with dot in name is not being allowed to use Jan 3, 2024
@OskarStark OskarStark changed the title [Mailer] Remove validation where Azure Email Communication Resource with dot in name is not being allowed to use [Mailer][Azure] Fix validation of resource name Jan 3, 2024
@OskarStark
Copy link
Contributor
OskarStark commented Jan 3, 2024

Thank you for your contribution, can you maybe show your anonymized resource name or link to the corresponding Azure documentation? Thanks

cc @hafael as you contributed the bridge

@carsonbot carsonbot changed the title [Mailer][Azure] Fix validation of resource name [Mailer] [Azure] Fix validation of resource name Jan 3, 2024
@OskarStark OskarStark changed the title [Mailer] [Azure] Fix validation of resource name [Mailer] [Azure] Fix resource name validation Jan 3, 2024
@OskarStark OskarStark changed the title [Mailer] [Azure] Fix resource name validation [Mailer][Azure] Fix resource name validation Jan 3, 2024
@t9toqwerty
Copy link
Contributor Author
t9toqwerty commented Jan 4, 2024

Hi @OskarStark ,

I have seen this for the new Azure Communication Resources naming where they are appending the Data Location in resource endpoint url.

For Example I have created two Azure Communication Resources (One in US and other In India) and seen the pattern repeated. Check the endpoint in the screenshots:

US:
Screenshot 2024-01-04 at 7 50 47 AM

India:
Screenshot 2024-01-04 at 7 51 55 AM

The same format for endpoint can be found in the last image attached in their documentation.

IMHO, The way we are formatting the host/endpoint,

private const HOST = '%s.communication.azure.com';

We should allow the resource with dots in name so the we can get the correct host/endpoint in these scenarios .

@OskarStark
Copy link
Contributor

Thanks for the explanation.

From what I can see in your screenshots, we must change the following too, or does the bride works for you, when removing the "contain dot" part?

- private const HOST = '%s.communication.azure.com';
+ private const HOST = '%s.communications.azure.com';

@t9toqwerty
Copy link
Contributor Author
t9toqwerty commented Jan 4, 2024

I have just tested again and It is working fine for me. I am receiving email without any issue so I think we don't need to change the current host url structure.

As the same url is reflecting in my dashboard too that I have attached the first two screenshot of, I assume the documentation from I attached the third image is old.

I think we can go with current url structure i.e. . And the same is being used in their Java SDK too.

private const HOST = '%s.communication.azure.com';

Just to be on safe side I have tried the other url (private const HOST = '%s.communications.azure.com';) too but got TransportException: Could not resolve host Exception.

Screenshot 2024-01-04 at 12 50 01 PM

@webflo
Copy link
webflo commented Jan 24, 2024

👍 This works as expected. communication.azure.com is correct.

@carsonbot carsonbot changed the title [Mailer][Azure] Fix resource name validation [Mailer] [Azure] Fix resource name validation Jan 24, 2024
@OskarStark OskarStark force-pushed the fix-azure-email-comm-res-name-validation branch from 4cf0b45 to 088faf5 Compare January 24, 2024 15:49
@OskarStark
Copy link
Contributor

Thanks for fixing this bug @t9toqwerty.

@OskarStark OskarStark merged commit d621936 into symfony:7.1 Jan 24, 2024
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.

Incorrect validation for Azure Email Communication Resource Name
4 participants
0