Skip to content
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

[Notifier] [Slack] Validate token syntax #39606

Merged
merged 1 commit into from Dec 28, 2020

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Dec 22, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets ---
License MIT
Doc PR -

This PR follows #39560

@odolbeau @malteschlueter @norkunas @fabpot can you confirm all your tokens start with xox?

From the Slack documentation:

  • Bot user token strings begin with xoxb-
  • User token strings begin with xoxp-
  • Workspace access token strings begin with xoxa-2

@carsonbot carsonbot changed the title [Notifier][Slack] Validate token syntax [Notifier] [Slack] Validate token syntax Dec 22, 2020
@nicolas-grekas nicolas-grekas added this to the 5.x milestone Dec 23, 2020
@derrabus
Copy link
Member

derrabus commented Dec 24, 2020

The code looks correct, but I wonder if our code should have an opinion on valid Slack access tokens. To me, a token is a string that I present as I've received it if I need to authenticate. We usually don't need to parse such a token in any way. The format of those token is an implementation detail that Slack might decide to change anytime.

@OskarStark
Copy link
Contributor Author

OskarStark commented Dec 25, 2020

I agree but in this case Slack is dealing with webhook ids and tokens which can be confusing, I think it's much easier to adopt this bridge if you know you are in the right place or not.

@symfony symfony deleted a comment from innaplet Dec 25, 2020
@symfony symfony deleted a comment from innaplet Dec 25, 2020
@fabpot
Copy link
Member

fabpot commented Dec 28, 2020

Thank you @OskarStark.

@fabpot fabpot merged commit b6fdd6d into symfony:5.x Dec 28, 2020
@OskarStark OskarStark deleted the validate-slack-token-5.x branch December 28, 2020 08:45
@fabpot fabpot mentioned this pull request Apr 18, 2021
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.

None yet

8 participants