-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[SECURITY_SOLUTION][ENDPOINT] Create Trusted Apps UI Flow #77076
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
[SECURITY_SOLUTION][ENDPOINT] Create Trusted Apps UI Flow #77076
Conversation
…ted-apps-ui-create # Conflicts: # x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.tsx
| | MacosLinuxConditionEntry | ||
| | (Omit<MacosLinuxConditionEntry, 'field'> & { | ||
| field: 'signer'; | ||
| field: 'porcess.code_signature'; |
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.
wait is this actually called porcess?
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.
Yeah, according to the info. I got :)
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.
Sorry - Just got what you were implying 😄
It's a spelling mistake. Will correct it. Thanks for looking @parkiino
| } | ||
|
|
||
| /** Store State when an API request has been sent to create a new trusted app entry */ | ||
| export interface TrustedAppCreatePending { |
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 wonder if there's a way to group these states similar to the List resource. I know it's not entirely the same since we're creating a resource as opposed to loading it.
|
|
||
| const generateNewEntry = (): NewTrustedApp['entries'][0] => { | ||
| return { | ||
| field: 'process.hash.*', |
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.
these are the field defaults?
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.
Yes, this ultimately drive the default entry for a condition. I know this is not matching what @bfishel has in the Mocks, but for now it is the easier path to take in order to not over-complicate the types of data (I would have to add '' or null' to just about every field here). I plan to discuss that with Bonnie at some point.
| isValid: boolean; | ||
| errors: Partial<{ [k in keyof NewTrustedApp]: string }>; | ||
| } | ||
| const validateFormValues = (values: NewTrustedApp): ValidationResult => { |
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.
we've talked about it a couple times in meetings, another validation we could do is field name uniqueness, for instance, you can only have one hash field, etc. Maybe this could solved when we call generateNewEntry() - enforce there that fields must be unique, generate the next "available field" and when none left, disable the "AND" button.
Not required for this PR, was just putting ideas out there for more validations.
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 opened a separate issue to track UI/UX around validation feedback. This method here is bound to change based on that feedback
kevinlog
left a comment
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.
LGTM, some smaller comments. Would like @efreeti thoughts as well
…ted-apps-ui-create
…ted-apps-ui-create
| | TrustedAppsListPageState['createView'] | ||
| | Immutable<TrustedAppsListPageState['createView']>; | ||
|
|
||
| export const isTrustedAppCreatePendingState = ( |
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.
is this related to what bohdan was talking about before about having selectors return types?
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.
yes :)
Type guards are a runtime (executable code) function whose purpose is to ensure we are working with the correct type. In TS, it helps tell it that if this function evaluates to true, then the value being evaluated (data) is of a given type (note the : data is TrustedAppCreateSuccess in the return value for this function's signature.
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
|
@parkiino I was able to reproduce that misalignment in the screen capture, but only when I used the browser's zoom and increase it. Seems to be caused by label ( Thanks for the review |
…) (#77675) * [SECURITY_SOLUTION][ENDPOINT] Create Trusted Apps UI Flow (#77076) * Add UI for creating a new Trusted App entry * update invalid snapshot (cherry picked from commit 333b200) Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: spalger <[email protected]>

Summary
Adds the ability to create a new Trusted App entry to the Trusted Apps List page. Includes some basic validations, but not a comprehensive set (that will be coming in a subsequent PR).
Checklist