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

add 'user-managed' label to the rule details page for the api keys created by users #155699

Merged
merged 6 commits into from
May 15, 2023

Conversation

ersin-erdal
Copy link
Contributor

@ersin-erdal ersin-erdal commented Apr 25, 2023

Resolves: #154581

This PR adds 'user-managed' label next to the API key owner name when the API key is created by the user.

Screenshot 2023-05-06 at 19 02 08

@ersin-erdal ersin-erdal added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.8.0 labels Apr 25, 2023
@ersin-erdal ersin-erdal marked this pull request as ready for review April 25, 2023 14:49
@ersin-erdal ersin-erdal requested a review from a team as a code owner April 25, 2023 14:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@ymao1 ymao1 requested a review from mdefazio April 25, 2023 17:21
@ersin-erdal ersin-erdal added v8.9.0 and removed v8.8.0 labels May 2, 2023
@mikecote mikecote self-requested a review May 2, 2023 18:10
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM! Created a rule with my own API key and saw the (user-managed) label appended 👍

@mdefazio
Copy link
Contributor

mdefazio commented May 3, 2023

I think the label works well enough. My original thought was to have the user icon next to the name (with a tooltip on it showing 'User managed'): API Key Owner: elastic <icon>.

Reviewed the previous issue and had a few questions. Feel free to direct me there instead.

Can you remind me of the implications if I edit a rule owned by another user? Would it switch it to my api key?
If I don't have an api key assigned, I would not be able to modify this rule, correct? (Would help us decide if perhaps a different icon makes sense).

Also not trying to make this more complicated than it needs to be as well. 😄

@ersin-erdal
Copy link
Contributor Author

ersin-erdal commented May 3, 2023

Can you remind me of the implications if I edit a rule owned by another user? Would it switch it to my api key?

AFAIK yes.

If I don't have an api key assigned, I would not be able to modify this rule, correct? (Would help us decide if perhaps a different icon makes sense).

Not sure about this. @mikecote can you help us here?

@mikecote
Copy link
Contributor

mikecote commented May 4, 2023

If I don't have an api key assigned, I would not be able to modify this rule, correct? (Would help us decide if perhaps a different icon makes sense).

Not sure about this. @mikecote can you help us here?

You would be able to modify this rule for sure but by modifying the rule a new API key would get assigned on your behalf and un-associate the previous API key from the rule.

@mdefazio
Copy link
Contributor

mdefazio commented May 4, 2023

After understanding this a bit more, I'm thinking a simple questionInCircle icon that shows a tooltip with the following:

API Key Owner: < EuiIconTip position="right" content={...} />

This rule is associated with an API key. Modifying this rule with either remove or switch the API key owner.

That's very likely not correct...

@lcawl Apologies for the mid-conversation ping, but can you take a look at this?

@lcawl lcawl added the ui-copy Review of UI copy with docs team is recommended label May 11, 2023
@lcawl
Copy link
Contributor

lcawl commented May 11, 2023

...This rule is associated with an API key. Modifying this rule with either remove or switch the API key owner.
@lcawl Apologies for the mid-conversation ping, but can you take a look at this?

IMO the second sentence seems out of place here. I'm hovering over the tooltip since I'm curious what the API key owner field means, not because I want to edit the rule. I think it would be more appropriate to have that info somewhere in the Edit rule UI. For example, where there are other warnings already:

image

If we can tell that a rule uses API keys at this stage, it would be cool to modify the message to something like: "Saving this rule will change the API key owner and therefore its privileges and behavior might change."

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the small copy tweak.

'xpack.triggersActionsUI.sections.ruleDetails.userManagedApikey',
{
defaultMessage:
'This rule is associated with an API key. Modifying this rule with either remove or switch the API key owner.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @lcawl . Let's remove this second sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should i add that exclamation mark next to the save button too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the additional text mentioned in #155699 (comment), that'd be great!

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 1.4MB 1.4MB +263.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 87.0KB 87.1KB +67.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 400 404 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 480 484 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@ersin-erdal ersin-erdal merged commit d297a99 into elastic:main May 15, 2023
@ersin-erdal ersin-erdal deleted the 154581-user-managed-label branch May 15, 2023 19:33
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 15, 2023
…eated by users (elastic#155699)

Resolves: elastic#154581

This PR adds 'user-managed' label next to the API key owner name when
the API key is created by the user.

<img width="813" alt="Screenshot 2023-05-06 at 19 02 08"
src="https://user-images.githubusercontent.com/92688503/236637767-d0c0ee00-1314-4824-b97a-b7bdf1b7f43b.png">

(cherry picked from commit d297a99)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 15, 2023
…eys created by users (#155699) (#157792)

# Backport

This will backport the following commits from `main` to `8.8`:
- [add 'user-managed' label to the rule details page for the api keys
created by users
(#155699)](#155699)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-15T19:33:48Z","message":"add
'user-managed' label to the rule details page for the api keys created
by users (#155699)\n\nResolves: #154581\r\n\r\nThis PR adds
'user-managed' label next to the API key owner name when\r\nthe API key
is created by the user.\r\n\r\n<img width=\"813\" alt=\"Screenshot
2023-05-06 at 19 02
08\"\r\nsrc=\"https://user-images.githubusercontent.com/92688503/236637767-d0c0ee00-1314-4824-b97a-b7bdf1b7f43b.png\">","sha":"d297a9949fc603a797faebc997ea92bee1001fee","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","ui-copy","v8.8.0","v8.9.0"],"number":155699,"url":"https://github.com/elastic/kibana/pull/155699","mergeCommit":{"message":"add
'user-managed' label to the rule details page for the api keys created
by users (#155699)\n\nResolves: #154581\r\n\r\nThis PR adds
'user-managed' label next to the API key owner name when\r\nthe API key
is created by the user.\r\n\r\n<img width=\"813\" alt=\"Screenshot
2023-05-06 at 19 02
08\"\r\nsrc=\"https://user-images.githubusercontent.com/92688503/236637767-d0c0ee00-1314-4824-b97a-b7bdf1b7f43b.png\">","sha":"d297a9949fc603a797faebc997ea92bee1001fee"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155699","number":155699,"mergeCommit":{"message":"add
'user-managed' label to the rule details page for the api keys created
by users (#155699)\n\nResolves: #154581\r\n\r\nThis PR adds
'user-managed' label next to the API key owner name when\r\nthe API key
is created by the user.\r\n\r\n<img width=\"813\" alt=\"Screenshot
2023-05-06 at 19 02
08\"\r\nsrc=\"https://user-images.githubusercontent.com/92688503/236637767-d0c0ee00-1314-4824-b97a-b7bdf1b7f43b.png\">","sha":"d297a9949fc603a797faebc997ea92bee1001fee"}}]}]
BACKPORT-->

Co-authored-by: Ersin Erdal <92688503+ersin-erdal@users.noreply.github.com>
jasonrhodes pushed a commit that referenced this pull request May 17, 2023
…eated by users (#155699)

Resolves: #154581

This PR adds 'user-managed' label next to the API key owner name when
the API key is created by the user.

<img width="813" alt="Screenshot 2023-05-06 at 19 02 08"
src="https://user-images.githubusercontent.com/92688503/236637767-d0c0ee00-1314-4824-b97a-b7bdf1b7f43b.png">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) ui-copy Review of UI copy with docs team is recommended v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ResponseOps] do we need to display info for rules with user-managed API keys?
7 participants