Nikk8091 opened a new issue, #12093:
URL: https://github.com/apache/seatunnel/issues/12093

   ### Search before asking
   
   - [x] I searched existing issues and pull requests and found no similar 
report or active fix.
   
   ### What happened
   
   The Slack sink discovers the configured channel using oauth_token, but 
SlackClient.publishMessage() sets the chat.postMessage request token from 
slack_channel instead of oauth_token.
   
   As a result, message publishing authenticates with the channel name rather 
than the configured Slack OAuth token. The Slack API rejects the request, 
normally with invalid_auth, and the sink cannot publish the message.
   
   Current code:
   
       .token(pluginConfig.get(SLACK_CHANNEL))
       .channel(channelId)
   
   Expected code:
   
       .token(pluginConfig.get(OAUTH_TOKEN))
       .channel(channelId)
   
   The Slack Java SDK documentation also separates the OAuth token from the 
channel identifier.
   
   ### SeaTunnel Version
   
   Current dev branch at bbfc188e.
   
   ### SeaTunnel Config
   
       sink {
         Slack {
           webhooks_url = https://hooks.slack.com/services/REDACTED
           oauth_token = xoxb-REDACTED
           slack_channel = test-channel
         }
       }
   
   ### Running Command
   
       bin/seatunnel.sh --config config/v2.batch.config.template -e local
   
   ### Error Exception
   
   The chat.postMessage request uses the configured channel name as its 
authentication token. Slack rejects the request as invalid authentication, and 
publishMessage returns false.
   
   ### Proposed fix and verification
   
   Use OAUTH_TOKEN in SlackClient.publishMessage() and add a focused unit test 
that captures the generated chat.postMessage request and verifies that token, 
channel ID, and message text are mapped to the correct fields. No live Slack 
workspace should be required.
   
   ### Are you willing to submit PR?
   
   - [x] Yes, I am willing to submit a PR.
   
   ### Code of Conduct
   
   - [x] I agree to follow the Apache Code of Conduct.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to