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

Only send "Trusted Publisher ... can be made more secure" emails once per publisher #17793

Open
di opened this issue Mar 17, 2025 · 1 comment
Labels

Comments

@di
Copy link
Member

di commented Mar 17, 2025

Currently we send a notification email every time a Trusted Publisher is used within an environment for a publisher that is not constrained to an environment:

# Send a warning email to the owners of the project using the Trusted Publisher if
# the TP has no environment configured but the OIDC claims contain one.
# The email contains a link to change the TP so that it only accepts the
# environment seen in the current OIDC claims.
#
# Note: currently we only send the email if the Trusted Publisher is used in only
# a single project, since multiple projects using the same TP might mean they don't
# use a single environment.
if len(publisher.projects) == 1 and should_send_environment_warning_email(
publisher, claims
):
send_environment_ignored_in_trusted_publisher_email(
request,
set(publisher.projects[0].owners),
project_name=publisher.projects[0].name,
publisher=publisher,
environment_name=claims["environment"],
)

This is somewhat spammy for users who choose not to do this intentionally, with no ability to disable the notifications.

We should only send this email once per publisher. This could be done by adding an additional column on the publisher that indicates whether a warning has been sent or not.

@di di added email Related to emails trusted-publishing labels Mar 17, 2025
@Daksh2000
Copy link
Contributor

Hi @di, Taking up this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants