Repository navigation
EDM-6483: Collective CVE remediation (November 2026) #890
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| /* eslint-disable no-console */ | ||
|
|
||
| import { type PatchRequest } from '@flightctl/types'; | ||
| import { getCSRFToken } from '@openshift-console/dynamic-plugin-sdk/lib/utils/fetch/console-fetch-utils'; | ||
| import { | ||
| getErrorMsgFromAlertsApiResponse, | ||
| getErrorMsgFromApiResponse, | ||
|
|
@@ -18,6 +17,18 @@ declare global { | |
|
|
||
| type Api = 'flightctl' | 'imagebuilder' | 'alerts' | 'catalog' | 'vulnerability'; | ||
|
|
||
| const getCSRFToken = (): string => { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: This change would need to be well tested in the OCP console.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs testing, but the equivalent should be |
||
| const cookiePrefix = 'csrf-token='; | ||
| return ( | ||
| document.cookie | ||
| .split(';') | ||
| .map((cookie) => cookie.trim()) | ||
| .filter((cookie) => cookie.startsWith(cookiePrefix)) | ||
| .map((cookie) => cookie.slice(cookiePrefix.length)) | ||
| .pop() ?? '' | ||
| ); | ||
| }; | ||
|
|
||
| const addRequiredHeaders = (options: RequestInit, api?: Api): RequestInit => { | ||
| const token = getCSRFToken(); | ||
| const orgId = localStorage.getItem(ORGANIZATION_STORAGE_KEY); | ||
|
|
||
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.
Note to self: same, we must ensure user information functionality remains the same.