-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore(slack): change Slack channel name env variable #4080
chore(slack): change Slack channel name env variable #4080
Conversation
You can check the documentation for this PR here -> SaaS Documentation |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4080 +/- ##
==========================================
- Coverage 86.26% 86.26% -0.01%
==========================================
Files 790 790
Lines 24729 24729
==========================================
- Hits 21333 21332 -1
- Misses 3396 3397 +1 ☔ View full report in Codecov by Sentry. |
if "SLACK_API_TOKEN" in environ and "SLACK_CHANNEL_ID" in environ: | ||
if "SLACK_API_TOKEN" in environ and ( | ||
"SLACK_CHANNEL_NAME" in environ or "SLACK_CHANNEL_ID" in environ | ||
): | ||
_ = send_slack_message( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are both values valid in the Slack API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What API? Those values are parsed by Prowler and then used them as args to the send_slack_message
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that you are now passing either SLACK_CHANNEL_NAME
or SLACK_CHANNEL_ID
to the send_slack_message
function, and then is used in the following way:
response = client.chat_postMessage(
username="Prowler",
icon_url=square_logo_img,
channel=f"#{channel}",
blocks=create_message_blocks(identity, logo, stats),
)
Are both valid when used in the Slack API as channel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔝
Description
Change Slack channel name environment variable from
SLACK_CHANNEL_ID
toSLACK_CHANNEL_NAME
to avoid confusions.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.