From ebb15c08a949a2bf52872e823ef2af1e348cf8f6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 23 Apr 2025 15:19:55 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- CHANGELOG.md | 50 ++++++++++ .../environments/graphql/resolvers/flux.js | 3 +- .../services/websocket_connection_service.js | 18 ++++ .../graphql/helpers/resolver_helpers.js | 11 ++- .../components/notes/work_item_add_note.vue | 6 +- .../notes/work_item_comment_form.vue | 12 +-- ...ork_item_relationship_popover_metadata.vue | 8 +- .../components/work_item_crm_contacts.vue | 7 +- .../work_item_development.vue | 14 +-- .../work_item_rolled_up_data.vue | 13 +-- .../work_item_links/work_item_tree.vue | 3 +- .../work_items/graphql/cache_utils.js | 5 +- .../work_items/graphql/resolvers.js | 12 ++- app/assets/javascripts/work_items/utils.js | 48 ++++++--- app/services/groups/update_service.rb | 4 +- .../import_export/relation_import_service.rb | 2 +- .../import_export/relation_import_worker.rb | 7 +- config/application.rb | 3 + config/locales/en.yml | 6 ++ config/settings.rb | 2 +- .../split_microsoft_applications_table.yml | 2 +- ...ull_constraint_from_project_fingerprint.rb | 14 +++ ...lize_split_microsoft_applications_table.rb | 23 +++++ db/schema_migrations/20250416005514 | 1 + db/schema_migrations/20250422125014 | 1 + db/structure.sql | 4 +- doc/api/feature_flag_user_lists.md | 29 +++--- doc/api/graphql/reference/_index.md | 36 ++++++- doc/api/project_vulnerabilities.md | 2 - doc/api/vulnerability_findings.md | 1 - doc/ci/yaml/_index.md | 2 +- .../container_scanning/_index.md | 8 +- .../dependency_scanning/_index.md | 12 +-- .../policies/pipeline_execution_policies.md | 2 +- .../databases/collection_builder.rb | 5 + .../databases/concerns/elastic_executor.rb | 2 + .../databases/concerns/elastic_processor.rb | 5 + .../databases/postgresql/executor.rb | 4 +- .../databases/postgresql/processor.rb | 5 + .../lib/active_context/query.rb | 7 +- .../databases/elasticsearch/processor_spec.rb | 11 +++ .../databases/opensearch/processor_spec.rb | 11 +++ .../databases/postgresql/processor_spec.rb | 6 ++ .../spec/lib/active_context/query_spec.rb | 23 ++++- lib/api/helpers.rb | 5 +- lib/api/helpers/packages/maven.rb | 9 +- lib/banzai/filter/quick_action_filter.rb | 18 ++-- lib/banzai/filter/sanitize_link_filter.rb | 5 + lib/gitlab/ci/reports/security/finding.rb | 8 -- .../Jobs/Container-Scanning.gitlab-ci.yml | 2 +- .../Container-Scanning.latest.gitlab-ci.yml | 2 +- .../Jobs/Dependency-Scanning.gitlab-ci.yml | 2 +- .../Dependency-Scanning.latest.gitlab-ci.yml | 2 +- .../Security/Secure-Binaries.gitlab-ci.yml | 6 +- lib/gitlab/import_export/members_mapper.rb | 5 +- .../import_export/project/import_export.yml | 2 - lib/gitlab/middleware/secure_headers.rb | 22 +++++ lib/gitlab/workhorse.rb | 21 +++- package.json | 4 +- spec/config/settings_spec.rb | 15 +++ .../tree/project/vulnerabilities.ndjson | 6 +- .../graphql/resolvers/flux_spec.js | 1 - .../graphql/resolvers/kubernetes_spec.js | 3 - .../websocket_connection_service_spec.js | 40 ++++++++ .../graphql/helpers/resolver_helpers_spec.js | 62 +++++++++++- spec/lib/api/helpers_spec.rb | 31 +++++- .../banzai/filter/quick_action_filter_spec.rb | 6 ++ .../import_export/members_mapper_spec.rb | 16 +++ .../import_export/safe_model_attributes.yml | 1 - .../gitlab/middleware/secure_headers_spec.rb | 20 ++++ spec/lib/gitlab/workhorse_spec.rb | 43 +++++++- spec/services/groups/update_service_spec.rb | 14 +++ .../relation_import_service_spec.rb | 40 +++++--- .../vulnerabilities_findings_helper.rb | 1 - .../vulnerabilities_helper.rb | 3 +- .../sanitization_filter_shared_examples.rb | 7 ++ .../relation_import_worker_spec.rb | 10 +- .../_support/lint_last_known_acceptable.txt | 3 +- .../dependencyproxy/dependencyproxy.go | 30 ++---- .../dependencyproxy/dependencyproxy_test.go | 58 +++++++++++ workhorse/internal/forwardheaders/forward.go | 75 ++++++++++++++ .../internal/forwardheaders/forward_test.go | 97 +++++++++++++++++++ workhorse/internal/sendurl/sendurl.go | 57 ++++------- workhorse/internal/sendurl/sendurl_test.go | 29 ++++++ yarn.lock | 17 ++-- 85 files changed, 994 insertions(+), 254 deletions(-) create mode 100644 app/assets/javascripts/environments/services/websocket_connection_service.js create mode 100644 db/migrate/20250422125014_drop_not_null_constraint_from_project_fingerprint.rb create mode 100644 db/post_migrate/20250416005514_finalize_split_microsoft_applications_table.rb create mode 100644 db/schema_migrations/20250416005514 create mode 100644 db/schema_migrations/20250422125014 create mode 100644 lib/gitlab/middleware/secure_headers.rb create mode 100644 spec/frontend/environments/services/websocket_connection_service_spec.js create mode 100644 spec/lib/gitlab/middleware/secure_headers_spec.rb create mode 100644 workhorse/internal/forwardheaders/forward.go create mode 100644 workhorse/internal/forwardheaders/forward_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fd0e56de7..965ffe96ab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 17.11.1 (2025-04-22) + +### Fixed (1 change) + +- [Fix string conversion for CI Inputs](https://gitlab.com/gitlab-org/security/gitlab/-/commit/aceb71126fb8ea5be6259a2156c6255bbaa1f3de) + +### Changed (1 change) + +- [Put allow_composite_identities_to_run_pipelines behind ff](https://gitlab.com/gitlab-org/security/gitlab/-/commit/2287e37df7c9ed82aa54643759e00bbf30a788c8) + +### Security (4 changes) + +- [Add SecureHeaders middleware with the Nel header](https://gitlab.com/gitlab-org/security/gitlab/-/commit/5a586de4d56429eabe0fb6ebc524894925759d2e) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4934)) +- [Restrict forwarded headers in Maven dependency proxy](https://gitlab.com/gitlab-org/security/gitlab/-/commit/80244b98dd92312510f4a9276b5adfcbaba8e68a) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4929)) +- [Security unauthorized access to reading branch names](https://gitlab.com/gitlab-org/security/gitlab/-/commit/9f9724584d109181e764f79a3b61667520d2212f) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4933)) +- [Simplify detecting paragraphs for quick actions](https://gitlab.com/gitlab-org/security/gitlab/-/commit/78466ef2cd3ddee5fbf0db67056a5bccf7c59907) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4925)) + ## 17.11.0 (2025-04-16) ### Added (211 changes) @@ -767,6 +784,25 @@ entry. - [Remove feature flag allow_merge_request_pipelines_from_fork](https://gitlab.com/gitlab-org/gitlab/-/commit/b62f9187a57cc5ba66ce26889516cc55a425181a) ([merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/182862)) - [Finalize migration BackfillNewAuditEventTables](https://gitlab.com/gitlab-org/gitlab/-/commit/1bc0f07ffd3af5b9fab8a0ea0b1af5f2759d25db) ([merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181881)) +## 17.10.5 (2025-04-22) + +### Fixed (3 changes) + +- [Fix 500 in Todo API when wiki page todo exists](https://gitlab.com/gitlab-org/security/gitlab/-/commit/71215f0615fad3167fb96b521b9628e11ea30a5d) +- [Clear session cookie when browser is closed](https://gitlab.com/gitlab-org/security/gitlab/-/commit/7c77ca404d9be7166d8ef991013394483b3f0371) +- [Fix workspaces reconciliation to send inventory config map correctly](https://gitlab.com/gitlab-org/security/gitlab/-/commit/aba508e925aea81c4d47555254e6a657edc94863) **GitLab Enterprise Edition** + +### Security (4 changes) + +- [Add SecureHeaders middleware with the Nel header](https://gitlab.com/gitlab-org/security/gitlab/-/commit/0e180be62768513438f86ea99f0a4a305cca46b6) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4919)) +- [Restrict forwarded headers in Maven dependency proxy](https://gitlab.com/gitlab-org/security/gitlab/-/commit/faa100503f89d08e51549e4f35f362c9945dbb6f) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4930)) +- [Security unauthorized access to reading branch names](https://gitlab.com/gitlab-org/security/gitlab/-/commit/dc2f917499f58ed9ccff23158b39528b62b71c2f) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4895)) +- [Simplify detecting paragraphs for quick actions](https://gitlab.com/gitlab-org/security/gitlab/-/commit/507e465f21b5be5297eda7a67f0ba75994df88d8) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4926)) + +### Other (1 change) + +- [No-op FinalizeBackfillCiRunnerMachinesPartitionedTable migration](https://gitlab.com/gitlab-org/security/gitlab/-/commit/119891459658f48120bcef02b1b66e3e78c78865) + ## 17.10.4 (2025-04-09) ### Fixed (2 changes) @@ -1608,6 +1644,20 @@ No changes. - [Quarantine a flaky test](https://gitlab.com/gitlab-org/gitlab/-/commit/998d8028213da6bf0c3c1c08301797c8b3395c28) ([merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/180234)) - [Quarantine a flaky test](https://gitlab.com/gitlab-org/gitlab/-/commit/8ae69a3765cfb7561db95e43faa30cc60fac6444) ([merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177662)) +## 17.9.7 (2025-04-22) + +### Security (4 changes) + +- [Add SecureHeaders middleware with the Nel header](https://gitlab.com/gitlab-org/security/gitlab/-/commit/5e9112ba2d6fac340e1dbfc4b0330bdcff2f82bc) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4920)) +- [Restrict forwarded headers in Maven dependency proxy](https://gitlab.com/gitlab-org/security/gitlab/-/commit/24d73f3e778471c4e0153af174f2d8b44e106108) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4931)) +- [Security unauthorized access to reading branch names](https://gitlab.com/gitlab-org/security/gitlab/-/commit/cb09987371857b97ec3cc5774b9f214c9db7c8a6) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4923)) +- [Simplify detecting paragraphs for quick actions](https://gitlab.com/gitlab-org/security/gitlab/-/commit/29d3f746b02137aaff4364473ce62f701d208e27) ([merge request](https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/4927)) + +### Other (2 changes) + +- [Clean up BackfillCiRunnerMachinesPartitionedTable migration](https://gitlab.com/gitlab-org/security/gitlab/-/commit/76d351431e07b3a695356c7b78ac16d23b180302) +- [No-op FinalizeBackfillCiRunnerMachinesPartitionedTable migration](https://gitlab.com/gitlab-org/security/gitlab/-/commit/fb16e2ebcc6188b3f9bb0bc30e7e2b709484f3b1) + ## 17.9.6 (2025-04-09) ### Security (6 changes) diff --git a/app/assets/javascripts/environments/graphql/resolvers/flux.js b/app/assets/javascripts/environments/graphql/resolvers/flux.js index f9058a3d657..4b713a6c93e 100644 --- a/app/assets/javascripts/environments/graphql/resolvers/flux.js +++ b/app/assets/javascripts/environments/graphql/resolvers/flux.js @@ -117,11 +117,12 @@ const watchFluxResource = async ({ }; try { + const config = new Configuration(variables.configuration); await subscribeToSocket({ watchId, watchParams, - configuration: variables.configuration, cacheParams, + config, }); } catch { await watchFunction(); diff --git a/app/assets/javascripts/environments/services/websocket_connection_service.js b/app/assets/javascripts/environments/services/websocket_connection_service.js new file mode 100644 index 00000000000..cd37cecf892 --- /dev/null +++ b/app/assets/javascripts/environments/services/websocket_connection_service.js @@ -0,0 +1,18 @@ +import { WebSocketWatchManager } from '@gitlab/cluster-client'; + +let watchManagerInstance = null; + +export function resetWatchManager() { + watchManagerInstance = null; +} + +export function getWatchManager(configuration) { + if (!watchManagerInstance) { + if (!configuration) { + throw new Error('WebSocketWatchManager not initialized. Provide configuration first.'); + } + watchManagerInstance = new WebSocketWatchManager(configuration); + } + + return watchManagerInstance; +} diff --git a/app/assets/javascripts/kubernetes_dashboard/graphql/helpers/resolver_helpers.js b/app/assets/javascripts/kubernetes_dashboard/graphql/helpers/resolver_helpers.js index a05ab602a89..6830ca98c6b 100644 --- a/app/assets/javascripts/kubernetes_dashboard/graphql/helpers/resolver_helpers.js +++ b/app/assets/javascripts/kubernetes_dashboard/graphql/helpers/resolver_helpers.js @@ -2,11 +2,11 @@ import { CoreV1Api, Configuration, WatchApi, - webSocketWatchManager, EVENT_DATA, EVENT_TIMEOUT, EVENT_ERROR, } from '@gitlab/cluster-client'; +import { getWatchManager } from '~/environments/services/websocket_connection_service'; import { connectionStatus } from '~/environments/graphql/resolvers/kubernetes/constants'; import { updateConnectionStatus } from '~/environments/graphql/resolvers/kubernetes/k8s_connection_status'; import { s__ } from '~/locale'; @@ -54,13 +54,14 @@ export const mapEventItem = ({ type, }) => ({ lastTimestamp, eventTime, message, reason, source, type }); -export const subscribeToSocket = async ({ watchId, watchParams, configuration, cacheParams }) => { +export const subscribeToSocket = async ({ watchId, watchParams, cacheParams, config }) => { const { updateQueryCache, updateConnectionStatusFn } = cacheParams; try { - const watcher = await webSocketWatchManager.initConnection({ + const watcherConnection = getWatchManager(config); + + const watcher = await watcherConnection.initConnection({ message: { watchId, watchParams }, - configuration, }); const handleConnectionStatus = (status) => { @@ -142,7 +143,7 @@ export const watchWorkloadItems = async ({ }; try { - await subscribeToSocket({ watchId, watchParams, configuration, cacheParams }); + await subscribeToSocket({ watchId, watchParams, cacheParams, config }); } catch { await watchFunction(); } diff --git a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue index be18501d446..87b41167c2b 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue @@ -6,14 +6,14 @@ import * as Sentry from '~/sentry/sentry_browser_wrapper'; import Tracking from '~/tracking'; import { __ } from '~/locale'; import { clearDraft } from '~/lib/utils/autosave'; -import { findWidget } from '~/issues/list/utils'; import DiscussionReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ResolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue'; import { updateCacheAfterCreatingNote } from '../../graphql/cache_utils'; import createNoteMutation from '../../graphql/notes/create_work_item_note.mutation.graphql'; import workItemNotesByIidQuery from '../../graphql/notes/work_item_notes_by_iid.query.graphql'; import workItemByIidQuery from '../../graphql/work_item_by_iid.query.graphql'; -import { TRACKING_CATEGORY_SHOW, WIDGET_TYPE_EMAIL_PARTICIPANTS, i18n } from '../../constants'; +import { TRACKING_CATEGORY_SHOW, i18n } from '../../constants'; +import { findEmailParticipantsWidget } from '../../utils'; import WorkItemNoteSignedOut from './work_item_note_signed_out.vue'; import WorkItemCommentLocked from './work_item_comment_locked.vue'; import WorkItemCommentForm from './work_item_comment_form.vue'; @@ -223,7 +223,7 @@ export default { return this.isDiscussionResolved ? __('Unresolve thread') : __('Resolve thread'); }, hasEmailParticipantsWidget() { - return Boolean(findWidget(WIDGET_TYPE_EMAIL_PARTICIPANTS, this.workItem)); + return Boolean(findEmailParticipantsWidget(this.workItem)); }, }, watch: { diff --git a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue index 6ce5c53af2f..b271e62feb0 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue @@ -3,14 +3,8 @@ import { GlButton, GlFormCheckbox, GlTooltipDirective } from '@gitlab/ui'; import { helpPagePath } from '~/helpers/help_page_helper'; import { s__, __ } from '~/locale'; import { capitalizeFirstCharacter } from '~/lib/utils/text_utility'; -import { - STATE_OPEN, - WORK_ITEM_TYPE_NAME_TASK, - WIDGET_TYPE_EMAIL_PARTICIPANTS, - i18n, -} from '~/work_items/constants'; +import { STATE_OPEN, WORK_ITEM_TYPE_NAME_TASK, i18n } from '~/work_items/constants'; import { getDraft, clearDraft, updateDraft } from '~/lib/utils/autosave'; -import { findWidget } from '~/issues/list/utils'; import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; import glAbilitiesMixin from '~/vue_shared/mixins/gl_abilities_mixin'; import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue'; @@ -19,6 +13,7 @@ import WorkItemStateToggle from '~/work_items/components/work_item_state_toggle. import CommentFieldLayout from '~/notes/components/comment_field_layout.vue'; import workItemByIidQuery from '../../graphql/work_item_by_iid.query.graphql'; import workItemEmailParticipantsByIidQuery from '../../graphql/notes/work_item_email_participants_by_iid.query.graphql'; +import { findEmailParticipantsWidget } from '../../utils'; const DOCS_WORK_ITEM_LOCKED_TASKS_PATH = helpPagePath('user/tasks.html', { anchor: 'lock-discussion', @@ -269,8 +264,7 @@ export default { }, update(data) { return ( - findWidget(WIDGET_TYPE_EMAIL_PARTICIPANTS, data?.workspace?.workItem)?.emailParticipants - ?.nodes || [] + findEmailParticipantsWidget(data?.workspace?.workItem)?.emailParticipants?.nodes || [] ); }, }, diff --git a/app/assets/javascripts/work_items/components/shared/work_item_relationship_popover_metadata.vue b/app/assets/javascripts/work_items/components/shared/work_item_relationship_popover_metadata.vue index fe5cdb4261f..f806e852a1c 100644 --- a/app/assets/javascripts/work_items/components/shared/work_item_relationship_popover_metadata.vue +++ b/app/assets/javascripts/work_items/components/shared/work_item_relationship_popover_metadata.vue @@ -2,9 +2,7 @@ import { GlTooltipDirective, GlAvatarsInline, GlAvatar, GlAvatarLink } from '@gitlab/ui'; import ItemMilestone from '~/issuable/components/issue_milestone.vue'; import { s__, sprintf } from '~/locale'; -import { WIDGET_TYPE_MILESTONE, WIDGET_TYPE_ASSIGNEES } from '~/work_items/constants'; -import { findWidget } from '~/issues/list/utils'; -import { getDisplayReference } from '../../utils'; +import { findAssigneesWidget, findMilestoneWidget, getDisplayReference } from '../../utils'; export default { name: 'WorkItemRelationshipPopoverMetadata', @@ -30,10 +28,10 @@ export default { assigneesDisplayLimit: 3, computed: { workItemAssignees() { - return findWidget(WIDGET_TYPE_ASSIGNEES, this.workItem)?.assignees?.nodes || []; + return findAssigneesWidget(this.workItem)?.assignees?.nodes || []; }, workItemMilestone() { - return findWidget(WIDGET_TYPE_MILESTONE, this.workItem)?.milestone; + return findMilestoneWidget(this.workItem)?.milestone; }, fullReference() { return getDisplayReference(this.workItemFullPath, this.workItem.reference); diff --git a/app/assets/javascripts/work_items/components/work_item_crm_contacts.vue b/app/assets/javascripts/work_items/components/work_item_crm_contacts.vue index b9546c1dc53..0e5914d04f7 100644 --- a/app/assets/javascripts/work_items/components/work_item_crm_contacts.vue +++ b/app/assets/javascripts/work_items/components/work_item_crm_contacts.vue @@ -1,7 +1,6 @@