From a40d39ddd2dce862f95d35c42a07c0fce4df8f0a Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 26 Feb 2022 00:14:54 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- CHANGELOG.md | 39 ++++++++ app/assets/javascripts/mirrors/mirror_repos.js | 10 +- .../javascripts/snippets/components/show.vue | 13 ++- app/assets/javascripts/snippets/mixins/snippets.js | 1 + app/graphql/queries/snippet/snippet.query.graphql | 1 + .../snippet/snippet_blob_content.query.graphql | 1 + app/graphql/resolvers/snippets/blobs_resolver.rb | 24 ++--- app/graphql/resolvers/users_resolver.rb | 9 +- app/graphql/types/snippets/blob_connection_type.rb | 16 ++++ app/graphql/types/snippets/blob_type.rb | 2 + .../token_authenticatable_strategies/encrypted.rb | 46 +++++---- app/models/group.rb | 20 +++- app/models/note.rb | 37 +++++++- app/models/project.rb | 18 +++- app/models/snippet.rb | 10 +- app/services/members/create_service.rb | 13 +++ .../mirrors/_authentication_method.html.haml | 2 +- .../development/groups_runners_token_prefix.yml | 8 ++ .../development/projects_runners_token_prefix.yml | 8 ++ config/initializers/action_mailer_hooks.rb | 1 + doc/api/graphql/reference/index.md | 1 + lib/api/users.rb | 6 +- lib/banzai/filter/math_filter.rb | 10 ++ .../email/hook/validate_addresses_interceptor.rb | 32 +++++++ locale/gitlab.pot | 3 + spec/frontend/snippets/components/show_spec.js | 19 +++- .../resolvers/snippets/blobs_resolver_spec.rb | 13 ++- spec/graphql/resolvers/users_resolver_spec.rb | 19 +++- spec/lib/banzai/filter/math_filter_spec.rb | 8 ++ .../hook/validate_addresses_interceptor_spec.rb | 52 +++++++++++ spec/models/concerns/token_authenticatable_spec.rb | 103 +++++++++++++++++++++ .../encrypted_spec.rb | 45 +++++++++ spec/models/group_spec.rb | 8 ++ spec/models/note_spec.rb | 10 ++ spec/models/project_spec.rb | 12 ++- spec/models/snippet_spec.rb | 34 +++++++ spec/requests/api/graphql/users_spec.rb | 24 +++-- spec/requests/api/notes_spec.rb | 10 +- spec/services/members/create_service_spec.rb | 24 ++++- .../models/runners_token_prefix_shared_examples.rb | 35 +++++++ 40 files changed, 677 insertions(+), 70 deletions(-) create mode 100644 app/graphql/types/snippets/blob_connection_type.rb create mode 100644 config/feature_flags/development/groups_runners_token_prefix.yml create mode 100644 config/feature_flags/development/projects_runners_token_prefix.yml create mode 100644 lib/gitlab/email/hook/validate_addresses_interceptor.rb create mode 100644 spec/lib/gitlab/email/hook/validate_addresses_interceptor_spec.rb create mode 100644 spec/support/shared_examples/models/runners_token_prefix_shared_examples.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f06b5984ff..ede4ad6792c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 14.8.2 (2022-02-25) + +### Security (8 changes) + +- [Limit commands_changes to certain keys](gitlab-org/security/gitlab@7a4e348b3ea3d34469bcd353286474c25288d836) ([merge request](gitlab-org/security/gitlab!2225)) +- [Add runners_token prefix to Group and Project](gitlab-org/security/gitlab@87bd94f7252f887f22f971ffd59044b355712042) ([merge request](gitlab-org/security/gitlab!2248)) +- [Anonymous user can enumerate all users through GraphQL endpoint](gitlab-org/security/gitlab@945da4fadb156ce862bdd12ee5625f57709b590d) ([merge request](gitlab-org/security/gitlab!2213)) +- [Check for unsafe characters in email addresses before sending](gitlab-org/security/gitlab@641b23f6b1ad827536ea704c848330a068fc0472) ([merge request](gitlab-org/security/gitlab!2206)) +- [Warn when snippet contains unretrievable files](gitlab-org/security/gitlab@d703ecef74f7d73eab3d5345af3a5d60f28c9d7f) ([merge request](gitlab-org/security/gitlab!2205)) +- [Prevent DOS when rendering math markdown](gitlab-org/security/gitlab@cedf63be73dc9c37352e425cf8b8cf4e16980935) ([merge request](gitlab-org/security/gitlab!2219)) +- [Check permission when creating members through service](gitlab-org/security/gitlab@6228fd285e7062dd1c2e88f8ca33bc8e9a0f4fad) ([merge request](gitlab-org/security/gitlab!2209)) +- [Reset password field on page load](gitlab-org/security/gitlab@5ece8645add37c3e77f28d7afb8f28ce4bbe2b7f) ([merge request](gitlab-org/security/gitlab!2224)) + ## 14.8.1 (2022-02-23) ### Fixed (3 changes) @@ -678,6 +691,19 @@ entry. - [Use `ssh_data` gem instead of `net-ssh` and `sshkey` where possible](gitlab-org/gitlab@59a0ee8605d509753c9aec719f8e0da77bcc679d) ([merge request](gitlab-org/gitlab!77424)) - [Remove feature flag already default enabled](gitlab-org/gitlab@9b7059a4bf9dc2ecdce1910a931cc6967d05b5ad) ([merge request](gitlab-org/gitlab!78238)) **GitLab Enterprise Edition** +## 14.7.4 (2022-02-25) + +### Security (8 changes) + +- [Limit commands_changes to certain keys](gitlab-org/security/gitlab@59351be8d1d868e31bc849482b266e4047710eeb) ([merge request](gitlab-org/security/gitlab!2226)) +- [Add runners_token prefix to Group and Project](gitlab-org/security/gitlab@74615b7fd5359c4da7f1a3ca9052685e81e1690f) ([merge request](gitlab-org/security/gitlab!2249)) +- [Anonymous user can enumerate all users through GraphQL endpoint](gitlab-org/security/gitlab@e213dfc546020d3f88b40cdfc0f877138b0aaef5) ([merge request](gitlab-org/security/gitlab!2119)) +- [Check for unsafe characters in email addresses before sending](gitlab-org/security/gitlab@395385ffccfd9d25063531ea955b179d9bc4f0c5) ([merge request](gitlab-org/security/gitlab!2207)) +- [Warn when snippet contains unretrievable files](gitlab-org/security/gitlab@dc4b3c00284e17bcbf20ec2ae1ee7e8a7efae9b2) ([merge request](gitlab-org/security/gitlab!2204)) +- [Prevent DOS when rendering math markdown](gitlab-org/security/gitlab@f01674f210dee4c803b4850292d16412463b18e3) ([merge request](gitlab-org/security/gitlab!2200)) +- [Check permission when creating members through service](gitlab-org/security/gitlab@4f9b302511ddfaf07af8d08d848252e0c64ff307) ([merge request](gitlab-org/security/gitlab!2210)) +- [Reset password field on page load](gitlab-org/security/gitlab@1a6541462e1ddd58ea9a172fbd3c0b9026760784) ([merge request](gitlab-org/security/gitlab!2193)) + ## 14.7.3 (2022-02-15) ### Fixed (2 changes) @@ -1153,6 +1179,19 @@ See https://about.gitlab.com/releases/2022/02/03/security-release-gitlab-14-7-1- - [Fix Gitlab/DelegatePredicateMethods offenses](gitlab-org/gitlab@518700a11025b0000ff3ce011638417a882612b0) by @edith007 ([merge request](gitlab-org/gitlab!76001)) - [Fix Rails/SaveBang offenses](gitlab-org/gitlab@513b0e1dbdf95ea595e7548ff26929e0be30ce29) by @edith007 ([merge request](gitlab-org/gitlab!75894)) **GitLab Enterprise Edition** +## 14.6.5 (2022-02-25) + +### Security (8 changes) + +- [Limit commands_changes to certain keys](gitlab-org/security/gitlab@138c437f2819d62ce4750fb84399d8868c844b01) ([merge request](gitlab-org/security/gitlab!2227)) +- [Add runners_token prefix to Group and Project](gitlab-org/security/gitlab@682d4e9b63d3d36901638edc75c1b265460d42dc) ([merge request](gitlab-org/security/gitlab!2250)) +- [Anonymous user can enumerate all users through GraphQL endpoint](gitlab-org/security/gitlab@2b00a8036b291d3ad5de551a5e13c2a0a39d0234) ([merge request](gitlab-org/security/gitlab!2102)) +- [Check for unsafe characters in email addresses before sending](gitlab-org/security/gitlab@6bc653b3dadefb3d2c80823786d43e6b7f8c4620) ([merge request](gitlab-org/security/gitlab!2208)) +- [Warn when snippet contains unretrievable files](gitlab-org/security/gitlab@f9ae9515ec98ab934f4aa3a35af0aca806bbe21d) ([merge request](gitlab-org/security/gitlab!2203)) +- [Prevent DOS when rendering math markdown](gitlab-org/security/gitlab@fd6d496df6f4b5eb3da0b851f9ff8ebb1d68d3f2) ([merge request](gitlab-org/security/gitlab!2201)) +- [Check permission when creating members through service](gitlab-org/security/gitlab@948e5103285de2a6cdb5152ff2c13ae4db2f4cda) ([merge request](gitlab-org/security/gitlab!2211)) +- [Reset password field on page load](gitlab-org/security/gitlab@1417b463f2771a4b17e068dea9de3aa6c4540962) ([merge request](gitlab-org/security/gitlab!2194)) + ## 14.6.4 (2022-02-03) ### Security diff --git a/app/assets/javascripts/mirrors/mirror_repos.js b/app/assets/javascripts/mirrors/mirror_repos.js index e59da18fb77..5bf08be1ead 100644 --- a/app/assets/javascripts/mirrors/mirror_repos.js +++ b/app/assets/javascripts/mirrors/mirror_repos.js @@ -6,6 +6,8 @@ import { __ } from '~/locale'; import { hide } from '~/tooltips'; import SSHMirror from './ssh_mirror'; +const PASSWORD_FIELD_SELECTOR = '.js-mirror-password-field'; + export default class MirrorRepos { constructor(container) { this.$container = $(container); @@ -27,7 +29,6 @@ export default class MirrorRepos { this.$passwordGroup = $('.js-password-group', this.$container); this.$password = $('.js-password', this.$passwordGroup); this.$authMethod = $('.js-auth-method', this.$form); - this.$keepDivergentRefsInput.on('change', () => this.updateKeepDivergentRefs()); this.$authMethod.on('change', () => this.togglePassword()); this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl()); @@ -35,6 +36,13 @@ export default class MirrorRepos { this.initMirrorSSH(); this.updateProtectedBranches(); this.updateKeepDivergentRefs(); + MirrorRepos.resetPasswordField(); + } + + static resetPasswordField() { + if (document.querySelector(PASSWORD_FIELD_SELECTOR)) { + document.querySelector(PASSWORD_FIELD_SELECTOR).value = ''; + } } initMirrorSSH() { diff --git a/app/assets/javascripts/snippets/components/show.vue b/app/assets/javascripts/snippets/components/show.vue index 35d88d5ec8e..ee8b00c1f5d 100644 --- a/app/assets/javascripts/snippets/components/show.vue +++ b/app/assets/javascripts/snippets/components/show.vue @@ -1,5 +1,5 @@