diff options
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/database/duplicate_indexes.rb | 77 | ||||
-rw-r--r-- | spec/support/helpers/database/duplicate_indexes.yml | 265 | ||||
-rw-r--r-- | spec/support/helpers/features/admin_users_helpers.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers/features/highlight_content_helper.rb | 19 | ||||
-rw-r--r-- | spec/support/helpers/features/runners_helpers.rb | 10 | ||||
-rw-r--r-- | spec/support/helpers/filtered_search_helpers.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers/loose_foreign_keys_helper.rb | 11 | ||||
-rw-r--r-- | spec/support/helpers/sign_up_helpers.rb | 27 | ||||
-rw-r--r-- | spec/support/helpers/stub_gitlab_calls.rb | 14 | ||||
-rw-r--r-- | spec/support/helpers/x509_helpers.rb | 181 |
10 files changed, 597 insertions, 11 deletions
diff --git a/spec/support/helpers/database/duplicate_indexes.rb b/spec/support/helpers/database/duplicate_indexes.rb new file mode 100644 index 00000000000..0ad8ee1e055 --- /dev/null +++ b/spec/support/helpers/database/duplicate_indexes.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Database + class DuplicateIndexes + attr_accessor :table_name, :indexes + + BTREE_INDEX_STRUCT = Struct.new(:name, :columns, :unique) + + def initialize(table_name, indexes) + @table_name = table_name + @indexes = indexes + end + + def duplicate_indexes + ret = {} + + btree_indexes.each do |btree_index| + matching_indexes = matching_indexes_for(btree_index) + next unless matching_indexes.any? + + ret[btree_index] = matching_indexes + end + + ret + end + + def self.btree_index_struct(index) + BTREE_INDEX_STRUCT.new( + index.name, + Array.wrap(index.columns).map do |column| + # https://apidock.com/rails/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements/indexes + # asc is the default order + column_order = index.orders.is_a?(Symbol) ? index.orders : (index.orders[column] || :asc) + { name: column, order: column_order } + end, + index.unique + ) + end + + private + + def btree_indexes + return @btree_indexes if @btree_indexes + + # We only scan non-conditional btree indexes + @btree_indexes = indexes.select do |index| + index.using == :btree && index.where.nil? && index.opclasses.blank? + end + + @btree_indexes = @btree_indexes.map { |index| self.class.btree_index_struct(index) } + end + + def matching_indexes_for(btree_index) + all_matching_indexes = [] + + # When comparing btree_index with other_index. btree_index is the index that can have more columns + # than the other_index. + (1..btree_index.columns.length).each do |subset_length| + columns = btree_index.columns.first(subset_length) + matching_indexes = btree_indexes.reject { |other_index| other_index == btree_index }.select do |other_index| + other_index.columns == columns + end + + # For now we ignore other indexes that are UNIQUE and have a matching columns subset of + # the btree_index columns, as UNIQUE indexes are still needed to enforce uniqueness + # constraints on subset of the columns. + matching_indexes = matching_indexes.reject do |other_index| + (other_index.unique && (other_index.columns.length < btree_index.columns.length)) + end + + all_matching_indexes += matching_indexes + end + + all_matching_indexes + end + end +end diff --git a/spec/support/helpers/database/duplicate_indexes.yml b/spec/support/helpers/database/duplicate_indexes.yml new file mode 100644 index 00000000000..02efdabd70b --- /dev/null +++ b/spec/support/helpers/database/duplicate_indexes.yml @@ -0,0 +1,265 @@ +--- +# It maps table_name to {index1: array_of_duplicate_indexes, index2: array_of_duplicate_indexes, ... } +abuse_reports: + idx_abuse_reports_user_id_status_and_category: + - index_abuse_reports_on_user_id +alert_management_http_integrations: + index_http_integrations_on_project_and_endpoint: + - index_alert_management_http_integrations_on_project_id +analytics_cycle_analytics_group_stages: + index_group_stages_on_group_id_group_value_stream_id_and_name: + - index_analytics_ca_group_stages_on_group_id +approval_project_rules_users: + index_approval_project_rules_users_1: + - index_approval_project_rules_users_on_approval_project_rule_id +approvals: + index_approvals_on_merge_request_id_and_created_at: + - index_approvals_on_merge_request_id +board_group_recent_visits: + index_board_group_recent_visits_on_user_group_and_board: + - index_board_group_recent_visits_on_user_id +board_project_recent_visits: + index_board_project_recent_visits_on_user_project_and_board: + - index_board_project_recent_visits_on_user_id +board_user_preferences: + index_board_user_preferences_on_user_id_and_board_id: + - index_board_user_preferences_on_user_id +boards_epic_board_recent_visits: + index_epic_board_recent_visits_on_user_group_and_board: + - index_boards_epic_board_recent_visits_on_user_id +boards_epic_user_preferences: + index_boards_epic_user_preferences_on_board_user_epic_unique: + - index_boards_epic_user_preferences_on_board_id +bulk_import_batch_trackers: + i_bulk_import_trackers_id_batch_number: + - index_bulk_import_batch_trackers_on_tracker_id +bulk_import_export_batches: + i_bulk_import_export_batches_id_batch_number: + - index_bulk_import_export_batches_on_export_id +ci_job_artifacts: + index_ci_job_artifacts_on_id_project_id_and_created_at: + - index_ci_job_artifacts_on_project_id + index_ci_job_artifacts_on_id_project_id_and_file_type: + - index_ci_job_artifacts_on_project_id + index_ci_job_artifacts_on_project_id_and_id: + - index_ci_job_artifacts_on_project_id +ci_pipeline_artifacts: + index_ci_pipeline_artifacts_on_pipeline_id_and_file_type: + - index_ci_pipeline_artifacts_on_pipeline_id +ci_stages: + index_ci_stages_on_pipeline_id_and_name: + - index_ci_stages_on_pipeline_id + index_ci_stages_on_pipeline_id_and_position: + - index_ci_stages_on_pipeline_id + index_ci_stages_on_pipeline_id_convert_to_bigint_and_name: + - index_ci_stages_on_pipeline_id_convert_to_bigint + index_ci_stages_on_pipeline_id_convert_to_bigint_and_position: + - index_ci_stages_on_pipeline_id_convert_to_bigint +dast_site_tokens: + index_dast_site_token_on_project_id_and_url: + - index_dast_site_tokens_on_project_id +design_management_designs: + index_design_management_designs_on_iid_and_project_id: + - index_design_management_designs_on_project_id +design_management_designs_versions: + design_management_designs_versions_uniqueness: + - index_design_management_designs_versions_on_design_id +error_tracking_errors: + index_et_errors_on_project_id_and_status_and_id: + - index_error_tracking_errors_on_project_id + index_et_errors_on_project_id_and_status_events_count_id_desc: + - index_error_tracking_errors_on_project_id + index_et_errors_on_project_id_and_status_first_seen_at_id_desc: + - index_error_tracking_errors_on_project_id + index_et_errors_on_project_id_and_status_last_seen_at_id_desc: + - index_error_tracking_errors_on_project_id +geo_node_namespace_links: + index_geo_node_namespace_links_on_geo_node_id_and_namespace_id: + - index_geo_node_namespace_links_on_geo_node_id +in_product_marketing_emails: + index_in_product_marketing_emails_on_user_campaign: + - index_in_product_marketing_emails_on_user_id + index_in_product_marketing_emails_on_user_track_series: + - index_in_product_marketing_emails_on_user_id +incident_management_oncall_participants: + index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id: + - index_inc_mgmnt_oncall_participants_on_oncall_user_id +incident_management_oncall_schedules: + index_im_oncall_schedules_on_project_id_and_iid: + - index_incident_management_oncall_schedules_on_project_id +instance_audit_events_streaming_headers: + idx_instance_external_audit_event_destination_id_key_uniq: + - idx_headers_instance_external_audit_event_destination_id +issue_links: + index_issue_links_on_source_id_and_target_id: + - index_issue_links_on_source_id +issues: + index_issues_on_author_id_and_id_and_created_at: + - index_issues_on_author_id +jira_connect_subscriptions: + idx_jira_connect_subscriptions_on_installation_id_namespace_id: + - idx_jira_connect_subscriptions_on_installation_id +list_user_preferences: + index_list_user_preferences_on_user_id_and_list_id: + - index_list_user_preferences_on_user_id +member_tasks: + index_member_tasks_on_member_id_and_project_id: + - index_member_tasks_on_member_id +members: + index_members_on_member_namespace_id_compound: + - index_members_on_member_namespace_id +merge_request_assignees: + index_merge_request_assignees_on_merge_request_id_and_user_id: + - index_merge_request_assignees_on_merge_request_id +merge_request_metrics: + index_mr_metrics_on_target_project_id_merged_at_nulls_last: + - index_merge_request_metrics_on_target_project_id +merge_requests: + index_merge_requests_on_author_id_and_created_at: + - index_merge_requests_on_author_id + index_merge_requests_on_author_id_and_id: + - index_merge_requests_on_author_id + index_merge_requests_on_author_id_and_target_project_id: + - index_merge_requests_on_author_id +ml_candidate_params: + index_ml_candidate_params_on_candidate_id_on_name: + - index_ml_candidate_params_on_candidate_id +ml_candidates: + index_ml_candidates_on_project_id_on_internal_id: + - index_ml_candidates_on_project_id +ml_model_versions: + index_ml_model_versions_on_project_id_and_model_id_and_version: + - index_ml_model_versions_on_project_id +ml_models: + index_ml_models_on_project_id_and_name: + - index_ml_models_on_project_id +p_ci_runner_machine_builds: + index_p_ci_runner_machine_builds_on_runner_machine_id: + - index_ci_runner_machine_builds_on_runner_machine_id +packages_debian_group_distributions: + uniq_pkgs_debian_group_distributions_group_id_and_codename: + - index_packages_debian_group_distributions_on_group_id + uniq_pkgs_debian_group_distributions_group_id_and_suite: + - index_packages_debian_group_distributions_on_group_id +packages_debian_project_distributions: + uniq_pkgs_debian_project_distributions_project_id_and_codename: + - index_packages_debian_project_distributions_on_project_id + uniq_pkgs_debian_project_distributions_project_id_and_suite: + - index_packages_debian_project_distributions_on_project_id +packages_tags: + index_packages_tags_on_package_id_and_updated_at: + - index_packages_tags_on_package_id +pages_domains: + index_pages_domains_on_project_id_and_enabled_until: + - index_pages_domains_on_project_id + index_pages_domains_on_verified_at_and_enabled_until: + - index_pages_domains_on_verified_at +personal_access_tokens: + index_pat_on_user_id_and_expires_at: + - index_personal_access_tokens_on_user_id +pm_affected_packages: + i_affected_packages_unique_for_upsert: + - index_pm_affected_packages_on_pm_advisory_id +pm_package_version_licenses: + i_pm_package_version_licenses_join_ids: + - index_pm_package_version_licenses_on_pm_package_version_id +pm_package_versions: + i_pm_package_versions_on_package_id_and_version: + - index_pm_package_versions_on_pm_package_id +project_compliance_standards_adherence: + u_project_compliance_standards_adherence_for_reporting: + - index_project_compliance_standards_adherence_on_project_id +project_relation_exports: + index_project_export_job_relation: + - index_project_relation_exports_on_project_export_job_id +project_repositories: + index_project_repositories_on_shard_id_and_project_id: + - index_project_repositories_on_shard_id +project_topics: + index_project_topics_on_project_id_and_topic_id: + - index_project_topics_on_project_id +projects: + index_projects_api_path_id_desc: + - index_on_projects_path + index_projects_on_path_and_id: + - index_on_projects_path +protected_environments: + index_protected_environments_on_project_id_and_name: + - index_protected_environments_on_project_id +protected_tags: + index_protected_tags_on_project_id_and_name: + - index_protected_tags_on_project_id +related_epic_links: + index_related_epic_links_on_source_id_and_target_id: + - index_related_epic_links_on_source_id +requirements_management_test_reports: + idx_test_reports_on_issue_id_created_at_and_id: + - index_requirements_management_test_reports_on_issue_id +sbom_component_versions: + index_sbom_component_versions_on_component_id_and_version: + - index_sbom_component_versions_on_component_id +sbom_occurrences: + index_sbom_occurrences_for_input_file_path_search: + - index_sbom_occurrences_on_project_id_component_id + - index_sbom_occurrences_on_project_id + idx_sbom_occurrences_on_project_id_and_source_id: + - index_sbom_occurrences_on_project_id + index_sbom_occurrences_on_project_id_and_id: + - index_sbom_occurrences_on_project_id + index_sbom_occurrences_on_project_id_component_id: + - index_sbom_occurrences_on_project_id + index_sbom_occurrences_on_project_id_and_component_id_and_id: + - index_sbom_occurrences_on_project_id_component_id + - index_sbom_occurrences_on_project_id + index_sbom_occurrences_on_project_id_and_package_manager: + - index_sbom_occurrences_on_project_id +scan_result_policies: + index_scan_result_policies_on_position_in_configuration: + - index_scan_result_policies_on_policy_configuration_id +search_namespace_index_assignments: + index_search_namespace_index_assignments_uniqueness_index_type: + - index_search_namespace_index_assignments_on_namespace_id + index_search_namespace_index_assignments_uniqueness_on_index_id: + - index_search_namespace_index_assignments_on_namespace_id +sprints: + sequence_is_unique_per_iterations_cadence_id: + - index_sprints_iterations_cadence_id +taggings: + taggings_idx: + - index_taggings_on_tag_id +term_agreements: + term_agreements_unique_index: + - index_term_agreements_on_user_id +todos: + index_todos_on_author_id_and_created_at: + - index_todos_on_author_id +user_callouts: + index_user_callouts_on_user_id_and_feature_name: + - index_user_callouts_on_user_id +users: + index_users_on_state_and_user_type: + - index_users_on_state +vulnerabilities: + index_vulnerabilities_project_id_state_severity_default_branch: + - index_vulnerabilities_on_project_id_and_state_and_severity +vulnerability_external_issue_links: + idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue: + - index_vulnerability_external_issue_links_on_vulnerability_id +vulnerability_finding_links: + finding_link_name_url_idx: + - finding_links_on_vulnerability_occurrence_id +vulnerability_finding_signatures: + idx_vuln_signatures_uniqueness_signature_sha: + - index_vulnerability_finding_signatures_on_finding_id +vulnerability_flags: + index_vulnerability_flags_on_unique_columns: + - index_vulnerability_flags_on_vulnerability_occurrence_id +web_hook_logs: + index_web_hook_logs_on_web_hook_id_and_created_at: + - index_web_hook_logs_part_on_web_hook_id +web_hooks: + index_web_hooks_on_project_id_recent_failures: + - index_web_hooks_on_project_id +work_item_hierarchy_restrictions: + index_work_item_hierarchy_restrictions_on_parent_and_child: + - index_work_item_hierarchy_restrictions_on_parent_type_id diff --git a/spec/support/helpers/features/admin_users_helpers.rb b/spec/support/helpers/features/admin_users_helpers.rb index 9a87ccf113a..b4477537a40 100644 --- a/spec/support/helpers/features/admin_users_helpers.rb +++ b/spec/support/helpers/features/admin_users_helpers.rb @@ -4,7 +4,7 @@ module Features module AdminUsersHelpers def click_user_dropdown_toggle(user_id) page.within("[data-testid='user-actions-#{user_id}']") do - find("[data-testid='dropdown-toggle']").click + find("[data-testid='user-actions-dropdown-toggle']").click end end diff --git a/spec/support/helpers/features/highlight_content_helper.rb b/spec/support/helpers/features/highlight_content_helper.rb new file mode 100644 index 00000000000..f55dd213061 --- /dev/null +++ b/spec/support/helpers/features/highlight_content_helper.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# This helper allows you to reliably highlight text within a given Element by +# simulating mouse actions. +# +module Features + module HighlightContentHelper + def highlight_content(node) + height = node.native.rect.height + width = node.native.rect.width + page.driver.browser.action + .move_to(node.native, -(width / 2), -(height / 2)) + .click_and_hold + .move_by(width, height) + .release + .perform + end + end +end diff --git a/spec/support/helpers/features/runners_helpers.rb b/spec/support/helpers/features/runners_helpers.rb index dbd1edade8c..7c3618ee799 100644 --- a/spec/support/helpers/features/runners_helpers.rb +++ b/spec/support/helpers/features/runners_helpers.rb @@ -23,11 +23,13 @@ module Features def input_filtered_search_keys(search_term) focus_filtered_search - page.find(search_bar_selector).find('input').send_keys(search_term) - # blur input - find('body').click + page.within(search_bar_selector) do + send_keys(search_term) + send_keys(:enter) + + click_on 'Search' + end - page.click_on 'Search' wait_for_requests end diff --git a/spec/support/helpers/filtered_search_helpers.rb b/spec/support/helpers/filtered_search_helpers.rb index 60638eb06cd..abd5d78e836 100644 --- a/spec/support/helpers/filtered_search_helpers.rb +++ b/spec/support/helpers/filtered_search_helpers.rb @@ -155,7 +155,7 @@ module FilteredSearchHelpers end def default_placeholder - 'Search or filter results...' + 'Search or filter results…' end def get_filtered_search_placeholder diff --git a/spec/support/helpers/loose_foreign_keys_helper.rb b/spec/support/helpers/loose_foreign_keys_helper.rb new file mode 100644 index 00000000000..c83c60d72ed --- /dev/null +++ b/spec/support/helpers/loose_foreign_keys_helper.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Helper to process deletions of associated records created via loose foreign keys + +module LooseForeignKeysHelper + def process_loose_foreign_key_deletions(record:) + LooseForeignKeys::DeletedRecord.using_connection(record.connection) do + LooseForeignKeys::ProcessDeletedRecordsService.new(connection: record.connection).execute + end + end +end diff --git a/spec/support/helpers/sign_up_helpers.rb b/spec/support/helpers/sign_up_helpers.rb new file mode 100644 index 00000000000..6259467232c --- /dev/null +++ b/spec/support/helpers/sign_up_helpers.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +module SignUpHelpers + def fill_in_sign_up_form(new_user, submit_button_text = 'Register') + fill_in 'new_user_first_name', with: new_user.first_name + fill_in 'new_user_last_name', with: new_user.last_name + fill_in 'new_user_username', with: new_user.username + fill_in 'new_user_email', with: new_user.email + fill_in 'new_user_password', with: new_user.password + + wait_for_all_requests + + expect_username_to_be_validated + + yield if block_given? + + click_button submit_button_text + end + + private + + def expect_username_to_be_validated + expect(page).to have_selector('[data-testid="new-user-username-field"].gl-field-success-outline') + end +end diff --git a/spec/support/helpers/stub_gitlab_calls.rb b/spec/support/helpers/stub_gitlab_calls.rb index 6d0e97b0a75..c02ffe07159 100644 --- a/spec/support/helpers/stub_gitlab_calls.rb +++ b/spec/support/helpers/stub_gitlab_calls.rb @@ -23,13 +23,17 @@ module StubGitlabCalls end def stub_ci_pipeline_yaml_file(ci_yaml_content) - allow_any_instance_of(Gitlab::Ci::ProjectConfig::Repository) - .to receive(:file_in_repository?) - .and_return(ci_yaml_content.present?) + blob = instance_double(Blob, empty?: ci_yaml_content.blank?, data: ci_yaml_content) + allow(blob).to receive(:load_all_data!) allow_any_instance_of(Repository) - .to receive(:gitlab_ci_yml_for) - .and_return(ci_yaml_content) + .to receive(:blob_at) + .and_call_original + + allow_any_instance_of(Repository) + .to receive(:blob_at) + .with(String, '.gitlab-ci.yml') + .and_return(blob) # Ensure we don't hit auto-devops when config not found in repository unless ci_yaml_content diff --git a/spec/support/helpers/x509_helpers.rb b/spec/support/helpers/x509_helpers.rb index 1dc8b1d4845..aa5c360d953 100644 --- a/spec/support/helpers/x509_helpers.rb +++ b/spec/support/helpers/x509_helpers.rb @@ -173,6 +173,10 @@ module X509Helpers Time.at(1561027326) end + def signed_tag_time + Time.at(1574261780) + end + def signed_tag_signature <<~SIGNATURE -----BEGIN SIGNED MESSAGE----- @@ -337,6 +341,10 @@ module X509Helpers 'r.meier@siemens.com' end + def tag_email + 'dmitriy.zaporozhets@gmail.com' + end + def certificate_issuer 'CN=Siemens Issuing CA EE Auth 2016,OU=Siemens Trust Center,serialNumber=ZZZZZZA2,O=Siemens,L=Muenchen,ST=Bayern,C=DE' end @@ -357,4 +365,177 @@ module X509Helpers ['r.meier@siemens.com'] end end + + module User2 + extend self + + def commit + '440bf5b2b499a90d9adcbebe3752f8c6f245a1aa' + end + + def path + 'gitlab-test' + end + + def trust_cert + <<~TRUSTCERTIFICATE + -----BEGIN CERTIFICATE----- + MIICGjCCAaGgAwIBAgIUALnViVfnU0brJasmRkHrn/UnfaQwCgYIKoZIzj0EAwMw + KjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0y + MjA0MTMyMDA2MTVaFw0zMTEwMDUxMzU2NThaMDcxFTATBgNVBAoTDHNpZ3N0b3Jl + LmRldjEeMBwGA1UEAxMVc2lnc3RvcmUtaW50ZXJtZWRpYXRlMHYwEAYHKoZIzj0C + AQYFK4EEACIDYgAE8RVS/ysH+NOvuDZyPIZtilgUF9NlarYpAd9HP1vBBH1U5CV7 + 7LSS7s0ZiH4nE7Hv7ptS6LvvR/STk798LVgMzLlJ4HeIfF3tHSaexLcYpSASr1kS + 0N/RgBJz/9jWCiXno3sweTAOBgNVHQ8BAf8EBAMCAQYwEwYDVR0lBAwwCgYIKwYB + BQUHAwMwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU39Ppz1YkEZb5qNjp + KFWixi4YZD8wHwYDVR0jBBgwFoAUWMAeX5FFpWapesyQoZMi0CrFxfowCgYIKoZI + zj0EAwMDZwAwZAIwPCsQK4DYiZYDPIaDi5HFKnfxXx6ASSVmERfsynYBiX2X6SJR + nZU84/9DZdnFvvxmAjBOt6QpBlc4J/0DxvkTCqpclvziL6BCCPnjdlIB3Pu3BxsP + mygUY7Ii2zbdCdliiow= + -----END CERTIFICATE----- + TRUSTCERTIFICATE + end + + def signed_commit_signature + <<~SIGNATURE + -----BEGIN SIGNED MESSAGE----- + MIIEOQYJKoZIhvcNAQcCoIIEKjCCBCYCAQExDTALBglghkgBZQMEAgEwCwYJKoZI + hvcNAQcBoIIC2jCCAtYwggJdoAMCAQICFC5R9EXk+ljFhyCs4urRxmCuvQNAMAoG + CCqGSM49BAMDMDcxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjEeMBwGA1UEAxMVc2ln + c3RvcmUtaW50ZXJtZWRpYXRlMB4XDTIzMDgxOTE3NTgwNVoXDTIzMDgxOTE4MDgw + NVowADBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABBGajWb10Rt36IMxtJmjRDa7 + 5O6YCLhVq9+LNJSAx2M7p6netqW7W+lwym4z1Y1gXLdGHBshrbx/yr6Trhh2TCej + ggF8MIIBeDAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYD + VR0OBBYEFBttEjGzNppCqA4tlZY4oaxkdmQbMB8GA1UdIwQYMBaAFN/T6c9WJBGW + +ajY6ShVosYuGGQ/MCUGA1UdEQEB/wQbMBmBF2dpdGxhYmdwZ3Rlc3RAZ21haWwu + Y29tMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0 + aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0 + aDCBiwYKKwYBBAHWeQIEAgR9BHsAeQB3AN09MGrGxxEyYxkeHJlnNwKiSl643jyt + /4eKcoAvKe6OAAABig7ydOsAAAQDAEgwRgIhAMqJnFLAspeqfbK/gA/7zjceyExq + QN7qDXWKRLS01rTvAiEAp/uBShQb9tVa3P3fYVAMiXydvr5dqCpNiuudZiuYq0Yw + CgYIKoZIzj0EAwMDZwAwZAIwWKXYyP5FvbfhvfLkV0tN887ax1eg7TmF1Tzkugag + cLJ5MzK3xYNcUO/3AxO3H/b8AjBD9DF6R4kFO4cXoqnpsk2FTUeSPiUJ+0x2PDFG + gQZvoMWz7CnwjXml8XDEKNpYoPkxggElMIIBIQIBATBPMDcxFTATBgNVBAoTDHNp + Z3N0b3JlLmRldjEeMBwGA1UEAxMVc2lnc3RvcmUtaW50ZXJtZWRpYXRlAhQuUfRF + 5PpYxYcgrOLq0cZgrr0DQDALBglghkgBZQMEAgGgaTAYBgkqhkiG9w0BCQMxCwYJ + KoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzA4MTkxNzU4MDVaMC8GCSqGSIb3 + DQEJBDEiBCB4B7DeGk22WmBseJzjjRJcQsyYxu0PNDAFXq55uJ7MSzAKBggqhkjO + PQQDAgRHMEUCIQCNegIrK6m1xyGuu4lw06l22VQsmO74/k3H236jCFF+bAIgAX1N + rxBFWnjWboZmAV1NuduTD/YToShK6iRmJ/NpILA= + -----END SIGNED MESSAGE----- + SIGNATURE + end + + def signed_commit_base_data + <<~SIGNEDDATA + tree 7d5ee08cadaa161d731c56a9265feef130143b07 + parent 4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 + author Mona Lisa <gitlabgpgtest@gmail.com> 1692467872 +0000 + committer Mona Lisa <gitlabgpgtest@gmail.com> 1692467872 +0000 + + Sigstore Signed Commit + SIGNEDDATA + end + + def signed_commit_time + Time.at(1692467872) + end + + def signed_tag_time + Time.at(1692467872) + end + + def signed_tag_signature + <<~SIGNATURE + -----BEGIN SIGNED MESSAGE----- + MIIEOgYJKoZIhvcNAQcCoIIEKzCCBCcCAQExDTALBglghkgBZQMEAgEwCwYJKoZI + hvcNAQcBoIIC2zCCAtcwggJdoAMCAQICFB5qFHBSNfcJDZecnHK5/tleuX3yMAoG + CCqGSM49BAMDMDcxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjEeMBwGA1UEAxMVc2ln + c3RvcmUtaW50ZXJtZWRpYXRlMB4XDTIzMDgxOTE3NTgzM1oXDTIzMDgxOTE4MDgz + M1owADBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKJtbdL88PM8lE21CuyDYlZm + 0xZYCThoXZSGmULrgE5+hfroCIbLswOi5i6TyB8j4CCe0Jxeu94Jn+76SXF+lbej + ggF8MIIBeDAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYD + VR0OBBYEFBkU3IBENVJYeyK9b56vbGGrjPwYMB8GA1UdIwQYMBaAFN/T6c9WJBGW + +ajY6ShVosYuGGQ/MCUGA1UdEQEB/wQbMBmBF2dpdGxhYmdwZ3Rlc3RAZ21haWwu + Y29tMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0 + aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0 + aDCBiwYKKwYBBAHWeQIEAgR9BHsAeQB3AN09MGrGxxEyYxkeHJlnNwKiSl643jyt + /4eKcoAvKe6OAAABig7y4tYAAAQDAEgwRgIhAMUjWh8ayhjWDI3faFah3Du/7IuY + xzbUXaPQnCyUbvwwAiEAwHgWv8fmKMudbVu37Nbq/c1cdnQqDK9Y2UGtlmzaLrYw + CgYIKoZIzj0EAwMDaAAwZQIwZTKZlS4HNJH48km3pxG95JTbldSBhvFlrpIEVRUd + TEK6uGQJmpIm1WYQjbJbiVS8AjEA+2NoAdMuRpa2k13HUfWQEMtzQcxZMMNB7Yux + 9ZIADOlFp701ujtFSZAXgqGL3FYKMYIBJTCCASECAQEwTzA3MRUwEwYDVQQKEwxz + aWdzdG9yZS5kZXYxHjAcBgNVBAMTFXNpZ3N0b3JlLWludGVybWVkaWF0ZQIUHmoU + cFI19wkNl5yccrn+2V65ffIwCwYJYIZIAWUDBAIBoGkwGAYJKoZIhvcNAQkDMQsG + CSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMjMwODE5MTc1ODMzWjAvBgkqhkiG + 9w0BCQQxIgQgwpYCAlbS6KnfgxQD3SATWUbdUssLaBWkHwTkmtCye4wwCgYIKoZI + zj0EAwIERzBFAiB8y5bGhWJvWCHQyma7oF038ZPLzXmsDJyJffJHoAb6XAIhAOW3 + gxuYuJAKP86B1fY0vYCZHF8vU6SZAcE6teSDowwq + -----END SIGNED MESSAGE----- + SIGNATURE + end + + def signed_tag_base_data + <<~SIGNEDDATA + object 440bf5b2b499a90d9adcbebe3752f8c6f245a1aa + type commit + tag v1.1.2 + tagger Mona Lisa <gitlabgpgtest@gmail.com> 1692467901 +0000 + + Sigstore Signed Tag + SIGNEDDATA + end + + def certificate_serial + 264441215000592123389532407734419590292801651520 + end + + def tag_certificate_serial + 173635382582380059990335547381753891120957980146 + end + + def certificate_subject_key_identifier + '1B:6D:12:31:B3:36:9A:42:A8:0E:2D:95:96:38:A1:AC:64:76:64:1B' + end + + def tag_certificate_subject_key_identifier + '19:14:DC:80:44:35:52:58:7B:22:BD:6F:9E:AF:6C:61:AB:8C:FC:18' + end + + def issuer_subject_key_identifier + 'DF:D3:E9:CF:56:24:11:96:F9:A8:D8:E9:28:55:A2:C6:2E:18:64:3F' + end + + def tag_issuer_subject_key_identifier + 'DF:D3:E9:CF:56:24:11:96:F9:A8:D8:E9:28:55:A2:C6:2E:18:64:3F' + end + + def certificate_email + 'gitlabgpgtest@gmail.com' + end + + def tag_email + 'gitlabgpgtest@gmail.com' + end + + def certificate_issuer + 'CN=sigstore-intermediate,O=sigstore.dev' + end + + def tag_certificate_issuer + 'CN=sigstore-intermediate,O=sigstore.dev' + end + + def certificate_subject + '' + end + + def names + ['Mona Lisa'] + end + + def emails + ['gitlabgpgtest@gmail.com'] + end + end end |