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

[RS-1431] Allow UI admin user to create and patch webhooks-secret #3014

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

gantony
Copy link
Contributor

@gantony gantony commented Nov 23, 2023

Description

In our UI, we allow admin users to easily create/update/delete webhooks. When creating a Jira webhook, we store the Jira credentials they provide (email + token) into a secret. When we delete a webhook through the UI, it also cleans up the information in the secret.

In the initial poc, we allowed admin users to view and edit those credentials through the UI, which would require adding create/view/update/delete permissions for secrets in tigera-netwok-admin cluster role. This felt like too much permissions (even for admin users) so we decided to:

  • Only specify Jira credentials when creating a webhook, no way to view them ("UI" does not read secrets). If creds need to change, delete webhook and create a new one.
  • Have 1 secret that contains Jira credentials for all the webhooks of a managedcluster created through the UI, with key in secret data using format <webhok-name>.username
  • Let the UI create the required secret when needed and patch the secret when creating/adding a jira webhook (update/remove secret key accordingly).

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@Brian-McM Brian-McM merged commit 84cf81a into tigera:master Nov 23, 2023
3 checks passed
@gantony gantony deleted the antony/patch-webhooks-secret branch November 24, 2023 10:21
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.

3 participants