From ba4a8cd57a446145d9614c35ce40bb57abda38c8 Mon Sep 17 00:00:00 2001 From: jayarora Date: Fri, 8 May 2026 15:47:33 +0100 Subject: [PATCH] Add long-running OCI Functions support to Fn CLI --- Dockerfile | 2 +- README.md | 21 +- RELEASES.md | 5 + client/invoke.go | 4 + client/invoke_test.go | 48 + commands/commands.go | 3 +- commands/deploy.go | 18 + commands/init.go | 27 + commands/invoke.go | 13 + commands/watch.go | 343 ++++++ commands/watch_test.go | 242 ++++ common/common.go | 16 +- common/common_test.go | 10 +- common/destinations.go | 66 ++ common/destinations_test.go | 47 + common/detached_timeout.go | 44 + common/detached_timeout_test.go | 36 + common/funcfile.go | 72 ++ common/funcfile_test.go | 57 + common/image_stamp_test.go | 61 + common/oci_provider_support.go | 51 + common/oci_provider_support_test.go | 35 + common/schema.go | 51 + common/schema_test.go | 50 + config/version.go | 2 +- go.mod | 21 +- go.sum | 39 +- langs/base.go | 5 +- langs/java.go | 9 + langs/runtime_support_test.go | 91 ++ main.go | 8 +- objects/fn/clear_destinations_test.go | 30 + objects/fn/fns.go | 365 +++++- objects/fn/output_test.go | 79 ++ test/cli_autocomplete_test.go | 4 +- test/cli_init_long_running_test.go | 28 + test/cli_init_test.go | 2 + test/cli_lang_boilerplate_test.go | 2 + ...li_long_running_clear_destinations_test.go | 22 + test/cli_long_running_destinations_test.go | 34 + test/cli_misc_test.go | 46 + .../fn_go/provider/oracle/shim/fns.go | 189 +++ vendor/github.com/gofrs/flock/.golangci.yml | 114 ++ vendor/github.com/gofrs/flock/.travis.yml | 10 - vendor/github.com/gofrs/flock/LICENSE | 1 + vendor/github.com/gofrs/flock/Makefile | 15 + vendor/github.com/gofrs/flock/README.md | 30 +- vendor/github.com/gofrs/flock/SECURITY.md | 21 + vendor/github.com/gofrs/flock/appveyor.yml | 25 - vendor/github.com/gofrs/flock/build.sh | 18 + vendor/github.com/gofrs/flock/flock.go | 8 +- vendor/github.com/gofrs/flock/flock_unix.go | 17 +- .../{flock_aix.go => flock_unix_variants.go} | 9 +- vendor/github.com/gofrs/flock/flock_winapi.go | 21 +- .../github.com/gofrs/flock/flock_windows.go | 9 +- .../oracle/oci-go-sdk/v65/LICENSE.txt | 6 +- .../oracle/oci-go-sdk/v65/NOTICE.txt | 2 +- .../v65/artifacts/artifacts_client.go | 465 ++++++-- ...ontainer_repository_compartment_details.go | 13 +- ...repository_compartment_request_response.go | 8 +- .../change_repository_compartment_details.go | 13 +- ...repository_compartment_request_response.go | 8 +- .../v65/artifacts/container_configuration.go | 11 +- .../v65/artifacts/container_image.go | 31 +- .../artifacts/container_image_collection.go | 11 +- .../v65/artifacts/container_image_layer.go | 11 +- .../artifacts/container_image_signature.go | 87 +- .../container_image_signature_collection.go | 11 +- .../container_image_signature_summary.go | 39 +- .../v65/artifacts/container_image_summary.go | 27 +- .../v65/artifacts/container_repository.go | 30 +- .../container_repository_collection.go | 11 +- .../artifacts/container_repository_readme.go | 11 +- .../artifacts/container_repository_summary.go | 30 +- .../v65/artifacts/container_version.go | 11 +- ...reate_container_image_signature_details.go | 29 +- ...tainer_image_signature_request_response.go | 6 +- .../create_container_repository_details.go | 23 +- ...e_container_repository_request_response.go | 6 +- .../create_generic_repository_details.go | 29 +- .../artifacts/create_repository_details.go | 51 +- .../create_repository_request_response.go | 6 +- ...delete_container_image_request_response.go | 8 +- ...tainer_image_signature_request_response.go | 8 +- ...e_container_repository_request_response.go | 8 +- ...neric_artifact_by_path_request_response.go | 8 +- ...elete_generic_artifact_request_response.go | 8 +- .../delete_repository_request_response.go | 8 +- .../v65/artifacts/generic_artifact.go | 21 +- .../artifacts/generic_artifact_collection.go | 11 +- .../v65/artifacts/generic_artifact_summary.go | 19 +- .../v65/artifacts/generic_repository.go | 35 +- .../artifacts/generic_repository_summary.go | 35 +- ...ontainer_configuration_request_response.go | 8 +- .../get_container_image_request_response.go | 8 +- ...tainer_image_signature_request_response.go | 8 +- ...t_container_repository_request_response.go | 8 +- ...neric_artifact_by_path_request_response.go | 8 +- .../get_generic_artifact_request_response.go | 8 +- .../get_repository_request_response.go | 8 +- ...ainer_image_signatures_request_response.go | 18 +- .../list_container_images_request_response.go | 18 +- ...container_repositories_request_response.go | 14 +- ...list_generic_artifacts_request_response.go | 14 +- .../list_repositories_request_response.go | 14 +- .../lookup_container_image_by_uri_details.go | 45 + ...container_image_by_uri_request_response.go | 94 ++ .../remove_container_version_details.go | 11 +- ...move_container_version_request_response.go | 8 +- .../oci-go-sdk/v65/artifacts/repository.go | 37 +- .../v65/artifacts/repository_collection.go | 12 +- .../v65/artifacts/repository_summary.go | 47 +- .../restore_container_image_details.go | 11 +- ...estore_container_image_request_response.go | 8 +- .../update_container_configuration_details.go | 11 +- ...ontainer_configuration_request_response.go | 8 +- .../update_container_image_details.go | 50 + ...update_container_image_request_response.go | 103 ++ ...pdate_container_image_signature_details.go | 50 + ...tainer_image_signature_request_response.go | 103 ++ .../update_container_repository_details.go | 21 +- ...e_container_repository_request_response.go | 8 +- ...update_generic_artifact_by_path_details.go | 15 +- ...neric_artifact_by_path_request_response.go | 8 +- .../update_generic_artifact_details.go | 17 +- ...pdate_generic_artifact_request_response.go | 10 +- .../update_generic_repository_details.go | 23 +- .../artifacts/update_repository_details.go | 25 +- .../update_repository_request_response.go | 8 +- .../v65/common/auth/certificate_retriever.go | 2 +- .../v65/common/auth/configuration.go | 2 +- .../v65/common/auth/dispatcher_modifier.go | 2 +- .../v65/common/auth/federation_client.go | 488 +++++++- ...federation_client_oke_workload_identity.go | 101 +- ...nce_principal_delegation_token_provider.go | 2 +- .../auth/instance_principal_key_provider.go | 32 +- .../oracle/oci-go-sdk/v65/common/auth/jwt.go | 2 +- .../v65/common/auth/oauth2_provider.go | 82 ++ ...rce_principal_delegation_token_provider.go | 90 ++ ....go => resource_principal_key_provider.go} | 136 ++- .../resource_principal_token_path_provider.go | 111 +- .../v65/common/auth/resource_principals_v1.go | 2 +- .../v65/common/auth/resource_principals_v3.go | 351 ++++++ .../oci-go-sdk/v65/common/auth/utils.go | 20 +- .../auth/workload_identity_federation.go | 241 ++++ .../oci-go-sdk/v65/common/circuit_breaker.go | 37 +- .../oracle/oci-go-sdk/v65/common/client.go | 306 ++++- .../oracle/oci-go-sdk/v65/common/common.go | 268 ++++- .../oci-go-sdk/v65/common/configuration.go | 118 +- .../oracle/oci-go-sdk/v65/common/errors.go | 17 +- .../v65/common/eventual_consistency.go | 3 +- .../oracle/oci-go-sdk/v65/common/helpers.go | 55 +- .../oracle/oci-go-sdk/v65/common/http.go | 136 ++- .../oci-go-sdk/v65/common/http_signer.go | 4 +- .../oracle/oci-go-sdk/v65/common/log.go | 2 +- .../v65/common/oci_http_transport_wrapper.go | 120 ++ .../oracle/oci-go-sdk/v65/common/regions.go | 148 ++- .../oracle/oci-go-sdk/v65/common/regions.json | 186 +++ .../oracle/oci-go-sdk/v65/common/retry.go | 31 +- .../oracle/oci-go-sdk/v65/common/sseReader.go | 92 ++ .../v65/common/tls_config_provider.go | 156 +++ .../v65/common/transport_template_provider.go | 53 + .../v65/common/utils/opc_request_id.go | 3 +- .../oracle/oci-go-sdk/v65/common/version.go | 4 +- .../oci-go-sdk/v65/functions/application.go | 21 +- .../functions/application_logging_config.go | 84 ++ .../v65/functions/application_summary.go | 21 +- .../v65/functions/application_trace_config.go | 4 +- .../change_application_compartment_details.go | 6 +- ...pplication_compartment_request_response.go | 8 +- .../v65/functions/config_details.go | 4 +- ...constant_provisioned_concurrency_config.go | 4 +- .../functions/create_application_details.go | 19 +- .../create_application_request_response.go | 6 +- .../v65/functions/create_function_details.go | 40 +- .../create_function_request_response.go | 6 +- .../delete_application_request_response.go | 8 +- .../delete_function_request_response.go | 8 +- .../functions/failure_destination_details.go | 141 +++ .../oci-go-sdk/v65/functions/function.go | 43 +- ...function_provisioned_concurrency_config.go | 6 +- .../v65/functions/function_source_details.go | 6 +- .../v65/functions/function_summary.go | 42 +- .../v65/functions/function_trace_config.go | 4 +- .../functions_functionsinvoke_client.go | 11 +- .../functions_functionsmanagement_client.go | 105 +- .../get_application_request_response.go | 8 +- .../get_function_request_response.go | 8 +- .../get_pbf_listing_request_response.go | 6 +- ...et_pbf_listing_version_request_response.go | 6 +- .../v65/functions/image_policy_config.go | 4 +- .../invoke_function_request_response.go | 11 +- .../oci-go-sdk/v65/functions/key_details.go | 6 +- .../list_applications_request_response.go | 10 +- .../list_functions_request_response.go | 10 +- ...t_pbf_listing_versions_request_response.go | 6 +- .../list_pbf_listings_request_response.go | 6 +- .../list_triggers_request_response.go | 6 +- .../none_failure_destination_details.go | 52 + .../none_provisioned_concurrency_config.go | 4 +- .../none_success_destination_details.go | 52 + ...otification_failure_destination_details.go | 55 + ...otification_success_destination_details.go | 55 + .../oci-go-sdk/v65/functions/pbf_listing.go | 4 +- .../v65/functions/pbf_listing_summary.go | 4 +- .../v65/functions/pbf_listing_version.go | 4 +- .../functions/pbf_listing_version_summary.go | 4 +- .../pbf_listing_versions_collection.go | 4 +- .../v65/functions/pbf_listings_collection.go | 4 +- .../v65/functions/policy_details.go | 4 +- .../pre_built_function_source_details.go | 6 +- .../v65/functions/publisher_details.go | 4 +- .../queue_failure_destination_details.go | 58 + .../queue_success_destination_details.go | 58 + .../v65/functions/requirement_details.go | 4 +- .../stream_failure_destination_details.go | 55 + .../stream_success_destination_details.go | 55 + .../functions/success_destination_details.go | 141 +++ .../oci-go-sdk/v65/functions/trigger.go | 4 +- .../v65/functions/trigger_summary.go | 4 +- .../v65/functions/triggers_collection.go | 4 +- .../functions/update_application_details.go | 17 +- .../update_application_request_response.go | 8 +- .../v65/functions/update_function_details.go | 40 +- .../update_function_request_response.go | 8 +- .../auto_key_rotation_details.go | 103 ++ .../v65/keymanagement/backup_key_details.go | 11 +- .../backup_key_request_response.go | 6 +- .../v65/keymanagement/backup_location.go | 11 +- .../keymanagement/backup_location_bucket.go | 9 +- .../v65/keymanagement/backup_location_uri.go | 9 +- .../v65/keymanagement/backup_vault_details.go | 12 +- .../backup_vault_request_response.go | 6 +- ...l_hsm_cluster_deletion_request_response.go | 110 ++ .../cancel_key_deletion_request_response.go | 6 +- ...l_key_version_deletion_request_response.go | 6 +- .../cancel_vault_deletion_request_response.go | 6 +- .../change_hsm_cluster_compartment_details.go | 39 + ...sm_cluster_compartment_request_response.go | 110 ++ .../change_key_compartment_details.go | 13 +- ...change_key_compartment_request_response.go | 7 +- .../change_vault_compartment_details.go | 13 +- ...ange_vault_compartment_request_response.go | 7 +- .../create_ekms_private_endpoint_details.go | 62 + ..._ekms_private_endpoint_request_response.go | 106 ++ .../create_hsm_cluster_details.go | 53 + .../create_hsm_cluster_request_response.go | 103 ++ .../v65/keymanagement/create_key_details.go | 29 +- .../create_key_request_response.go | 6 +- .../create_key_version_request_response.go | 9 +- .../v65/keymanagement/create_vault_details.go | 21 +- .../create_vault_replica_details.go | 39 +- .../create_vault_replica_request_response.go | 6 +- .../create_vault_request_response.go | 6 +- .../v65/keymanagement/decrypt_data_details.go | 11 +- .../keymanagement/decrypt_request_response.go | 6 +- .../v65/keymanagement/decrypted_data.go | 11 +- ..._ekms_private_endpoint_request_response.go | 100 ++ .../delete_vault_replica_details.go | 9 +- .../delete_vault_replica_request_response.go | 6 +- .../disable_key_request_response.go | 6 +- ...ficate_signing_request_request_response.go | 110 ++ .../keymanagement/ekms_private_endpoint.go | 137 +++ .../ekms_private_endpoint_summary.go | 122 ++ .../enable_key_request_response.go | 6 +- .../v65/keymanagement/encrypt_data_details.go | 11 +- .../keymanagement/encrypt_request_response.go | 6 +- .../v65/keymanagement/encrypted_data.go | 11 +- .../v65/keymanagement/export_key_details.go | 9 +- .../export_key_request_response.go | 6 +- .../v65/keymanagement/exported_key_data.go | 9 +- .../external_key_manager_metadata.go | 43 + .../external_key_manager_metadata_summary.go | 47 + .../keymanagement/external_key_reference.go | 39 + .../external_key_reference_details.go | 42 + .../external_key_version_reference.go | 39 + ...te_data_encryption_key_request_response.go | 6 +- .../v65/keymanagement/generate_key_details.go | 11 +- .../v65/keymanagement/generated_key.go | 15 +- ..._ekms_private_endpoint_request_response.go | 95 ++ .../get_hsm_cluster_request_response.go | 95 ++ .../get_hsm_partition_request_response.go | 106 ++ .../keymanagement/get_key_request_response.go | 6 +- .../get_key_version_request_response.go | 6 +- ...re_co_user_credentials_request_response.go | 103 ++ ...get_replication_status_request_response.go | 6 +- .../get_vault_request_response.go | 6 +- .../get_vault_usage_request_response.go | 6 +- .../get_wrapping_key_request_response.go | 6 +- .../v65/keymanagement/hsm_cluster.go | 156 +++ .../keymanagement/hsm_cluster_collection.go | 39 + .../v65/keymanagement/hsm_cluster_summary.go | 78 ++ .../v65/keymanagement/hsm_partition.go | 126 ++ .../keymanagement/hsm_partition_collection.go | 39 + .../keymanagement/hsm_partition_summary.go | 63 + .../v65/keymanagement/import_key_details.go | 16 +- .../import_key_request_response.go | 6 +- .../import_key_version_details.go | 15 +- .../import_key_version_request_response.go | 6 +- .../oci-go-sdk/v65/keymanagement/key.go | 30 +- .../v65/keymanagement/key_replica_details.go | 9 +- .../oci-go-sdk/v65/keymanagement/key_shape.go | 11 +- .../v65/keymanagement/key_summary.go | 27 +- .../v65/keymanagement/key_version.go | 17 +- .../key_version_replica_details.go | 9 +- .../v65/keymanagement/key_version_summary.go | 16 +- .../keymanagement/keymanagement_ekm_client.go | 382 ++++++ .../keymanagement_kmscrypto_client.go | 69 +- .../keymanagement_kmshsmcluster_client.go | 829 +++++++++++++ .../keymanagement_kmsmanagement_client.go | 198 ++-- .../keymanagement_kmsvault_client.go | 126 +- ...ekms_private_endpoints_request_response.go | 203 ++++ .../list_hsm_clusters_request_response.go | 203 ++++ .../list_hsm_partitions_request_response.go | 209 ++++ .../list_key_versions_request_response.go | 8 +- .../list_keys_request_response.go | 14 +- .../list_vault_replicas_request_response.go | 8 +- .../list_vaults_request_response.go | 8 +- .../v65/keymanagement/oauth_metadata.go | 45 + .../keymanagement/oauth_metadata_summary.go | 42 + .../v65/keymanagement/port_information.go | 87 ++ .../keymanagement/pre_co_user_credentials.go | 42 + .../v65/keymanagement/replica_details.go | 9 +- .../replica_external_vault_metadata.go | 57 + .../keymanagement/replica_vault_metadata.go | 115 ++ .../replication_status_details.go | 11 +- .../restore_key_from_file_request_response.go | 6 +- .../restore_key_from_object_store_details.go | 11 +- ..._key_from_object_store_request_response.go | 6 +- ...estore_vault_from_file_request_response.go | 6 +- ...restore_vault_from_object_store_details.go | 11 +- ...ault_from_object_store_request_response.go | 6 +- .../schedule_hsm_cluster_deletion_details.go | 43 + ...e_hsm_cluster_deletion_request_response.go | 113 ++ .../schedule_key_deletion_details.go | 9 +- .../schedule_key_deletion_request_response.go | 6 +- .../schedule_key_version_deletion_details.go | 9 +- ...e_key_version_deletion_request_response.go | 6 +- .../schedule_vault_deletion_details.go | 9 +- ...chedule_vault_deletion_request_response.go | 6 +- .../v65/keymanagement/sign_data_details.go | 15 +- .../keymanagement/sign_request_response.go | 6 +- .../v65/keymanagement/signed_data.go | 11 +- .../update_ekms_private_endpoint_details.go | 47 + ..._ekms_private_endpoint_request_response.go | 105 ++ .../update_hsm_cluster_details.go | 50 + .../update_hsm_cluster_request_response.go | 105 ++ .../v65/keymanagement/update_key_details.go | 20 +- .../update_key_request_response.go | 6 +- .../v65/keymanagement/update_vault_details.go | 15 +- .../update_vault_request_response.go | 6 +- .../upload_partition_certificates_details.go | 42 + ...partition_certificates_request_response.go | 110 ++ .../oci-go-sdk/v65/keymanagement/vault.go | 29 +- .../keymanagement/vault_replica_details.go | 9 +- .../keymanagement/vault_replica_summary.go | 10 +- .../v65/keymanagement/vault_summary.go | 25 +- .../v65/keymanagement/vault_usage.go | 11 +- .../v65/keymanagement/verified_data.go | 11 +- .../v65/keymanagement/verify_data_details.go | 11 +- .../keymanagement/verify_request_response.go | 6 +- .../v65/keymanagement/wrapped_import_key.go | 11 +- .../v65/keymanagement/wrapping_key.go | 11 +- vendor/github.com/youmark/pkcs8/.gitignore | 23 + vendor/github.com/youmark/pkcs8/LICENSE | 21 + vendor/github.com/youmark/pkcs8/README | 1 + vendor/github.com/youmark/pkcs8/README.md | 22 + vendor/github.com/youmark/pkcs8/cipher.go | 60 + .../github.com/youmark/pkcs8/cipher_3des.go | 24 + vendor/github.com/youmark/pkcs8/cipher_aes.go | 84 ++ vendor/github.com/youmark/pkcs8/kdf_pbkdf2.go | 91 ++ vendor/github.com/youmark/pkcs8/kdf_scrypt.go | 62 + vendor/github.com/youmark/pkcs8/pkcs8.go | 309 +++++ vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go | 77 ++ vendor/golang.org/x/crypto/scrypt/scrypt.go | 212 ++++ vendor/golang.org/x/net/context/context.go | 70 +- .../golang.org/x/sys/plan9/pwd_go15_plan9.go | 21 - vendor/golang.org/x/sys/plan9/pwd_plan9.go | 14 +- .../golang.org/x/sys/unix/affinity_linux.go | 9 +- vendor/golang.org/x/sys/unix/fdset.go | 4 +- vendor/golang.org/x/sys/unix/ifreq_linux.go | 4 +- vendor/golang.org/x/sys/unix/mkall.sh | 1 + vendor/golang.org/x/sys/unix/mkerrors.sh | 5 + .../golang.org/x/sys/unix/syscall_darwin.go | 56 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 10 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 17 + .../golang.org/x/sys/unix/syscall_solaris.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 422 ++++++- .../x/sys/unix/zerrors_linux_386.go | 3 + .../x/sys/unix/zerrors_linux_amd64.go | 3 + .../x/sys/unix/zerrors_linux_arm.go | 3 + .../x/sys/unix/zerrors_linux_arm64.go | 3 + .../x/sys/unix/zerrors_linux_loong64.go | 3 + .../x/sys/unix/zerrors_linux_mips.go | 3 + .../x/sys/unix/zerrors_linux_mips64.go | 3 + .../x/sys/unix/zerrors_linux_mips64le.go | 3 + .../x/sys/unix/zerrors_linux_mipsle.go | 3 + .../x/sys/unix/zerrors_linux_ppc.go | 3 + .../x/sys/unix/zerrors_linux_ppc64.go | 3 + .../x/sys/unix/zerrors_linux_ppc64le.go | 3 + .../x/sys/unix/zerrors_linux_riscv64.go | 3 + .../x/sys/unix/zerrors_linux_s390x.go | 3 + .../x/sys/unix/zerrors_linux_sparc64.go | 3 + .../golang.org/x/sys/unix/zsyscall_linux.go | 10 + .../x/sys/unix/zsyscall_solaris_amd64.go | 8 +- .../x/sys/unix/zsysnum_linux_386.go | 1 + .../x/sys/unix/zsysnum_linux_amd64.go | 1 + .../x/sys/unix/zsysnum_linux_arm.go | 1 + .../x/sys/unix/zsysnum_linux_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_loong64.go | 1 + .../x/sys/unix/zsysnum_linux_mips.go | 1 + .../x/sys/unix/zsysnum_linux_mips64.go | 1 + .../x/sys/unix/zsysnum_linux_mips64le.go | 1 + .../x/sys/unix/zsysnum_linux_mipsle.go | 1 + .../x/sys/unix/zsysnum_linux_ppc.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 1 + .../x/sys/unix/zsysnum_linux_riscv64.go | 1 + .../x/sys/unix/zsysnum_linux_s390x.go | 1 + .../x/sys/unix/zsysnum_linux_sparc64.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 211 +++- .../golang.org/x/sys/unix/ztypes_linux_386.go | 18 +- .../x/sys/unix/ztypes_linux_amd64.go | 16 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 20 +- .../x/sys/unix/ztypes_linux_arm64.go | 16 + .../x/sys/unix/ztypes_linux_loong64.go | 16 + .../x/sys/unix/ztypes_linux_mips.go | 18 +- .../x/sys/unix/ztypes_linux_mips64.go | 16 + .../x/sys/unix/ztypes_linux_mips64le.go | 16 + .../x/sys/unix/ztypes_linux_mipsle.go | 18 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 20 +- .../x/sys/unix/ztypes_linux_ppc64.go | 16 + .../x/sys/unix/ztypes_linux_ppc64le.go | 16 + .../x/sys/unix/ztypes_linux_riscv64.go | 16 + .../x/sys/unix/ztypes_linux_s390x.go | 16 + .../x/sys/unix/ztypes_linux_sparc64.go | 16 + .../x/sys/windows/security_windows.go | 49 +- .../x/sys/windows/syscall_windows.go | 23 +- .../golang.org/x/sys/windows/types_windows.go | 310 +++++ .../x/sys/windows/zsyscall_windows.go | 1028 +++++++++-------- vendor/golang.org/x/term/term_windows.go | 4 +- vendor/golang.org/x/term/terminal.go | 81 +- vendor/golang.org/x/text/unicode/bidi/core.go | 11 +- vendor/modules.txt | 33 +- 444 files changed, 17092 insertions(+), 2452 deletions(-) create mode 100644 client/invoke_test.go create mode 100644 commands/watch.go create mode 100644 commands/watch_test.go create mode 100644 common/destinations.go create mode 100644 common/destinations_test.go create mode 100644 common/detached_timeout.go create mode 100644 common/detached_timeout_test.go create mode 100644 common/image_stamp_test.go create mode 100644 common/oci_provider_support.go create mode 100644 common/oci_provider_support_test.go create mode 100644 common/schema_test.go create mode 100644 langs/runtime_support_test.go create mode 100644 objects/fn/clear_destinations_test.go create mode 100644 objects/fn/output_test.go create mode 100644 test/cli_init_long_running_test.go create mode 100644 test/cli_long_running_clear_destinations_test.go create mode 100644 test/cli_long_running_destinations_test.go create mode 100644 vendor/github.com/gofrs/flock/.golangci.yml delete mode 100644 vendor/github.com/gofrs/flock/.travis.yml create mode 100644 vendor/github.com/gofrs/flock/Makefile create mode 100644 vendor/github.com/gofrs/flock/SECURITY.md delete mode 100644 vendor/github.com/gofrs/flock/appveyor.yml create mode 100644 vendor/github.com/gofrs/flock/build.sh rename vendor/github.com/gofrs/flock/{flock_aix.go => flock_unix_variants.go} (96%) create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/auth/oauth2_provider.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_delegation_token_provider.go rename vendor/github.com/oracle/oci-go-sdk/v65/common/auth/{resouce_principal_key_provider.go => resource_principal_key_provider.go} (70%) create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v3.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/auth/workload_identity_federation.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/oci_http_transport_wrapper.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/sseReader.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/tls_config_provider.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/common/transport_template_provider.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/application_logging_config.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/auto_key_rotation_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_hsm_cluster_deletion_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_ekms_private_endpoint_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/download_certificate_signing_request_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint_summary.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata_summary.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_version_reference.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_ekms_private_endpoint_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_cluster_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_partition_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_pre_co_user_credentials_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_collection.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_summary.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_collection.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_summary.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_ekm_client.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmshsmcluster_client.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_ekms_private_endpoints_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_clusters_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_partitions_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata_summary.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/port_information.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/pre_co_user_credentials.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_external_vault_metadata.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_vault_metadata.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_details.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_request_response.go create mode 100644 vendor/github.com/youmark/pkcs8/.gitignore create mode 100644 vendor/github.com/youmark/pkcs8/LICENSE create mode 100644 vendor/github.com/youmark/pkcs8/README create mode 100644 vendor/github.com/youmark/pkcs8/README.md create mode 100644 vendor/github.com/youmark/pkcs8/cipher.go create mode 100644 vendor/github.com/youmark/pkcs8/cipher_3des.go create mode 100644 vendor/github.com/youmark/pkcs8/cipher_aes.go create mode 100644 vendor/github.com/youmark/pkcs8/kdf_pbkdf2.go create mode 100644 vendor/github.com/youmark/pkcs8/kdf_scrypt.go create mode 100644 vendor/github.com/youmark/pkcs8/pkcs8.go create mode 100644 vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go create mode 100644 vendor/golang.org/x/crypto/scrypt/scrypt.go delete mode 100644 vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go diff --git a/Dockerfile b/Dockerfile index c5a6289b4..2d1be0c95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ # # build stage -FROM golang:1.23-alpine AS build-env +FROM golang:1.24-alpine AS build-env RUN apk add --no-cache gcc musl-dev ARG D=/go/src/github.com/fnproject/cli ARG GO111MODULE=on diff --git a/README.md b/README.md index 6cc961756..401ff9f4e 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,29 @@ curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh ## CLI Development * Refer to the [Fn CLI Wiki](https://github.com/fnproject/cli/wiki) for development details. +## Watch (local auto-deploy) +To watch a directory and automatically redeploy to a local Fn server when files change: + +```sh +fn watch --app +``` + +This watches the current directory recursively and triggers: + +```sh +fn deploy --app --local --no-bump +``` + +### Ignoring paths +`fn watch` ignores these directories by default: + +- `.git`, `.fn`, `node_modules`, `target`, `dist`, `vendor`, `Dockerfile-fn-tmp*` + +You can add more ignore rules by creating a `.fnignore` file in the watched directory (one pattern per line; `#` comments supported), and/or by passing `--ignore` flags. + ### Build from source See [CONTRIBUTING](https://github.com/fnproject/cli/blob/master/CONTRIBUTING.md) for instructions to build the CLI from source. - diff --git a/RELEASES.md b/RELEASES.md index 24df3e89f..fecfed068 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,10 @@ # Releases +## Unreleased + +* Enabling support for node24 +* Enabling support for java21 + ## v 0.6.47 * Update default version for python to 3.12 diff --git a/client/invoke.go b/client/invoke.go index d9d450ab1..b132e704a 100644 --- a/client/invoke.go +++ b/client/invoke.go @@ -52,6 +52,7 @@ type InvokeRequest struct { Content io.Reader Env []string ContentType string + FnInvokeType string // TODO headers should be their real type? } @@ -82,6 +83,9 @@ func Invoke(provider provider.Provider, ireq InvokeRequest) (*http.Response, err } else { req.Header.Set("Content-Type", "text/plain") } + if ireq.FnInvokeType != "" { + req.Header.Set("fn-invoke-type", ireq.FnInvokeType) + } if len(env) > 0 { EnvAsHeader(req, env) diff --git a/client/invoke_test.go b/client/invoke_test.go new file mode 100644 index 000000000..dcc17f8bb --- /dev/null +++ b/client/invoke_test.go @@ -0,0 +1,48 @@ +package client + +import ( + "io" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/fnproject/fn_go/client/version" + "github.com/fnproject/fn_go/clientv2" + "github.com/fnproject/fn_go/provider" +) + +type invokeTestProvider struct{} + +func (p *invokeTestProvider) APIClientv2() *clientv2.Fn { return nil } +func (p *invokeTestProvider) APIURL() *url.URL { return nil } +func (p *invokeTestProvider) UnavailableResources() []provider.FnResourceType { + return nil +} +func (p *invokeTestProvider) VersionClient() *version.Client { return nil } +func (p *invokeTestProvider) WrapCallTransport(rt http.RoundTripper) http.RoundTripper { + return rt +} + +func TestInvokeSetsFnInvokeTypeHeader(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if got := r.Header.Get("fn-invoke-type"); got != "detached" { + t.Fatalf("expected fn-invoke-type detached, got %q", got) + } + w.WriteHeader(http.StatusAccepted) + _, _ = w.Write([]byte("ok")) + })) + defer server.Close() + + resp, err := Invoke(&invokeTestProvider{}, InvokeRequest{ + URL: server.URL, + FnInvokeType: "detached", + Content: strings.NewReader("{}"), + }) + if err != nil { + t.Fatalf("Invoke() error = %v", err) + } + defer resp.Body.Close() + _, _ = io.ReadAll(resp.Body) +} \ No newline at end of file diff --git a/commands/commands.go b/commands/commands.go index c35ca39e6..29bb26414 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -28,7 +28,7 @@ import ( "github.com/urfave/cli" ) -//Cmd is a mapping from a commands name to its corresponding structure +// Cmd is a mapping from a commands name to its corresponding structure type Cmd map[string]cli.Command // Commands map of all top-level commands @@ -36,6 +36,7 @@ var Commands = Cmd{ "build": BuildCommand(), "build-server": BuildServerCommand(), "bump": common.BumpCommand(), + "watch": WatchCommand(), "invoke": InvokeCommand(), "configure": ConfigureCommand(), "create": CreateCommand(), diff --git a/commands/deploy.go b/commands/deploy.go index fc5b21ef2..22bfd2d5f 100644 --- a/commands/deploy.go +++ b/commands/deploy.go @@ -39,6 +39,7 @@ import ( trigger "github.com/fnproject/cli/objects/trigger" v2Client "github.com/fnproject/fn_go/clientv2" models "github.com/fnproject/fn_go/modelsv2" + fnprovider "github.com/fnproject/fn_go/provider" "github.com/oracle/oci-go-sdk/v65/artifacts" ociCommon "github.com/oracle/oci-go-sdk/v65/common" "github.com/oracle/oci-go-sdk/v65/keymanagement" @@ -96,6 +97,7 @@ func DeployCommand() cli.Command { if err != nil { return err } + cmd.provider = provider cmd.clientV2 = provider.APIClientv2() return nil }, @@ -109,6 +111,7 @@ func DeployCommand() cli.Command { type deploycmd struct { clientV2 *v2Client.Fn + provider fnprovider.Provider appName string createApp bool @@ -349,6 +352,7 @@ func (p *deploycmd) deployFuncV20180708(c *cli.Context, app *models.App, funcfil if funcfile.Name == "" { funcfile.Name = filepath.Base(filepath.Dir(funcfilePath)) // todo: should probably make a copy of ff before changing it } + common.WarnIfOCIManagedFunctionSettingsUnsupported(os.Stderr, p.provider, funcfile.Name, funcfile) oracleProvider, _ := getOracleProvider() if oracleProvider != nil && oracleProvider.ImageCompartmentID != "" { @@ -419,11 +423,25 @@ func (p *deploycmd) deployFuncV20180708(c *cli.Context, app *models.App, funcfil func (p *deploycmd) updateFunction(c *cli.Context, appID string, ff *common.FuncFileV20180708) error { fmt.Printf("Updating function %s using image %s...\n", ff.Name, ff.ImageNameV20180708()) + var detachedSeconds int + if ff.Deploy != nil && ff.Deploy.OCI != nil && ff.Deploy.OCI.DetachedMode != nil && ff.Deploy.OCI.DetachedMode.Timeout != "" { + _, seconds, err := common.ParseDetachedTimeoutSpec(ff.Deploy.OCI.DetachedMode.Timeout) + if err != nil { + return err + } + detachedSeconds = seconds + } fn := &models.Fn{} if err := function.WithFuncFileV20180708(ff, fn); err != nil { return fmt.Errorf("Error getting function with funcfile: %s", err) } + if detachedSeconds > 0 && common.IsOracleProvider(p.provider) { + function.SetDetachedTimeoutAnnotation(fn, detachedSeconds) + } + if common.IsOracleProvider(p.provider) && ff.Deploy != nil && ff.Deploy.OCI != nil && ff.Deploy.OCI.DetachedMode != nil { + function.SetDestinationAnnotations(fn, ff.Deploy.OCI.DetachedMode.OnSuccess, ff.Deploy.OCI.DetachedMode.OnFailure) + } fnRes, err := function.GetFnByName(p.clientV2, appID, ff.Name) if _, ok := err.(function.NameNotFoundError); ok { diff --git a/commands/init.go b/commands/init.go index 1df9bba34..a6fa102ce 100644 --- a/commands/init.go +++ b/commands/init.go @@ -119,6 +119,18 @@ func initFlags(a *initFnCmd) []cli.Flag { Name: "annotation", Usage: "Function annotation (can be specified multiple times)", }, + cli.StringFlag{ + Name: "detached-timeout", + Usage: "Set OCI detached mode timeout using a duration like 20m or 1h", + }, + cli.StringFlag{ + Name: "on-success", + Usage: "Set OCI detached success destination using :", + }, + cli.StringFlag{ + Name: "on-failure", + Usage: "Set OCI detached failure destination using :", + }, } return fgs @@ -176,6 +188,21 @@ func (a *initFnCmd) init(c *cli.Context) error { function.WithFlags(c, &fn) a.bindFn(&fn) + if timeoutSpec, _, err := common.ParseDetachedTimeoutSpec(c.String("detached-timeout")); err != nil { + return err + } else { + common.SetDetachedTimeout(a.ff, timeoutSpec) + } + if dest, err := common.ParseOCIDestinationSpec("--on-success", c.String("on-success")); err != nil { + return err + } else { + common.SetOnSuccessDestination(a.ff, dest) + } + if dest, err := common.ParseOCIDestinationSpec("--on-failure", c.String("on-failure")); err != nil { + return err + } else { + common.SetOnFailureDestination(a.ff, dest) + } runtime := c.String("runtime") initImage := c.String("init-image") diff --git a/commands/invoke.go b/commands/invoke.go index 8e88590b4..4fb3ad067 100644 --- a/commands/invoke.go +++ b/commands/invoke.go @@ -65,6 +65,10 @@ var InvokeFnFlags = []cli.Flag{ Name: "output", Usage: "Output format (json)", }, + cli.StringFlag{ + Name: "fn-invoke-type", + Usage: "Invoke type for Oracle Functions: sync or detached", + }, } // InvokeCommand returns call cli.command @@ -129,6 +133,14 @@ func (cl *invokeCmd) Invoke(c *cli.Context) error { } content := stdin() wd := common.GetWd() + invokeType := strings.ToLower(strings.TrimSpace(c.String("fn-invoke-type"))) + if invokeType != "" && invokeType != "sync" && invokeType != "detached" { + return fmt.Errorf("invalid value for --fn-invoke-type: %q", invokeType) + } + if invokeType == "detached" && !common.IsOracleProvider(cl.provider) { + fmt.Fprintln(os.Stderr, "Warning: --fn-invoke-type=detached is only supported with an oracle provider and will be ignored.") + invokeType = "" + } if c.String("content-type") != "" { contentType = c.String("content-type") @@ -145,6 +157,7 @@ func (cl *invokeCmd) Invoke(c *cli.Context) error { Content: content, Env: c.StringSlice("e"), ContentType: contentType, + FnInvokeType: invokeType, }, ) if err != nil { diff --git a/commands/watch.go b/commands/watch.go new file mode 100644 index 000000000..8447419e1 --- /dev/null +++ b/commands/watch.go @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package commands + +import ( + "bufio" + "context" + "errors" + "fmt" + "os" + "os/exec" + "os/signal" + "path/filepath" + "strings" + "sync" + "syscall" + "time" + + "github.com/fsnotify/fsnotify" + "github.com/urfave/cli" +) + +const ( + defaultWatchDebounce = 500 * time.Millisecond + fnIgnoreFileName = ".fnignore" +) + +// WatchCommand returns watch cli.Command. +// +// Usage: fn watch --app +// Watches the current directory recursively for changes and redeploys the app locally. +func WatchCommand() cli.Command { + cmd := watchcmd{} + return cli.Command{ + Name: "watch", + Aliases: []string{"w"}, + Usage: "\tWatches the current directory and redeploys to a local Fn server on changes.", + Category: "DEVELOPMENT COMMANDS", + Description: "Watches all files under the current directory recursively. " + + "When a file changes, it runs: fn deploy --app --local --no-bump. " + + "Paths can be ignored via default ignores and optionally a .fnignore file.", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "app", + Usage: "Local app name to deploy to", + }, + cli.DurationFlag{ + Name: "debounce", + Usage: "Debounce duration before triggering deploy (e.g. 500ms, 2s)", + Value: defaultWatchDebounce, + Destination: &cmd.debounce, + }, + cli.StringSliceFlag{ + Name: "ignore", + Usage: "Additional ignore patterns (repeatable). Matches path segments. Example: --ignore .idea --ignore '*.log'", + }, + }, + Action: cmd.watch, + } +} + +type watchcmd struct { + debounce time.Duration +} + +var runFnDeployLocalFn = runFnDeployLocal + +func (w *watchcmd) watch(c *cli.Context) error { + appName := c.String("app") + if appName == "" { + return errors.New("app name must be provided. Usage: fn watch --app ") + } + + root, err := os.Getwd() + if err != nil { + return err + } + root, err = filepath.Abs(root) + if err != nil { + return err + } + + watchIgnore, err := loadWatchIgnore(root, c.StringSlice("ignore")) + if err != nil { + return err + } + + fmt.Fprintf(os.Stdout, "Watching %s (app=%s). Debounce=%s\n", root, appName, w.debounce) + fmt.Fprintf(os.Stdout, "Ignored: %s\n", strings.Join(watchIgnore.describe(), ", ")) + if watchIgnore.hasFnIgnore { + fmt.Fprintf(os.Stdout, "Using %s for ignores\n", fnIgnoreFileName) + } + fmt.Fprintf(os.Stdout, "Press Ctrl+C to stop.\n") + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + // urfave/cli v1 has no context propagation, so handle ctrl-c signal ourselves. + go func() { + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) + <-sigCh + cancel() + }() + + return w.watchLoop(ctx, root, appName, watchIgnore) +} + +func (w *watchcmd) watchLoop(ctx context.Context, root string, appName string, watchIgnore watchIgnore) error { + watcher, err := fsnotify.NewWatcher() + if err != nil { + return err + } + defer watcher.Close() + + // initial recursive add + if err := addRecursiveWatches(watcher, root, watchIgnore); err != nil { + return err + } + + // debounce + deploy state + var ( + mu sync.Mutex + pendingDeploy bool + deployRunning bool + lastChangeName string + debounceTimer *time.Timer + ) + + var triggerDeploy func() + + triggerDeploy = func() { + mu.Lock() + if deployRunning || !pendingDeploy { + mu.Unlock() + return + } + deployRunning = true + pendingDeploy = false + change := lastChangeName + mu.Unlock() + + fmt.Fprintf(os.Stdout, "\nChange detected (%s). Deploying...\n", change) + err := runFnDeployLocalFn(ctx, root, appName) + if err != nil { + fmt.Fprintf(os.Stderr, "Deploy failed: %v\n", err) + } else { + fmt.Fprintf(os.Stdout, "Deploy finished.\n") + } + + mu.Lock() + deployRunning = false + if pendingDeploy { + // Changes happened while a deploy was running. Coalesce those changes + // into a single follow-up deploy. + if debounceTimer != nil { + debounceTimer.Stop() + } + debounceTimer = time.AfterFunc(w.debounce, triggerDeploy) + } + mu.Unlock() + } + + scheduleDeploy := func(changedPath string) { + mu.Lock() + defer mu.Unlock() + + pendingDeploy = true + lastChangeName = changedPath + if deployRunning { + // Coalesce any number of changes while deploy is running into + // one follow-up deploy. + return + } + if debounceTimer != nil { + debounceTimer.Stop() + } + debounceTimer = time.AfterFunc(w.debounce, triggerDeploy) + } + + for { + select { + case <-ctx.Done(): + return nil + case event, ok := <-watcher.Events: + if !ok { + return nil + } + + // Handle new directories so recursion continues. + // On some platforms, Create is fired for new files and dirs. + if event.Op&fsnotify.Create == fsnotify.Create { + if fi, err := os.Stat(event.Name); err == nil && fi.IsDir() { + if watchIgnore.shouldIgnore(root, event.Name, true) { + break + } + // ignore the watch on new directory if there is error, instead of stopping + // the fn watch. + _ = addRecursiveWatches(watcher, event.Name, watchIgnore) + } + } + + if watchIgnore.shouldIgnore(root, event.Name, false) { + break + } + + // Treat any write/create/remove/rename as a change signal. + if event.Op&(fsnotify.Write|fsnotify.Create|fsnotify.Remove|fsnotify.Rename) != 0 { + scheduleDeploy(event.Name) + } + + case err, ok := <-watcher.Errors: + if !ok { + return nil + } + fmt.Fprintf(os.Stderr, "watch error: %v\n", err) + } + } +} + +func runFnDeployLocal(ctx context.Context, dir string, appName string) error { + executable, err := os.Executable() + if err != nil { + return err + } + + cmd := exec.CommandContext(ctx, executable, "deploy", "--app", appName, "--local", "--no-bump") + cmd.Dir = dir + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() +} + +type watchIgnore struct { + root string + patterns []string + hasFnIgnore bool +} + +func (w watchIgnore) describe() []string { + return w.patterns +} + +func loadWatchIgnore(root string, extra []string) (watchIgnore, error) { + // defaults requested by user + patterns := []string{".git", ".fn", "node_modules", "target", "dist", "vendor", "Dockerfile-fn-tmp*"} + + fnIgnorePath := filepath.Join(root, fnIgnoreFileName) + if f, err := os.Open(fnIgnorePath); err == nil { + defer f.Close() + s := bufio.NewScanner(f) + for s.Scan() { + line := strings.TrimSpace(s.Text()) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + patterns = append(patterns, line) + } + if err := s.Err(); err != nil { + return watchIgnore{}, err + } + return watchIgnore{root: root, patterns: append(patterns, extra...), hasFnIgnore: true}, nil + } else if !os.IsNotExist(err) { + return watchIgnore{}, err + } + + return watchIgnore{root: root, patterns: append(patterns, extra...), hasFnIgnore: false}, nil +} + +func (w watchIgnore) shouldIgnore(root string, path string, isDir bool) bool { + // ignore if it matches any pattern against: + // - any path segment + // - or the relative path + rel, err := filepath.Rel(root, path) + if err != nil { + rel = path + } + rel = filepath.ToSlash(rel) + segs := strings.Split(rel, "/") + + for _, p := range w.patterns { + p = strings.TrimSpace(p) + if p == "" { + continue + } + + // segment match (simple, fast) + for _, s := range segs { + if s == p { + return true + } + if !strings.Contains(p, "/") { + if ok, _ := filepath.Match(p, s); ok { + return true + } + } + } + + // glob against rel path + if ok, _ := filepath.Match(p, rel); ok { + return true + } + // Also try matching with OS separator style + if ok, _ := filepath.Match(p, filepath.FromSlash(rel)); ok { + return true + } + } + + _ = isDir + return false +} + +func addRecursiveWatches(watcher *fsnotify.Watcher, root string, ignore watchIgnore) error { + return filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error { + if err != nil { + fmt.Fprintf(os.Stdout, "Failed to navigate the directory. %s, error: %v\n", path, err) + return err + } + if d.IsDir() { + if ignore.shouldIgnore(ignore.root, path, true) { + return filepath.SkipDir + } + if err := watcher.Add(path); err != nil { + fmt.Fprintf(os.Stdout, "Failed to watch the directory. %s, error: %v\n", path, err) + return err + } + } + return nil + }) +} diff --git a/commands/watch_test.go b/commands/watch_test.go new file mode 100644 index 000000000..a966fe807 --- /dev/null +++ b/commands/watch_test.go @@ -0,0 +1,242 @@ +package commands + +import ( + "context" + "flag" + "os" + "path/filepath" + "strings" + "sync/atomic" + "testing" + "time" + + "github.com/urfave/cli" +) + +func TestWatchLoopSingleChangeTriggersSingleDeploy(t *testing.T) { + root := t.TempDir() + targetFile := filepath.Join(root, "func.py") + if err := os.WriteFile(targetFile, []byte("v1"), 0644); err != nil { + t.Fatal(err) + } + + restoreDeployFn := runFnDeployLocalFn + defer func() { runFnDeployLocalFn = restoreDeployFn }() + + var calls int32 + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + runFnDeployLocalFn = func(_ context.Context, dir string, appName string) error { + if dir != root { + t.Fatalf("expected deploy dir %s, got %s", root, dir) + } + if appName != "myapp" { + t.Fatalf("expected app myapp, got %s", appName) + } + atomic.AddInt32(&calls, 1) + cancel() + return nil + } + + w := watchcmd{debounce: 20 * time.Millisecond} + ignore, err := loadWatchIgnore(root, nil) + if err != nil { + t.Fatal(err) + } + + done := make(chan error, 1) + go func() { + done <- w.watchLoop(ctx, root, "myapp", ignore) + }() + + time.Sleep(100 * time.Millisecond) + if err := os.WriteFile(targetFile, []byte("v2"), 0644); err != nil { + t.Fatal(err) + } + + select { + case err := <-done: + if err != nil { + t.Fatalf("watch loop failed: %v", err) + } + case <-time.After(3 * time.Second): + t.Fatal("timed out waiting for watch loop") + } + + if got := atomic.LoadInt32(&calls); got != 1 { + t.Fatalf("expected 1 deploy, got %d", got) + } +} + +func TestWatchLoopCoalescesChangesDuringDeployIntoOneFollowUp(t *testing.T) { + root := t.TempDir() + targetFile := filepath.Join(root, "func.py") + if err := os.WriteFile(targetFile, []byte("v1"), 0644); err != nil { + t.Fatal(err) + } + + restoreDeployFn := runFnDeployLocalFn + defer func() { runFnDeployLocalFn = restoreDeployFn }() + + var calls int32 + firstStarted := make(chan struct{}) + releaseFirst := make(chan struct{}) + secondDone := make(chan struct{}) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + runFnDeployLocalFn = func(_ context.Context, dir string, appName string) error { + if dir != root { + t.Fatalf("expected deploy dir %s, got %s", root, dir) + } + if appName != "myapp" { + t.Fatalf("expected app myapp, got %s", appName) + } + + n := atomic.AddInt32(&calls, 1) + if n == 1 { + close(firstStarted) + <-releaseFirst + return nil + } + if n == 2 { + close(secondDone) + cancel() + return nil + } + return nil + } + + w := watchcmd{debounce: 20 * time.Millisecond} + ignore, err := loadWatchIgnore(root, nil) + if err != nil { + t.Fatal(err) + } + + done := make(chan error, 1) + go func() { + done <- w.watchLoop(ctx, root, "myapp", ignore) + }() + + time.Sleep(100 * time.Millisecond) + if err := os.WriteFile(targetFile, []byte("v2"), 0644); err != nil { + t.Fatal(err) + } + + select { + case <-firstStarted: + case <-time.After(3 * time.Second): + t.Fatal("first deploy did not start") + } + + // Multiple changes while first deploy is in-flight should be coalesced into one follow-up deploy. + if err := os.WriteFile(targetFile, []byte("v3"), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(targetFile, []byte("v4"), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(targetFile, []byte("v5"), 0644); err != nil { + t.Fatal(err) + } + + close(releaseFirst) + + select { + case <-secondDone: + case <-time.After(3 * time.Second): + t.Fatal("follow-up deploy did not run") + } + + select { + case err := <-done: + if err != nil { + t.Fatalf("watch loop failed: %v", err) + } + case <-time.After(3 * time.Second): + t.Fatal("timed out waiting for watch loop") + } + + if got := atomic.LoadInt32(&calls); got != 2 { + t.Fatalf("expected exactly 2 deploys (initial + follow-up), got %d", got) + } +} + +func TestLoadWatchIgnoreReadsFnIgnoreAndExtras(t *testing.T) { + root := t.TempDir() + fnIgnore := filepath.Join(root, fnIgnoreFileName) + content := strings.Join([]string{ + "# comment", + "", + "tmp", + "*.log", + }, "\n") + if err := os.WriteFile(fnIgnore, []byte(content), 0644); err != nil { + t.Fatal(err) + } + + ig, err := loadWatchIgnore(root, []string{"cache"}) + if err != nil { + t.Fatal(err) + } + + if !ig.hasFnIgnore { + t.Fatal("expected hasFnIgnore to be true") + } + if !contains(ig.patterns, "tmp") || !contains(ig.patterns, "*.log") || !contains(ig.patterns, "cache") { + t.Fatalf("expected patterns to include fnignore and extra values, got: %v", ig.patterns) + } + if !ig.shouldIgnore(root, filepath.Join(root, "a", "tmp", "x.txt"), false) { + t.Fatal("expected segment-based ignore to match") + } + if !ig.shouldIgnore(root, filepath.Join(root, "a.log"), false) { + t.Fatal("expected glob-based ignore to match") + } + if !ig.shouldIgnore(root, filepath.Join(root, "nested", "agit .log"), false) { + t.Fatal("expected glob-based segment ignore to match nested file") + } +} + +func TestWatchRequiresAppFlag(t *testing.T) { + w := watchcmd{debounce: 10 * time.Millisecond} + ctx := newWatchCLIContext(t, "", "10ms") + + err := w.watch(ctx) + if err == nil { + t.Fatal("expected error when --app is missing") + } + if !strings.Contains(err.Error(), "app name must be provided") { + t.Fatalf("unexpected error: %v", err) + } +} + +func newWatchCLIContext(t *testing.T, app string, debounce string) *cli.Context { + t.Helper() + cmd := WatchCommand() + fs := flag.NewFlagSet("watch-test", flag.ContinueOnError) + for _, f := range cmd.Flags { + f.Apply(fs) + } + if app != "" { + if err := fs.Set("app", app); err != nil { + t.Fatalf("failed setting app flag: %v", err) + } + } + if debounce != "" { + if err := fs.Set("debounce", debounce); err != nil { + t.Fatalf("failed setting debounce flag: %v", err) + } + } + return cli.NewContext(cli.NewApp(), fs, nil) +} + +func contains(items []string, target string) bool { + for _, item := range items { + if item == target { + return true + } + } + return false +} diff --git a/common/common.go b/common/common.go index a8a767993..d9e86b6ea 100644 --- a/common/common.go +++ b/common/common.go @@ -182,11 +182,10 @@ func imageStampFuncFile(fpath string, funcfile *FuncFile) (*FuncFile, error) { return funcfile, fmt.Errorf("runtime [%s] is not supported", funcfile.Runtime) } - // get the lang without any version + // only apply fallback for versionless legacy runtimes such as "node" or "java" langRuntime := helper.Runtime() - // if fallback is not supported then continue with same lang helper - if langs.IsFallbackSupported(langRuntime) { + if funcfile.Runtime == langRuntime && langs.IsFallbackSupported(langRuntime) { helper = langs.GetFallbackLangHelper(langRuntime) } @@ -232,11 +231,10 @@ func imageStampFuncFileV20180708(fpath string, funcfile *FuncFileV20180708) (*Fu return funcfile, fmt.Errorf("runtime [%s] is not supported", funcfile.Runtime) } - // get the lang without any version + // only apply fallback for versionless legacy runtimes such as "node" or "java" langRuntime := helper.Runtime() - // if fallback is not supported then continue with same lang helper - if langs.IsFallbackSupported(langRuntime) { + if funcfile.Runtime == langRuntime && langs.IsFallbackSupported(langRuntime) { helper = langs.GetFallbackLangHelper(langRuntime) } @@ -295,7 +293,7 @@ func PrintContextualInfo() { func PrintDockerfileContent(dockerfile string, stdout io.Writer) { file, err := os.Open(dockerfile) if err != nil { - fmt.Fprintf(stdout, err.Error()) + fmt.Fprint(stdout, err.Error()) fmt.Fprintf(stdout, "\n") return } @@ -738,7 +736,7 @@ func writeTmpDockerfile(helper langs.LangHelper, dir string, ff *FuncFile) (stri return "", errors.New("entrypoint and cmd are missing, you must provide one or the other") } - fd, err := ioutil.TempFile(dir, "Dockerfile") + fd, err := ioutil.TempFile(dir, "Dockerfile-fn-tmp") if err != nil { return "", err } @@ -803,7 +801,7 @@ func writeTmpDockerfileV20180708(helper langs.LangHelper, dir string, ff *FuncFi return "", errors.New("entrypoint and cmd are missing, you must provide one or the other") } - fd, err := ioutil.TempFile(dir, "Dockerfile") + fd, err := ioutil.TempFile(dir, "Dockerfile-fn-tmp") if err != nil { return "", err } diff --git a/common/common_test.go b/common/common_test.go index 16cc3e8df..2d8b01b43 100644 --- a/common/common_test.go +++ b/common/common_test.go @@ -144,11 +144,11 @@ func Test_writeTmpDockerfileV20180708(t *testing.T) { }, {"java-debug-image", args{&langs.JavaLangHelper{Version: "17"}, dir, &javaFuncFile, true, javaFdkEntryPoint}, - javaDebugDockerfile, + fmt.Sprintf(javaDebugDockerfile, langs.MavenOptsForTest()), }, {"java-normal-image", args{&langs.JavaLangHelper{Version: "17"}, dir, &javaFuncFile, false, javaFdkEntryPoint}, - javaDockerfile, + fmt.Sprintf(javaDockerfile, langs.MavenOptsForTest()), }, } for _, tt := range tests { @@ -318,9 +318,9 @@ WORKDIR /function COPY --from=build-stage /go/src/func/func /function/ ENTRYPOINT ["./func"] ` - javaDebugDockerfile = `FROM fnproject/fn-java-fdk-build:jdk17-1.1.7 as build-stage + javaDebugDockerfile = `FROM fnproject/fn-java-fdk-build:jdk17-1.1.7 as build-stage WORKDIR /function -ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository +ENV MAVEN_OPTS %s ADD pom.xml /function/pom.xml RUN ["mvn", "package", "dependency:copy-dependencies", "-DincludeScope=runtime", "-DskipTests=true", "-Dmdep.prependGroupId=true", "-DoutputDirectory=target", "--fail-never"] ADD src /function/src @@ -333,7 +333,7 @@ CMD ["com.example.fn.HelloFunction::handleRequest"] ` javaDockerfile = `FROM fnproject/fn-java-fdk-build:jdk17-1.1.7 as build-stage WORKDIR /function -ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository +ENV MAVEN_OPTS %s ADD pom.xml /function/pom.xml RUN ["mvn", "package", "dependency:copy-dependencies", "-DincludeScope=runtime", "-DskipTests=true", "-Dmdep.prependGroupId=true", "-DoutputDirectory=target", "--fail-never"] ADD src /function/src diff --git a/common/destinations.go b/common/destinations.go new file mode 100644 index 000000000..011f905a7 --- /dev/null +++ b/common/destinations.go @@ -0,0 +1,66 @@ +package common + +import ( + "fmt" + "strings" +) + +const ( + DestinationTypeStream = "stream" + DestinationTypeQueue = "queue" + DestinationTypeNotifications = "notifications" +) + +// ParseOCIDestinationSpec parses a shorthand destination spec like stream:. +func ParseOCIDestinationSpec(flagName, spec string) (*OCIDestination, error) { + spec = strings.TrimSpace(spec) + if spec == "" { + return nil, nil + } + parts := strings.SplitN(spec, ":", 2) + if len(parts) != 2 { + return nil, fmt.Errorf("invalid value for %s: %q (expected :)", flagName, spec) + } + typePart := strings.ToLower(strings.TrimSpace(parts[0])) + ocid := strings.TrimSpace(parts[1]) + if ocid == "" { + return nil, fmt.Errorf("invalid value for %s: %q (destination OCID is required)", flagName, spec) + } + switch typePart { + case DestinationTypeStream, DestinationTypeQueue: + return &OCIDestination{Type: typePart, OCID: ocid}, nil + case "notification", DestinationTypeNotifications: + return &OCIDestination{Type: DestinationTypeNotifications, OCID: ocid}, nil + default: + return nil, fmt.Errorf("invalid value for %s: %q (unsupported destination type %q)", flagName, spec, typePart) + } +} + +func ensureDetachedModeConfig(ff *FuncFileV20180708) *OCIDetachedModeConfig { + if ff.Deploy == nil { + ff.Deploy = &FuncDeployConfig{} + } + if ff.Deploy.OCI == nil { + ff.Deploy.OCI = &OCIFunctionDeployConfig{} + } + if ff.Deploy.OCI.DetachedMode == nil { + ff.Deploy.OCI.DetachedMode = &OCIDetachedModeConfig{} + } + return ff.Deploy.OCI.DetachedMode +} + +// SetOnSuccessDestination stores an OCI on-success destination in func.yaml config. +func SetOnSuccessDestination(ff *FuncFileV20180708, dest *OCIDestination) { + if ff == nil || dest == nil { + return + } + ensureDetachedModeConfig(ff).OnSuccess = dest +} + +// SetOnFailureDestination stores an OCI on-failure destination in func.yaml config. +func SetOnFailureDestination(ff *FuncFileV20180708, dest *OCIDestination) { + if ff == nil || dest == nil { + return + } + ensureDetachedModeConfig(ff).OnFailure = dest +} \ No newline at end of file diff --git a/common/destinations_test.go b/common/destinations_test.go new file mode 100644 index 000000000..2abceab58 --- /dev/null +++ b/common/destinations_test.go @@ -0,0 +1,47 @@ +package common + +import "testing" + +func TestParseOCIDestinationSpec(t *testing.T) { + tests := []struct { + name string + spec string + wantNil bool + wantErr bool + wantType string + wantOCID string + }{ + {name: "empty", spec: "", wantNil: true}, + {name: "stream", spec: "stream:ocid1.stream.oc1..abc", wantType: DestinationTypeStream, wantOCID: "ocid1.stream.oc1..abc"}, + {name: "queue", spec: "queue:ocid1.queue.oc1..abc", wantType: DestinationTypeQueue, wantOCID: "ocid1.queue.oc1..abc"}, + {name: "notifications alias", spec: "notification:ocid1.onstopic.oc1..abc", wantType: DestinationTypeNotifications, wantOCID: "ocid1.onstopic.oc1..abc"}, + {name: "notifications plural", spec: "notifications:ocid1.onstopic.oc1..abc", wantType: DestinationTypeNotifications, wantOCID: "ocid1.onstopic.oc1..abc"}, + {name: "invalid missing ocid", spec: "stream:", wantErr: true}, + {name: "invalid missing colon", spec: "stream", wantErr: true}, + {name: "invalid type", spec: "topic:abc", wantErr: true}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dest, err := ParseOCIDestinationSpec("--on-success", tt.spec) + if (err != nil) != tt.wantErr { + t.Fatalf("ParseOCIDestinationSpec() error = %v, wantErr %v", err, tt.wantErr) + } + if tt.wantNil { + if dest != nil { + t.Fatalf("expected nil destination, got %#v", dest) + } + return + } + if tt.wantErr { + return + } + if dest == nil { + t.Fatal("expected non-nil destination") + } + if dest.Type != tt.wantType || dest.OCID != tt.wantOCID { + t.Fatalf("expected (%q, %q), got (%q, %q)", tt.wantType, tt.wantOCID, dest.Type, dest.OCID) + } + }) + } +} \ No newline at end of file diff --git a/common/detached_timeout.go b/common/detached_timeout.go new file mode 100644 index 000000000..24fcf0bb8 --- /dev/null +++ b/common/detached_timeout.go @@ -0,0 +1,44 @@ +package common + +import ( + "fmt" + "strings" + "time" +) + +// ParseDetachedTimeoutSpec validates a human-friendly detached timeout such as 20m or 1h +// and returns the original trimmed value plus the timeout in seconds. +func ParseDetachedTimeoutSpec(spec string) (string, int, error) { + spec = strings.TrimSpace(spec) + if spec == "" { + return "", 0, nil + } + d, err := time.ParseDuration(spec) + if err != nil { + return "", 0, fmt.Errorf("invalid value for --detached-timeout: %q", spec) + } + if d <= 0 { + return "", 0, fmt.Errorf("invalid value for --detached-timeout: %q", spec) + } + if d%time.Second != 0 { + return "", 0, fmt.Errorf("invalid value for --detached-timeout: %q (must resolve to whole seconds)", spec) + } + return spec, int(d / time.Second), nil +} + +// SetDetachedTimeout stores detached timeout config in the function deploy section. +func SetDetachedTimeout(ff *FuncFileV20180708, timeout string) { + if ff == nil || strings.TrimSpace(timeout) == "" { + return + } + if ff.Deploy == nil { + ff.Deploy = &FuncDeployConfig{} + } + if ff.Deploy.OCI == nil { + ff.Deploy.OCI = &OCIFunctionDeployConfig{} + } + if ff.Deploy.OCI.DetachedMode == nil { + ff.Deploy.OCI.DetachedMode = &OCIDetachedModeConfig{} + } + ff.Deploy.OCI.DetachedMode.Timeout = strings.TrimSpace(timeout) +} \ No newline at end of file diff --git a/common/detached_timeout_test.go b/common/detached_timeout_test.go new file mode 100644 index 000000000..92cafe49f --- /dev/null +++ b/common/detached_timeout_test.go @@ -0,0 +1,36 @@ +package common + +import "testing" + +func TestParseDetachedTimeoutSpec(t *testing.T) { + tests := []struct { + name string + spec string + wantSpec string + wantSeconds int + wantErr bool + }{ + {name: "empty", spec: "", wantSpec: "", wantSeconds: 0}, + {name: "minutes", spec: "20m", wantSpec: "20m", wantSeconds: 1200}, + {name: "hours", spec: "1h", wantSpec: "1h", wantSeconds: 3600}, + {name: "trimmed", spec: " 30m ", wantSpec: "30m", wantSeconds: 1800}, + {name: "invalid", spec: "banana", wantErr: true}, + {name: "non-positive", spec: "0s", wantErr: true}, + {name: "sub-second", spec: "1500ms", wantErr: true}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotSpec, gotSeconds, err := ParseDetachedTimeoutSpec(tt.spec) + if (err != nil) != tt.wantErr { + t.Fatalf("ParseDetachedTimeoutSpec() error = %v, wantErr %v", err, tt.wantErr) + } + if tt.wantErr { + return + } + if gotSpec != tt.wantSpec || gotSeconds != tt.wantSeconds { + t.Fatalf("expected (%q, %d), got (%q, %d)", tt.wantSpec, tt.wantSeconds, gotSpec, gotSeconds) + } + }) + } +} \ No newline at end of file diff --git a/common/funcfile.go b/common/funcfile.go index e6f299947..6644ca32d 100644 --- a/common/funcfile.go +++ b/common/funcfile.go @@ -68,6 +68,36 @@ type Expects struct { Config []inputVar `yaml:"config" json:"config"` } +// OCIDestination represents an OCI destination reference stored in func.yaml. +type OCIDestination struct { + Type string `yaml:"type,omitempty" json:"type,omitempty"` + OCID string `yaml:"ocid,omitempty" json:"ocid,omitempty"` +} + +// OCIDetachedModeConfig stores detached mode settings for OCI Functions. +type OCIDetachedModeConfig struct { + Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"` + OnSuccess *OCIDestination `yaml:"on_success,omitempty" json:"on_success,omitempty"` + OnFailure *OCIDestination `yaml:"on_failure,omitempty" json:"on_failure,omitempty"` +} + +// OCIProvisionedConcurrencyConfig stores provisioned concurrency settings for OCI Functions. +type OCIProvisionedConcurrencyConfig struct { + Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"` + Count *int `yaml:"count,omitempty" json:"count,omitempty"` +} + +// OCIFunctionDeployConfig stores OCI-specific deploy configuration for a function. +type OCIFunctionDeployConfig struct { + ProvisionedConcurrency *OCIProvisionedConcurrencyConfig `yaml:"provisioned_concurrency,omitempty" json:"provisioned_concurrency,omitempty"` + DetachedMode *OCIDetachedModeConfig `yaml:"detached_mode,omitempty" json:"detached_mode,omitempty"` +} + +// FuncDeployConfig stores deploy-time configuration sections in func.yaml. +type FuncDeployConfig struct { + OCI *OCIFunctionDeployConfig `yaml:"oci,omitempty" json:"oci,omitempty"` +} + // FuncFile defines the internal structure of a func.yaml/json/yml type FuncFile struct { // just for posterity, this won't be set on old files, but we can check that @@ -96,6 +126,7 @@ type FuncFile struct { Config map[string]string `yaml:"config,omitempty" json:"config,omitempty"` IDLETimeout *int32 `yaml:"idle_timeout,omitempty" json:"idle_timeout,omitempty"` Annotations map[string]interface{} `yaml:"annotations,omitempty" json:"annotations,omitempty"` + Deploy *FuncDeployConfig `yaml:"deploy,omitempty" json:"deploy,omitempty"` // Run/test Expects Expects `yaml:"expects,omitempty" json:"expects,omitempty"` @@ -128,6 +159,7 @@ type FuncFileV20180708 struct { Config map[string]string `yaml:"config,omitempty" json:"config,omitempty"` Annotations map[string]interface{} `yaml:"annotations,omitempty" json:"annotations,omitempty"` + Deploy *FuncDeployConfig `yaml:"deploy,omitempty" json:"deploy,omitempty"` SigningDetails SigningDetails `yaml:"signing_details,omitempty" json:"signing_details,omitempty""` @@ -388,6 +420,43 @@ func (ff *FuncFileV20180708) ImageNameV20180708() string { return fname } +// HasOCIManagedFunctionSettings reports whether the func.yaml contains OCI-specific +// managed function settings that require OCI provider support. +func (ff *FuncFileV20180708) HasOCIManagedFunctionSettings() bool { + if ff == nil || ff.Deploy == nil || ff.Deploy.OCI == nil { + return false + } + + oci := ff.Deploy.OCI + if oci.ProvisionedConcurrency != nil && (oci.ProvisionedConcurrency.Strategy != "" || oci.ProvisionedConcurrency.Count != nil) { + return true + } + if oci.DetachedMode != nil && (oci.DetachedMode.Timeout != "" || oci.DetachedMode.OnSuccess != nil || oci.DetachedMode.OnFailure != nil) { + return true + } + + return false +} + +// OCIManagedFunctionSettingNames returns the OCI-managed function setting groups +// present in func.yaml in a stable order for warnings and diagnostics. +func (ff *FuncFileV20180708) OCIManagedFunctionSettingNames() []string { + if ff == nil || ff.Deploy == nil || ff.Deploy.OCI == nil { + return nil + } + + var settings []string + oci := ff.Deploy.OCI + if oci.ProvisionedConcurrency != nil && (oci.ProvisionedConcurrency.Strategy != "" || oci.ProvisionedConcurrency.Count != nil) { + settings = append(settings, "provisioned_concurrency") + } + if oci.DetachedMode != nil && (oci.DetachedMode.Timeout != "" || oci.DetachedMode.OnSuccess != nil || oci.DetachedMode.OnFailure != nil) { + settings = append(settings, "detached_mode") + } + + return settings +} + // Merge the func.init.yaml from the initImage with a.ff // // write out the new func file @@ -409,5 +478,8 @@ func MergeFuncFileInitYAML(path string, ff *FuncFileV20180708) error { ff.Expects = initFf.Expects ff.Run_image = initFf.RunImage ff.Runtime = initFf.Runtime + if initFf.Deploy != nil { + ff.Deploy = initFf.Deploy + } return nil } diff --git a/common/funcfile_test.go b/common/funcfile_test.go index 26f9a5895..29e9758d7 100644 --- a/common/funcfile_test.go +++ b/common/funcfile_test.go @@ -104,6 +104,63 @@ entrypoint: ./func } } +func TestMergeFuncFileInitYAMLCopiesDeploySection(t *testing.T) { + ff := FuncFileV20180708{Name: "hello"} + initYAML := ` +schema_version: 20180708 +runtime: go +deploy: + oci: + provisioned_concurrency: + strategy: CONSTANT + count: 3 + detached_mode: + timeout: 20m + on_success: + type: stream + ocid: ocid1.stream.oc1..example +` + folder, filePath := createInitYAML(initYAML) + defer os.RemoveAll(folder) + + if err := MergeFuncFileInitYAML(filePath, &ff); err != nil { + t.Fatalf("MergeFuncFileInitYAML() error = %v", err) + } + if ff.Deploy == nil || ff.Deploy.OCI == nil || ff.Deploy.OCI.ProvisionedConcurrency == nil { + t.Fatalf("expected deploy.oci.provisioned_concurrency to be copied from init yaml") + } + if ff.Deploy.OCI.ProvisionedConcurrency.Strategy != "CONSTANT" { + t.Fatalf("expected provisioned concurrency strategy CONSTANT, got %q", ff.Deploy.OCI.ProvisionedConcurrency.Strategy) + } + if ff.Deploy.OCI.ProvisionedConcurrency.Count == nil || *ff.Deploy.OCI.ProvisionedConcurrency.Count != 3 { + t.Fatalf("expected provisioned concurrency count 3, got %#v", ff.Deploy.OCI.ProvisionedConcurrency.Count) + } + if ff.Deploy.OCI.DetachedMode == nil || ff.Deploy.OCI.DetachedMode.Timeout != "20m" { + t.Fatalf("expected detached mode timeout to be copied, got %#v", ff.Deploy.OCI.DetachedMode) + } +} + +func TestFuncFileV20180708OCIManagedFunctionSettingsHelpers(t *testing.T) { + count := 5 + ff := &FuncFileV20180708{ + Deploy: &FuncDeployConfig{ + OCI: &OCIFunctionDeployConfig{ + ProvisionedConcurrency: &OCIProvisionedConcurrencyConfig{Strategy: "CONSTANT", Count: &count}, + DetachedMode: &OCIDetachedModeConfig{Timeout: "20m"}, + }, + }, + } + + if !ff.HasOCIManagedFunctionSettings() { + t.Fatal("expected HasOCIManagedFunctionSettings to return true") + } + want := []string{"provisioned_concurrency", "detached_mode"} + got := ff.OCIManagedFunctionSettingNames() + if !reflect.DeepEqual(got, want) { + t.Fatalf("expected OCIManagedFunctionSettingNames %v, got %v", want, got) + } +} + func createInitYAML(contents string) (string, string) { folder, err := ioutil.TempDir(os.TempDir(), "fn-tests") if err != nil { diff --git a/common/image_stamp_test.go b/common/image_stamp_test.go new file mode 100644 index 000000000..02a723b31 --- /dev/null +++ b/common/image_stamp_test.go @@ -0,0 +1,61 @@ +package common + +import ( + "path/filepath" + "testing" +) + +func TestImageStampFuncFileV20180708UsesExpectedRuntimeVersion(t *testing.T) { + t.Setenv("FN_JAVA_FDK_VERSION", "1.2.3") + + tests := []struct { + name string + runtime string + wantBuild string + wantRun string + }{ + { + name: "legacy node runtime uses fallback version", + runtime: "node", + wantBuild: "fnproject/node:22-dev", + wantRun: "fnproject/node:22", + }, + { + name: "explicit node24 runtime keeps requested version", + runtime: "node24", + wantBuild: "fnproject/node:24-dev", + wantRun: "fnproject/node:24", + }, + { + name: "legacy java runtime uses fallback version", + runtime: "java", + wantBuild: "fnproject/fn-java-fdk-build:jdk17-1.2.3", + wantRun: "fnproject/fn-java-fdk:jre17-1.2.3", + }, + { + name: "explicit java21 runtime keeps requested version", + runtime: "java21", + wantBuild: "fnproject/fn-java-fdk-build:jdk21-1.2.3", + wantRun: "fnproject/fn-java-fdk:jre21-1.2.3", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + path := filepath.Join(t.TempDir(), "func.yaml") + ff := &FuncFileV20180708{Runtime: tt.runtime} + + stamped, err := imageStampFuncFileV20180708(path, ff) + if err != nil { + t.Fatalf("imageStampFuncFileV20180708() returned error: %v", err) + } + + if stamped.Build_image != tt.wantBuild { + t.Fatalf("expected build image %q, got %q", tt.wantBuild, stamped.Build_image) + } + if stamped.Run_image != tt.wantRun { + t.Fatalf("expected run image %q, got %q", tt.wantRun, stamped.Run_image) + } + }) + } +} \ No newline at end of file diff --git a/common/oci_provider_support.go b/common/oci_provider_support.go new file mode 100644 index 000000000..2a9a5423b --- /dev/null +++ b/common/oci_provider_support.go @@ -0,0 +1,51 @@ +package common + +import ( + "fmt" + "io" + "reflect" + "strings" + + fnprovider "github.com/fnproject/fn_go/provider" +) + +// IsOracleProvider reports whether the current provider is the OCI Functions provider. +func IsOracleProvider(p fnprovider.Provider) bool { + if p == nil { + return false + } + typ := reflect.TypeOf(p) + if typ == nil { + return false + } + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + return typ.PkgPath() == "github.com/fnproject/fn_go/provider/oracle" && typ.Name() == "OracleProvider" +} + +// WarnIfOCIManagedFunctionSettingsUnsupported emits a warning when func.yaml +// contains OCI-specific managed function settings but the active provider does +// not support OCI-managed function features. +func WarnIfOCIManagedFunctionSettingsUnsupported(w io.Writer, p fnprovider.Provider, fnName string, ff *FuncFileV20180708) bool { + if w == nil || ff == nil || !ff.HasOCIManagedFunctionSettings() || IsOracleProvider(p) { + return false + } + + settings := ff.OCIManagedFunctionSettingNames() + if len(settings) == 0 { + return false + } + + if fnName == "" { + fnName = ff.Name + } + + _, _ = fmt.Fprintf( + w, + "Warning: function %s contains OCI-specific deploy settings (%s), but the current provider does not support OCI managed function features. These settings will be ignored.\n", + fnName, + strings.Join(settings, ", "), + ) + return true +} \ No newline at end of file diff --git a/common/oci_provider_support_test.go b/common/oci_provider_support_test.go new file mode 100644 index 000000000..91c7fca05 --- /dev/null +++ b/common/oci_provider_support_test.go @@ -0,0 +1,35 @@ +package common + +import ( + "bytes" + "strings" + "testing" +) + +func TestWarnIfOCIManagedFunctionSettingsUnsupported(t *testing.T) { + count := 2 + ff := &FuncFileV20180708{ + Name: "hello", + Deploy: &FuncDeployConfig{ + OCI: &OCIFunctionDeployConfig{ + ProvisionedConcurrency: &OCIProvisionedConcurrencyConfig{ + Strategy: "CONSTANT", + Count: &count, + }, + }, + }, + } + + var stderr bytes.Buffer + warned := WarnIfOCIManagedFunctionSettingsUnsupported(&stderr, nil, ff.Name, ff) + if !warned { + t.Fatal("expected warning helper to report that a warning was emitted") + } + output := stderr.String() + if !strings.Contains(output, "OCI-specific deploy settings") { + t.Fatalf("expected warning output to mention OCI-specific deploy settings, got %q", output) + } + if !strings.Contains(output, "provisioned_concurrency") { + t.Fatalf("expected warning output to include setting name, got %q", output) + } +} \ No newline at end of file diff --git a/common/schema.go b/common/schema.go index 02d6f1882..38ab1fe82 100644 --- a/common/schema.go +++ b/common/schema.go @@ -72,6 +72,57 @@ const V20180708Schema = `{ "config": { "type": "object" }, + "deploy": { + "type": "object", + "properties": { + "oci": { + "type": "object", + "properties": { + "provisioned_concurrency": { + "type": "object", + "properties": { + "strategy": { + "type": "string" + }, + "count": { + "type": "integer" + } + } + }, + "detached_mode": { + "type": "object", + "properties": { + "timeout": { + "type": "string" + }, + "on_success": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "ocid": { + "type": "string" + } + } + }, + "on_failure": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "ocid": { + "type": "string" + } + } + } + } + } + } + } + } + }, "triggers": { "type": "array", "properties": { diff --git a/common/schema_test.go b/common/schema_test.go new file mode 100644 index 000000000..2d2b7b125 --- /dev/null +++ b/common/schema_test.go @@ -0,0 +1,50 @@ +package common + +import ( + "os" + "path/filepath" + "testing" +) + +func TestValidateFileAgainstSchemaAcceptsOCIDeployConfig(t *testing.T) { + tmpDir := t.TempDir() + oldWd, err := os.Getwd() + if err != nil { + t.Fatalf("failed to get working directory: %v", err) + } + defer func() { _ = os.Chdir(oldWd) }() + if err := os.Chdir(tmpDir); err != nil { + t.Fatalf("failed to change working directory: %v", err) + } + + jsonFile := filepath.Join(tmpDir, "temp.json") + content := `{ + "schema_version": 20180708, + "name": "hello", + "version": "0.0.1", + "runtime": "go", + "entrypoint": "./func", + "deploy": { + "oci": { + "provisioned_concurrency": { + "strategy": "CONSTANT", + "count": 5 + }, + "detached_mode": { + "timeout": "20m", + "on_success": { + "type": "stream", + "ocid": "ocid1.stream.oc1..example" + } + } + } + } + }` + if err := os.WriteFile(jsonFile, []byte(content), 0644); err != nil { + t.Fatalf("failed to write temp schema file: %v", err) + } + + if err := ValidateFileAgainstSchema("temp.json", V20180708Schema); err != nil { + t.Fatalf("ValidateFileAgainstSchema() error = %v", err) + } +} \ No newline at end of file diff --git a/config/version.go b/config/version.go index 4fef7a49f..3beb6a39c 100644 --- a/config/version.go +++ b/config/version.go @@ -25,7 +25,7 @@ import ( ) // Version of Fn CLI -var Version = "0.6.49" +var Version = "0.6.52" func GetVersion(versionType string) string { base := "https://github.com/fnproject/cli/releases" diff --git a/go.mod b/go.mod index 2b1ff09a0..128a5ac57 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ require ( github.com/coreos/go-semver v0.3.0 github.com/fatih/color v0.0.0-20170926111411-5df930a27be2 github.com/fnproject/fn_go v0.8.10 + github.com/fsnotify/fsnotify v1.4.7 github.com/ghodss/yaml v1.0.0 github.com/giantswarm/semver-bump v0.0.0-20140912095342-88e6c9f2fe39 github.com/go-openapi/runtime v0.19.23 @@ -11,12 +12,12 @@ require ( github.com/mattn/go-isatty v0.0.3 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.3.2 - github.com/oracle/oci-go-sdk/v65 v65.41.1 + github.com/oracle/oci-go-sdk/v65 v65.113.0 github.com/spf13/viper v1.6.2 github.com/stretchr/testify v1.11.1 github.com/urfave/cli v1.20.0 github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f - golang.org/x/sys v0.32.0 + golang.org/x/sys v0.38.0 gopkg.in/yaml.v2 v2.3.0 ) @@ -25,7 +26,6 @@ require ( github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect github.com/go-openapi/analysis v0.19.10 // indirect github.com/go-openapi/errors v0.19.8 // indirect github.com/go-openapi/jsonpointer v0.19.3 // indirect @@ -36,7 +36,7 @@ require ( github.com/go-openapi/swag v0.19.11 // indirect github.com/go-openapi/validate v0.19.12 // indirect github.com/go-stack/stack v1.8.0 // indirect - github.com/gofrs/flock v0.8.1 // indirect + github.com/gofrs/flock v0.10.0 // indirect github.com/golang/mock v1.4.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/juju/errgo v0.0.0-20140925100237-08cceb5d0b53 // indirect @@ -54,15 +54,16 @@ require ( github.com/subosito/gotenv v1.2.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect go.mongodb.org/mongo-driver v1.5.1 // indirect - golang.org/x/crypto v0.37.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/term v0.31.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/crypto v0.45.0 // indirect + golang.org/x/net v0.47.0 // indirect + golang.org/x/term v0.37.0 // indirect + golang.org/x/text v0.31.0 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -go 1.23.0 +go 1.24.0 -toolchain go1.23.10 +toolchain go1.25.9 diff --git a/go.sum b/go.sum index a20f3f822..0ad6f06b8 100644 --- a/go.sum +++ b/go.sum @@ -149,8 +149,8 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.10.0 h1:SHMXenfaB03KbroETaCMtbBg3Yn29v4w1r+tgy4ff4k= +github.com/gofrs/flock v0.10.0/go.mod h1:FirDy1Ing0mI2+kB6wk+vyyAH+e6xiE+EYA0jnzV9jc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -199,6 +199,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -226,11 +228,10 @@ github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYG github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oracle/oci-go-sdk/v65 v65.41.1 h1:+lbosOyNiib3TGJDvLq1HwEAuFqkOjPJDIkyxM15WdQ= -github.com/oracle/oci-go-sdk/v65 v65.41.1/go.mod h1:MXMLMzHnnd9wlpgadPkdlkZ9YrwQmCOmbX5kjVEJodw= +github.com/oracle/oci-go-sdk/v65 v65.113.0 h1:8pLtBo+o5n4S+Bt9zk5qZITWpfyRnKYAy7VsProDJAk= +github.com/oracle/oci-go-sdk/v65 v65.113.0/go.mod h1:8ZzvzuEG/cFLFZhxg/Mg1w19KqyXBKO3c17QIc5PkGs= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= @@ -254,6 +255,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -312,6 +315,8 @@ github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -331,8 +336,8 @@ golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= +golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -348,8 +353,8 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -371,17 +376,16 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -405,8 +409,9 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/langs/base.go b/langs/base.go index 338c22745..b816ef430 100644 --- a/langs/base.go +++ b/langs/base.go @@ -38,9 +38,11 @@ func init() { registerHelper(&GoLangHelper{Version: "1.24"}) registerHelper(&GoLangHelper{Version: "1.23"}) // order matter, 'java' will pick up the first JavaLangHelper + registerHelper(&JavaLangHelper{Version: "21"}) registerHelper(&JavaLangHelper{Version: "17"}) registerHelper(&JavaLangHelper{Version: "11"}) registerHelper(&JavaLangHelper{Version: "8"}) + registerHelper(&NodeLangHelper{Version: "24"}) registerHelper(&NodeLangHelper{Version: "22"}) // order matter, 'python' will pick up the first PythonLangHelper registerHelper(&PythonLangHelper{Version: "3.12"}) @@ -54,7 +56,8 @@ func init() { // for older versions support backwards compatibility fallBackOlderVersions["ruby"] = &RubyLangHelper{Version: "3.1"} - fallBackOlderVersions["node"] = &NodeLangHelper{Version: "20"} + fallBackOlderVersions["node"] = &NodeLangHelper{Version: "22"} + fallBackOlderVersions["java"] = &JavaLangHelper{Version: "17"} fallBackOlderVersions["go"] = &GoLangHelper{Version: "1.11"} fallBackOlderVersions["dotnet"] = &DotnetLangHelper{Version: "3.1"} } diff --git a/langs/java.go b/langs/java.go index d97d4b879..0d201cbb6 100644 --- a/langs/java.go +++ b/langs/java.go @@ -68,6 +68,8 @@ func (h *JavaLangHelper) BuildFromImage() (string, error) { return fmt.Sprintf("fnproject/fn-java-fdk-build:jdk11-%s", fdkVersion), nil } else if h.Version == "17" { return fmt.Sprintf("fnproject/fn-java-fdk-build:jdk17-%s", fdkVersion), nil + } else if h.Version == "21" { + return fmt.Sprintf("fnproject/fn-java-fdk-build:jdk21-%s", fdkVersion), nil } else { return "", fmt.Errorf("unsupported java version %s", h.Version) } @@ -85,6 +87,8 @@ func (h *JavaLangHelper) RunFromImage() (string, error) { return fmt.Sprintf("fnproject/fn-java-fdk:jre11-%s", fdkVersion), nil } else if h.Version == "17" { return fmt.Sprintf("fnproject/fn-java-fdk:jre17-%s", fdkVersion), nil + } else if h.Version == "21" { + return fmt.Sprintf("fnproject/fn-java-fdk:jre21-%s", fdkVersion), nil } else { return "", fmt.Errorf("unsupported java version %s", h.Version) } @@ -197,6 +201,11 @@ func mavenOpts() string { return opts.String() } +// MavenOptsForTest exposes the computed Maven opts for tests that verify generated Dockerfiles. +func MavenOptsForTest() string { + return mavenOpts() +} + /* TODO temporarily generate maven project boilerplate from hardcoded values. diff --git a/langs/runtime_support_test.go b/langs/runtime_support_test.go new file mode 100644 index 000000000..316426c12 --- /dev/null +++ b/langs/runtime_support_test.go @@ -0,0 +1,91 @@ +package langs + +import "testing" + +func TestDefaultRuntimeVersions(t *testing.T) { + tests := []struct { + runtime string + want string + }{ + {runtime: "node", want: "node24"}, + {runtime: "java", want: "java21"}, + } + + for _, tt := range tests { + t.Run(tt.runtime, func(t *testing.T) { + helper := GetLangHelper(tt.runtime) + if helper == nil { + t.Fatalf("expected helper for runtime %q", tt.runtime) + } + + got := helper.LangStrings()[1] + if got != tt.want { + t.Fatalf("expected default runtime %q to resolve to %q, got %q", tt.runtime, tt.want, got) + } + }) + } +} + +func TestFallbackRuntimeVersions(t *testing.T) { + tests := []struct { + runtime string + want string + }{ + {runtime: "node", want: "node22"}, + {runtime: "java", want: "java17"}, + } + + for _, tt := range tests { + t.Run(tt.runtime, func(t *testing.T) { + helper := GetFallbackLangHelper(tt.runtime) + if helper == nil { + t.Fatalf("expected fallback helper for runtime %q", tt.runtime) + } + + got := helper.LangStrings()[1] + if got != tt.want { + t.Fatalf("expected fallback runtime %q to resolve to %q, got %q", tt.runtime, tt.want, got) + } + }) + } +} + +func TestNode24Images(t *testing.T) { + helper := &NodeLangHelper{Version: "24"} + + buildImage, err := helper.BuildFromImage() + if err != nil { + t.Fatalf("BuildFromImage() returned error: %v", err) + } + runImage, err := helper.RunFromImage() + if err != nil { + t.Fatalf("RunFromImage() returned error: %v", err) + } + + if buildImage != "fnproject/node:24-dev" { + t.Fatalf("expected node24 build image %q, got %q", "fnproject/node:24-dev", buildImage) + } + if runImage != "fnproject/node:24" { + t.Fatalf("expected node24 run image %q, got %q", "fnproject/node:24", runImage) + } +} + +func TestJava21Images(t *testing.T) { + helper := &JavaLangHelper{Version: "21", latestFdkVersion: "1.2.3"} + + buildImage, err := helper.BuildFromImage() + if err != nil { + t.Fatalf("BuildFromImage() returned error: %v", err) + } + runImage, err := helper.RunFromImage() + if err != nil { + t.Fatalf("RunFromImage() returned error: %v", err) + } + + if buildImage != "fnproject/fn-java-fdk-build:jdk21-1.2.3" { + t.Fatalf("expected java21 build image %q, got %q", "fnproject/fn-java-fdk-build:jdk21-1.2.3", buildImage) + } + if runImage != "fnproject/fn-java-fdk:jre21-1.2.3" { + t.Fatalf("expected java21 run image %q, got %q", "fnproject/fn-java-fdk:jre21-1.2.3", runImage) + } +} \ No newline at end of file diff --git a/main.go b/main.go index 9d7c23bc3..a61b6730d 100644 --- a/main.go +++ b/main.go @@ -147,8 +147,8 @@ func newFn() *cli.App { app.CommandNotFound = func(c *cli.Context, cmd string) { fmt.Fprintf(os.Stderr, color.Bold("\nFn: ")+"'"+color.Red("%v")+"' is not a Fn Command ", cmd) //fmt.Fprintf(os.Stderr, "\n\nNote the fn CLI command structure has changed, please change your command to use the new structure.\n") - fmt.Fprintf(os.Stderr, color.Italic("\n\nSee ")+"'"+color.BrightCyan("fn --help")+"'"+color.Italic(" for more information.")) - fmt.Fprintf(os.Stderr, color.BrightCyan(" Note ")+"the fn CLI command structure has changed, please change your command to use the new structure.\n") + fmt.Fprint(os.Stderr, color.Italic("\n\nSee ")+"'"+color.BrightCyan("fn --help")+"'"+color.Italic(" for more information.")) + fmt.Fprint(os.Stderr, color.BrightCyan(" Note ")+"the fn CLI command structure has changed, please change your command to use the new structure.\n") os.Exit(1) } @@ -230,7 +230,7 @@ func prepareCmdArgsValidation(cmds []cli.Command) { } else { fmt.Fprintf(os.Stderr, color.Bold("\nFn: ")+c.Command.Usage+" using "+color.Cyan(c.Command.HelpName)+" requires the missing arguments '"+color.Red("%v")+"'\n", strings.Join(reqArgs[c.NArg():], " ")) } - fmt.Fprintf(os.Stderr, color.Italic("\nSee ")+"'"+color.BrightCyan(c.Command.HelpName+" --help")+"'"+color.Italic(" for more information.\n")) + fmt.Fprint(os.Stderr, color.Italic("\nSee ")+"'"+color.BrightCyan(c.Command.HelpName+" --help")+"'"+color.Italic(" for more information.\n")) os.Exit(1) } return cli.HandleAction(action, c) @@ -260,7 +260,7 @@ func main() { if err != nil { // TODO: this doesn't seem to get called even when an error returns from a command, but maybe urfave is doing a non zero exit anyways? nope: https://github.com/urfave/cli/issues/610 fmt.Fprintf(os.Stderr, color.Bold("\nFn:")+" %v", err) - fmt.Fprintf(os.Stderr, color.Italic("\n\nSee ")+"'"+color.BrightCyan("fn --help")+"'"+color.Italic(" for more information.")) + fmt.Fprint(os.Stderr, color.Italic("\n\nSee ")+"'"+color.BrightCyan("fn --help")+"'"+color.Italic(" for more information.")) fmt.Fprintf(os.Stderr, " Client version: %s\n", config.Version) os.Exit(1) } diff --git a/objects/fn/clear_destinations_test.go b/objects/fn/clear_destinations_test.go new file mode 100644 index 000000000..153b1de61 --- /dev/null +++ b/objects/fn/clear_destinations_test.go @@ -0,0 +1,30 @@ +package fn + +import ( + "flag" + "testing" + + models "github.com/fnproject/fn_go/modelsv2" + "github.com/urfave/cli" +) + +func TestValidateDestinationFlagCombination(t *testing.T) { + set := flag.NewFlagSet("test", flag.ContinueOnError) + _ = set.Bool("clear-on-success", true, "") + _ = set.String("on-success", "stream:ocid1.stream.oc1..abc", "") + ctx := cli.NewContext(nil, set, nil) + if _, err := validateDestinationFlagCombination(ctx); err == nil { + t.Fatal("expected conflict error for on-success + clear-on-success") + } +} + +func TestSetClearDestinationAnnotations(t *testing.T) { + fn := &models.Fn{Annotations: map[string]interface{}{}} + SetClearDestinationAnnotations(fn, true, true) + if fn.Annotations[annotationSuccessDestinationKind] != "NONE" { + t.Fatalf("expected success kind NONE, got %#v", fn.Annotations[annotationSuccessDestinationKind]) + } + if fn.Annotations[annotationFailureDestinationKind] != "NONE" { + t.Fatalf("expected failure kind NONE, got %#v", fn.Annotations[annotationFailureDestinationKind]) + } +} \ No newline at end of file diff --git a/objects/fn/fns.go b/objects/fn/fns.go index 2221605e1..f27cc0eb0 100644 --- a/objects/fn/fns.go +++ b/objects/fn/fns.go @@ -25,6 +25,7 @@ import ( "path" "strings" "text/tabwriter" + "time" client "github.com/fnproject/cli/client" "github.com/fnproject/cli/common" @@ -43,6 +44,26 @@ type fnsCmd struct { client *fnclient.Fn } +const annotationDetachedTimeoutSeconds = "oracle.com/oci/detachedModeTimeoutInSeconds" + +const ( + annotationSuccessDestinationKind = "oracle.com/oci/successDestinationKind" + annotationSuccessDestinationOCID = "oracle.com/oci/successDestinationOcid" + annotationFailureDestinationKind = "oracle.com/oci/failureDestinationKind" + annotationFailureDestinationOCID = "oracle.com/oci/failureDestinationOcid" +) + +type detachedDestinationView struct { + Type string `json:"type,omitempty"` + OCID string `json:"ocid,omitempty"` +} + +type detachedModeView struct { + Timeout string `json:"timeout,omitempty"` + OnSuccess *detachedDestinationView `json:"onSuccess,omitempty"` + OnFailure *detachedDestinationView `json:"onFailure,omitempty"` +} + // FnFlags used to create/update functions var FnFlags = []cli.Flag{ cli.Uint64Flag{ @@ -69,8 +90,217 @@ var FnFlags = []cli.Flag{ Name: "image", Usage: "Function image", }, + cli.StringFlag{ + Name: "detached-timeout", + Usage: "Set OCI detached mode timeout using a duration like 20m or 1h", + }, + cli.StringFlag{ + Name: "on-success", + Usage: "Set OCI detached success destination using :", + }, + cli.StringFlag{ + Name: "on-failure", + Usage: "Set OCI detached failure destination using :", + }, +} +var updateFnFlags = append(append([]cli.Flag{}, FnFlags...), + cli.BoolFlag{ + Name: "clear-on-success", + Usage: "Clear OCI detached success destination", + }, + cli.BoolFlag{ + Name: "clear-on-failure", + Usage: "Clear OCI detached failure destination", + }, +) + +type clearDestinationRequest struct { + Success bool + Failure bool +} + +func warnUnsupportedDetachedTimeout() { + fmt.Fprintln(os.Stderr, "Warning: --detached-timeout is only supported with an oracle provider and will be ignored.") +} + +func SetDetachedTimeoutAnnotation(fn *models.Fn, seconds int) { + if fn == nil || seconds <= 0 { + return + } + if fn.Annotations == nil { + fn.Annotations = make(map[string]interface{}) + } + fn.Annotations[annotationDetachedTimeoutSeconds] = seconds +} + +func warnUnsupportedDestination(flagName string) { + fmt.Fprintf(os.Stderr, "Warning: %s is only supported with an oracle provider and will be ignored.\n", flagName) +} + +func validateDestinationFlagCombination(c *cli.Context) (*clearDestinationRequest, error) { + clearReq := &clearDestinationRequest{ + Success: c.Bool("clear-on-success"), + Failure: c.Bool("clear-on-failure"), + } + if clearReq.Success && strings.TrimSpace(c.String("on-success")) != "" { + return nil, fmt.Errorf("--on-success and --clear-on-success cannot be used together") + } + if clearReq.Failure && strings.TrimSpace(c.String("on-failure")) != "" { + return nil, fmt.Errorf("--on-failure and --clear-on-failure cannot be used together") + } + return clearReq, nil +} + +func SetDestinationAnnotations(fn *models.Fn, onSuccess, onFailure *common.OCIDestination) { + if fn == nil { + return + } + if fn.Annotations == nil { + fn.Annotations = make(map[string]interface{}) + } + if onSuccess != nil { + fn.Annotations[annotationSuccessDestinationKind] = strings.ToUpper(onSuccess.Type) + fn.Annotations[annotationSuccessDestinationOCID] = onSuccess.OCID + } + if onFailure != nil { + fn.Annotations[annotationFailureDestinationKind] = strings.ToUpper(onFailure.Type) + fn.Annotations[annotationFailureDestinationOCID] = onFailure.OCID + } +} + +func SetClearDestinationAnnotations(fn *models.Fn, clearSuccess, clearFailure bool) { + if fn == nil || (!clearSuccess && !clearFailure) { + return + } + if fn.Annotations == nil { + fn.Annotations = make(map[string]interface{}) + } + if clearSuccess { + fn.Annotations[annotationSuccessDestinationKind] = "NONE" + fn.Annotations[annotationSuccessDestinationOCID] = "" + } + if clearFailure { + fn.Annotations[annotationFailureDestinationKind] = "NONE" + fn.Annotations[annotationFailureDestinationOCID] = "" + } +} + +func formatDetachedTimeout(seconds int) string { + if seconds <= 0 { + return "" + } + d := time.Duration(seconds) * time.Second + if d%time.Hour == 0 { + return fmt.Sprintf("%dh", int(d/time.Hour)) + } + if d%time.Minute == 0 { + return fmt.Sprintf("%dm", int(d/time.Minute)) + } + return fmt.Sprintf("%ds", seconds) +} + +func parseDetachedTimeoutFromAnnotations(fn *models.Fn) string { + if fn == nil || fn.Annotations == nil { + return "" + } + raw, ok := fn.Annotations[annotationDetachedTimeoutSeconds] + if !ok { + return "" + } + switch typed := raw.(type) { + case int: + return formatDetachedTimeout(typed) + case int32: + return formatDetachedTimeout(int(typed)) + case int64: + return formatDetachedTimeout(int(typed)) + case float64: + return formatDetachedTimeout(int(typed)) + default: + return "" + } +} + +func parseDetachedDestinationFromAnnotations(fn *models.Fn, kindKey, ocidKey string) *detachedDestinationView { + if fn == nil || fn.Annotations == nil { + return nil + } + kindRaw, ok := fn.Annotations[kindKey] + if !ok { + return nil + } + kind, ok := kindRaw.(string) + if !ok || strings.TrimSpace(kind) == "" { + return nil + } + ocidRaw, ok := fn.Annotations[ocidKey] + if !ok { + return &detachedDestinationView{Type: strings.ToLower(kind)} + } + ocid, ok := ocidRaw.(string) + if !ok { + return &detachedDestinationView{Type: strings.ToLower(kind)} + } + return &detachedDestinationView{Type: strings.ToLower(kind), OCID: ocid} +} + +func getDetachedModeView(fn *models.Fn) *detachedModeView { + timeout := parseDetachedTimeoutFromAnnotations(fn) + onSuccess := parseDetachedDestinationFromAnnotations(fn, annotationSuccessDestinationKind, annotationSuccessDestinationOCID) + onFailure := parseDetachedDestinationFromAnnotations(fn, annotationFailureDestinationKind, annotationFailureDestinationOCID) + if timeout == "" && onSuccess == nil && onFailure == nil { + return nil + } + return &detachedModeView{Timeout: timeout, OnSuccess: onSuccess, OnFailure: onFailure} +} + +func formatDetachedDestination(view *detachedDestinationView) string { + if view == nil { + return "" + } + if view.OCID == "" { + return view.Type + } + return fmt.Sprintf("%s:%s", view.Type, view.OCID) +} + +func formatDetachedDestinations(fn *models.Fn) string { + view := getDetachedModeView(fn) + if view == nil { + return "" + } + parts := []string{} + if view.OnSuccess != nil { + parts = append(parts, "success="+formatDetachedDestination(view.OnSuccess)) + } + if view.OnFailure != nil { + parts = append(parts, "failure="+formatDetachedDestination(view.OnFailure)) + } + return strings.Join(parts, ",") +} + +func buildInspectFnMap(fn *models.Fn) (map[string]interface{}, error) { + data, err := json.Marshal(fn) + if err != nil { + return nil, err + } + inspect := map[string]interface{}{} + if err := json.Unmarshal(data, &inspect); err != nil { + return nil, err + } + if detached := getDetachedModeView(fn); detached != nil { + detachedData, err := json.Marshal(detached) + if err != nil { + return nil, err + } + var detachedValue map[string]interface{} + if err := json.Unmarshal(detachedData, &detachedValue); err != nil { + return nil, err + } + inspect["detachedMode"] = detachedValue + } + return inspect, nil } -var updateFnFlags = FnFlags // WithSlash appends "/" to function path func WithSlash(p string) string { @@ -95,13 +325,15 @@ func printFunctions(c *cli.Context, fns []*models.Fn) error { var newFns []interface{} for _, fn := range fns { newFns = append(newFns, struct { - Name string `json:"name"` - Image string `json:"image"` - ID string `json:"id"` + Name string `json:"name"` + Image string `json:"image"` + ID string `json:"id"` + DetachedMode *detachedModeView `json:"detachedMode,omitempty"` }{ - fn.Name, - fn.Image, - fn.ID, + Name: fn.Name, + Image: fn.Image, + ID: fn.ID, + DetachedMode: getDetachedModeView(fn), }) } b, err := json.MarshalIndent(newFns, "", " ") @@ -111,10 +343,15 @@ func printFunctions(c *cli.Context, fns []*models.Fn) error { fmt.Fprint(os.Stdout, string(b)) } else { w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) - fmt.Fprint(w, "NAME", "\t", "IMAGE", "\t", "ID", "\n") + fmt.Fprint(w, "NAME", "\t", "IMAGE", "\t", "DETACHED_TIMEOUT", "\t", "DESTINATIONS", "\t", "ID", "\n") for _, f := range fns { - fmt.Fprint(w, f.Name, "\t", f.Image, "\t", f.ID, "\t", "\n") + view := getDetachedModeView(f) + timeout := "" + if view != nil { + timeout = view.Timeout + } + fmt.Fprint(w, f.Name, "\t", f.Image, "\t", timeout, "\t", formatDetachedDestinations(f), "\t", f.ID, "\t", "\n") } if err := w.Flush(); err != nil { return err @@ -261,6 +498,22 @@ func WithFuncFileV20180708(ff *common.FuncFileV20180708, fn *models.Fn) error { func (f *fnsCmd) create(c *cli.Context) error { appName := c.Args().Get(0) fnName := c.Args().Get(1) + _, detachedSeconds, err := common.ParseDetachedTimeoutSpec(c.String("detached-timeout")) + if err != nil { + return err + } + onSuccess, err := common.ParseOCIDestinationSpec("--on-success", c.String("on-success")) + if err != nil { + return err + } + onFailure, err := common.ParseOCIDestinationSpec("--on-failure", c.String("on-failure")) + if err != nil { + return err + } + clearReq, err := validateDestinationFlagCombination(c) + if err != nil { + return err + } fn := &models.Fn{} fn.Name = fnName @@ -274,6 +527,37 @@ func (f *fnsCmd) create(c *cli.Context) error { if fn.Image == "" { return errors.New("no image specified") } + if detachedSeconds > 0 { + if !common.IsOracleProvider(f.provider) { + warnUnsupportedDetachedTimeout() + } else { + SetDetachedTimeoutAnnotation(fn, detachedSeconds) + } + } + if onSuccess != nil || onFailure != nil { + if !common.IsOracleProvider(f.provider) { + if onSuccess != nil { + warnUnsupportedDestination("--on-success") + } + if onFailure != nil { + warnUnsupportedDestination("--on-failure") + } + } else { + SetDestinationAnnotations(fn, onSuccess, onFailure) + } + } + if clearReq.Success || clearReq.Failure { + if !common.IsOracleProvider(f.provider) { + if clearReq.Success { + warnUnsupportedDestination("--clear-on-success") + } + if clearReq.Failure { + warnUnsupportedDestination("--clear-on-failure") + } + } else { + SetClearDestinationAnnotations(fn, clearReq.Success, clearReq.Failure) + } + } a, err := app.GetAppByName(f.client, appName) if err != nil { @@ -375,6 +659,22 @@ func GetFnByName(client *fnclient.Fn, appID, fnName string) (*models.Fn, error) func (f *fnsCmd) update(c *cli.Context) error { appName := c.Args().Get(0) fnName := c.Args().Get(1) + _, detachedSeconds, err := common.ParseDetachedTimeoutSpec(c.String("detached-timeout")) + if err != nil { + return err + } + onSuccess, err := common.ParseOCIDestinationSpec("--on-success", c.String("on-success")) + if err != nil { + return err + } + onFailure, err := common.ParseOCIDestinationSpec("--on-failure", c.String("on-failure")) + if err != nil { + return err + } + clearReq, err := validateDestinationFlagCombination(c) + if err != nil { + return err + } app, err := app.GetAppByName(f.client, appName) if err != nil { @@ -386,6 +686,37 @@ func (f *fnsCmd) update(c *cli.Context) error { } WithFlags(c, fn) + if detachedSeconds > 0 { + if !common.IsOracleProvider(f.provider) { + warnUnsupportedDetachedTimeout() + } else { + SetDetachedTimeoutAnnotation(fn, detachedSeconds) + } + } + if onSuccess != nil || onFailure != nil { + if !common.IsOracleProvider(f.provider) { + if onSuccess != nil { + warnUnsupportedDestination("--on-success") + } + if onFailure != nil { + warnUnsupportedDestination("--on-failure") + } + } else { + SetDestinationAnnotations(fn, onSuccess, onFailure) + } + } + if clearReq.Success || clearReq.Failure { + if !common.IsOracleProvider(f.provider) { + if clearReq.Success { + warnUnsupportedDestination("--clear-on-success") + } + if clearReq.Failure { + warnUnsupportedDestination("--clear-on-failure") + } + } else { + SetClearDestinationAnnotations(fn, clearReq.Success, clearReq.Failure) + } + } err = PutFn(f.client, fn.ID, fn) if err != nil { @@ -528,20 +859,14 @@ func (f *fnsCmd) inspect(c *cli.Context) error { enc := json.NewEncoder(os.Stdout) enc.SetIndent("", "\t") - - if prop == "" { - enc.Encode(fn) - return nil - } - - data, err := json.Marshal(fn) + inspect, err := buildInspectFnMap(fn) if err != nil { return fmt.Errorf("failed to inspect %s: %s", fnName, err) } - var inspect map[string]interface{} - err = json.Unmarshal(data, &inspect) - if err != nil { - return fmt.Errorf("failed to inspect %s: %s", fnName, err) + + if prop == "" { + enc.Encode(inspect) + return nil } jq := jsonq.NewQuery(inspect) diff --git a/objects/fn/output_test.go b/objects/fn/output_test.go new file mode 100644 index 000000000..cc9c1623d --- /dev/null +++ b/objects/fn/output_test.go @@ -0,0 +1,79 @@ +package fn + +import ( + "encoding/json" + "testing" + + models "github.com/fnproject/fn_go/modelsv2" + "github.com/jmoiron/jsonq" +) + +func TestGetDetachedModeView(t *testing.T) { + fn := &models.Fn{Annotations: map[string]interface{}{ + annotationDetachedTimeoutSeconds: 1200, + annotationSuccessDestinationKind: "STREAM", + annotationSuccessDestinationOCID: "ocid1.stream.oc1..abc", + annotationFailureDestinationKind: "NOTIFICATIONS", + annotationFailureDestinationOCID: "ocid1.onstopic.oc1..abc", + }} + view := getDetachedModeView(fn) + if view == nil { + t.Fatal("expected detached mode view") + } + if view.Timeout != "20m" { + t.Fatalf("expected timeout 20m, got %q", view.Timeout) + } + if view.OnSuccess == nil || view.OnSuccess.Type != "stream" { + t.Fatalf("expected stream onSuccess, got %#v", view.OnSuccess) + } + if view.OnFailure == nil || view.OnFailure.Type != "notifications" { + t.Fatalf("expected notifications onFailure, got %#v", view.OnFailure) + } +} + +func TestBuildInspectFnMapIncludesDetachedMode(t *testing.T) { + fn := &models.Fn{Annotations: map[string]interface{}{ + annotationDetachedTimeoutSeconds: 1200, + annotationSuccessDestinationKind: "STREAM", + annotationSuccessDestinationOCID: "ocid1.stream.oc1..abc", + }} + inspect, err := buildInspectFnMap(fn) + if err != nil { + t.Fatalf("buildInspectFnMap() error = %v", err) + } + detached, ok := inspect["detachedMode"] + if !ok { + t.Fatal("expected detachedMode field in inspect map") + } + data, err := json.Marshal(detached) + if err != nil { + t.Fatalf("failed to marshal detachedMode: %v", err) + } + var got map[string]interface{} + if err := json.Unmarshal(data, &got); err != nil { + t.Fatalf("failed to unmarshal detachedMode: %v", err) + } + if got["timeout"] != "20m" { + t.Fatalf("expected timeout 20m, got %#v", got["timeout"]) + } +} + +func TestBuildInspectFnMapSupportsNestedDetachedModeQuery(t *testing.T) { + fn := &models.Fn{Annotations: map[string]interface{}{ + annotationDetachedTimeoutSeconds: 1200, + annotationSuccessDestinationKind: "STREAM", + annotationSuccessDestinationOCID: "ocid1.stream.oc1..abc", + }} + inspect, err := buildInspectFnMap(fn) + if err != nil { + t.Fatalf("buildInspectFnMap() error = %v", err) + } + jq := jsonq.NewQuery(inspect) + value, err := jq.Interface("detachedMode", "timeout") + if err != nil { + t.Fatalf("expected nested query to succeed, got error %v", err) + } + if value != "20m" { + t.Fatalf("expected timeout 20m, got %#v", value) + } +} \ No newline at end of file diff --git a/test/cli_autocomplete_test.go b/test/cli_autocomplete_test.go index 25e45b0f7..54a573b53 100644 --- a/test/cli_autocomplete_test.go +++ b/test/cli_autocomplete_test.go @@ -32,8 +32,10 @@ func TestTopLevelAutoComplete(t *testing.T) { h := testharness.Create(t) defer h.Cleanup() + topLevelCmd := commands.Commands + topLevelCmd["version"] = commands.VersionCommand() allCmds := map[string]commands.Cmd{ - " ": commands.Commands, //only has top level commands + " ": topLevelCmd, //only has top level commands "create": commands.CreateCmds, "config": commands.ConfigCmds, "delete": commands.DeleteCmds, diff --git a/test/cli_init_long_running_test.go b/test/cli_init_long_running_test.go new file mode 100644 index 000000000..de6708e91 --- /dev/null +++ b/test/cli_init_long_running_test.go @@ -0,0 +1,28 @@ +package test + +import ( + "testing" + + "github.com/fnproject/cli/testharness" +) + +func TestInitDetachedTimeoutWritesYaml(t *testing.T) { + t.Parallel() + + h := testharness.Create(t) + defer h.Cleanup() + + appName := h.NewAppName() + funcName := h.NewFuncName(appName) + dirName := funcName + "_dir" + h.Fn("init", "--runtime", "go", "--name", funcName, "--detached-timeout", "20m", dirName).AssertSuccess() + + h.Cd(dirName) + yamlFile := h.GetYamlFile("func.yaml") + if yamlFile.Deploy == nil || yamlFile.Deploy.OCI == nil || yamlFile.Deploy.OCI.DetachedMode == nil { + t.Fatal("expected detached mode settings in func.yaml") + } + if yamlFile.Deploy.OCI.DetachedMode.Timeout != "20m" { + t.Fatalf("expected detached timeout 20m, got %#v", yamlFile.Deploy.OCI.DetachedMode.Timeout) + } +} \ No newline at end of file diff --git a/test/cli_init_test.go b/test/cli_init_test.go index d01b10777..377ac64f1 100644 --- a/test/cli_init_test.go +++ b/test/cli_init_test.go @@ -30,11 +30,13 @@ var runtimes = []string{ "java8", "java11", "java17", + "java21", "kotlin", "ruby", "ruby3.3", "node", "node22", + "node24", "python", "python3.12", "python3.11", diff --git a/test/cli_lang_boilerplate_test.go b/test/cli_lang_boilerplate_test.go index bf07cce26..f79b390fa 100644 --- a/test/cli_lang_boilerplate_test.go +++ b/test/cli_lang_boilerplate_test.go @@ -37,9 +37,11 @@ var Runtimes = []struct { {"java8", ""}, {"java11", ""}, {"java17", ""}, + {"java21", ""}, {"kotlin", ""}, {"node", ""}, {"node22", ""}, + {"node24", ""}, {"ruby", ""}, {"ruby3.3", ""}, {"python", ""}, diff --git a/test/cli_long_running_clear_destinations_test.go b/test/cli_long_running_clear_destinations_test.go new file mode 100644 index 000000000..db57da0f5 --- /dev/null +++ b/test/cli_long_running_clear_destinations_test.go @@ -0,0 +1,22 @@ +package test + +import ( + "testing" + + "github.com/fnproject/cli/testharness" +) + +func TestUpdateDestinationClearFlagsConflict(t *testing.T) { + t.Parallel() + + h := testharness.Create(t) + defer h.Cleanup() + + res := h.Fn("update", "function", "dummy-app", "dummy-fn", + "--on-success", "stream:ocid1.stream.oc1..abc", + "--clear-on-success") + if res.Success { + t.Fatal("expected update to fail when both --on-success and --clear-on-success are provided") + } + res.AssertStderrContains("--on-success and --clear-on-success cannot be used together") +} \ No newline at end of file diff --git a/test/cli_long_running_destinations_test.go b/test/cli_long_running_destinations_test.go new file mode 100644 index 000000000..a9c9ec7b6 --- /dev/null +++ b/test/cli_long_running_destinations_test.go @@ -0,0 +1,34 @@ +package test + +import ( + "testing" + + "github.com/fnproject/cli/testharness" +) + +func TestInitDetachedDestinationsWriteYaml(t *testing.T) { + t.Parallel() + + h := testharness.Create(t) + defer h.Cleanup() + + appName := h.NewAppName() + funcName := h.NewFuncName(appName) + dirName := funcName + "_dir" + h.Fn("init", "--runtime", "go", "--name", funcName, + "--on-success", "stream:ocid1.stream.oc1..abc", + "--on-failure", "notifications:ocid1.onstopic.oc1..abc", + dirName).AssertSuccess() + + h.Cd(dirName) + yamlFile := h.GetYamlFile("func.yaml") + if yamlFile.Deploy == nil || yamlFile.Deploy.OCI == nil || yamlFile.Deploy.OCI.DetachedMode == nil { + t.Fatal("expected detached mode settings in func.yaml") + } + if yamlFile.Deploy.OCI.DetachedMode.OnSuccess == nil || yamlFile.Deploy.OCI.DetachedMode.OnSuccess.Type != "stream" { + t.Fatalf("expected on_success stream destination, got %#v", yamlFile.Deploy.OCI.DetachedMode.OnSuccess) + } + if yamlFile.Deploy.OCI.DetachedMode.OnFailure == nil || yamlFile.Deploy.OCI.DetachedMode.OnFailure.Type != "notifications" { + t.Fatalf("expected on_failure notifications destination, got %#v", yamlFile.Deploy.OCI.DetachedMode.OnFailure) + } +} \ No newline at end of file diff --git a/test/cli_misc_test.go b/test/cli_misc_test.go index 7c45b189c..36ec28d86 100644 --- a/test/cli_misc_test.go +++ b/test/cli_misc_test.go @@ -24,6 +24,7 @@ import ( "strings" "testing" + "github.com/fnproject/cli/common" "github.com/fnproject/cli/testharness" ) @@ -164,6 +165,51 @@ func TestSettingMemoryWorks(t *testing.T) { h.Fn("invoke", appName, "another").AssertSuccess() } +func TestFuncYamlWithOCIManagedSettingsParsesInHarness(t *testing.T) { + t.Parallel() + + h := testharness.Create(t) + defer h.Cleanup() + h.MkDir("hello") + h.Cd("hello") + withMinimalFunction(h) + count := 1 + h.WriteYamlFile("func.yaml", common.FuncFileV20180708{ + Schema_version: common.LatestYamlVersion, + Name: "hello", + Version: "0.0.1", + Runtime: "go", + Entrypoint: "./func", + Build_image: "fnproject/go:dev", + Run_image: "fnproject/go", + Deploy: &common.FuncDeployConfig{ + OCI: &common.OCIFunctionDeployConfig{ + ProvisionedConcurrency: &common.OCIProvisionedConcurrencyConfig{ + Strategy: "CONSTANT", + Count: &count, + }, + DetachedMode: &common.OCIDetachedModeConfig{ + Timeout: "20m", + }, + }, + }, + }) + + yamlFile := h.GetYamlFile("func.yaml") + if yamlFile.Deploy == nil || yamlFile.Deploy.OCI == nil { + t.Fatal("expected deploy.oci to be parsed from func.yaml") + } + if yamlFile.Deploy.OCI.ProvisionedConcurrency == nil || yamlFile.Deploy.OCI.ProvisionedConcurrency.Strategy != "CONSTANT" { + t.Fatalf("expected provisioned concurrency settings to be parsed, got %#v", yamlFile.Deploy.OCI.ProvisionedConcurrency) + } + if yamlFile.Deploy.OCI.ProvisionedConcurrency.Count == nil || *yamlFile.Deploy.OCI.ProvisionedConcurrency.Count != 1 { + t.Fatalf("expected provisioned concurrency count 1, got %#v", yamlFile.Deploy.OCI.ProvisionedConcurrency.Count) + } + if yamlFile.Deploy.OCI.DetachedMode == nil || yamlFile.Deploy.OCI.DetachedMode.Timeout != "20m" { + t.Fatalf("expected detached mode timeout 20m, got %#v", yamlFile.Deploy.OCI.DetachedMode) + } +} + func TestAllMainCommandsExist(t *testing.T) { t.Parallel() diff --git a/vendor/github.com/fnproject/fn_go/provider/oracle/shim/fns.go b/vendor/github.com/fnproject/fn_go/provider/oracle/shim/fns.go index 850475ec4..1df2ef173 100644 --- a/vendor/github.com/fnproject/fn_go/provider/oracle/shim/fns.go +++ b/vendor/github.com/fnproject/fn_go/provider/oracle/shim/fns.go @@ -2,6 +2,8 @@ package shim import ( "fmt" + "strconv" + "strings" "github.com/fnproject/fn_go/clientv2/fns" "github.com/fnproject/fn_go/modelsv2" "github.com/fnproject/fn_go/provider/oracle/shim/client" @@ -15,6 +17,11 @@ const ( annotationImageDigest = "oracle.com/oci/imageDigest" annotationInvokeEndpoint = "fnproject.io/fn/invokeEndpoint" + annotationDetachedTimeoutSeconds = "oracle.com/oci/detachedModeTimeoutInSeconds" + annotationSuccessDestinationKind = "oracle.com/oci/successDestinationKind" + annotationSuccessDestinationOCID = "oracle.com/oci/successDestinationOcid" + annotationFailureDestinationKind = "oracle.com/oci/failureDestinationKind" + annotationFailureDestinationOCID = "oracle.com/oci/failureDestinationOcid" invokeEndpointFmtString = "%s/20181201/functions/%s/actions/invoke" ) @@ -49,6 +56,17 @@ func (s *fnsShim) CreateFn(params *fns.CreateFnParams) (*fns.CreateFnOK, error) Config: params.Body.Config, TimeoutInSeconds: parseTimeout(params.Body.Timeout), } + if detachedTimeoutSeconds, err := parseDetachedTimeoutAnnotation(params.Body.Annotations); err != nil { + return nil, err + } else if detachedTimeoutSeconds != nil { + details.DetachedModeTimeoutInSeconds = detachedTimeoutSeconds + } + if successDestination, failureDestination, err := parseDestinationAnnotations(params.Body.Annotations); err != nil { + return nil, err + } else { + details.SuccessDestination = successDestination + details.FailureDestination = failureDestination + } req := functions.CreateFunctionRequest{CreateFunctionDetails: details} @@ -186,6 +204,17 @@ func (s *fnsShim) UpdateFn(params *fns.UpdateFnParams) (*fns.UpdateFnOK, error) Config: params.Body.Config, TimeoutInSeconds: parseTimeout(params.Body.Timeout), } + if detachedTimeoutSeconds, err := parseDetachedTimeoutAnnotation(params.Body.Annotations); err != nil { + return nil, err + } else if detachedTimeoutSeconds != nil { + details.DetachedModeTimeoutInSeconds = detachedTimeoutSeconds + } + if successDestination, failureDestination, err := parseDestinationAnnotations(params.Body.Annotations); err != nil { + return nil, err + } else { + details.SuccessDestination = successDestination + details.FailureDestination = failureDestination + } req := functions.UpdateFunctionRequest{ FunctionId: ¶ms.FnID, @@ -237,6 +266,114 @@ func parseDigestAnnotation(annotations map[string]interface{}) (*string, error) return &digest, nil } +func parseDetachedTimeoutAnnotation(annotations map[string]interface{}) (*int, error) { + if annotations == nil || len(annotations) == 0 { + return nil, nil + } + raw, ok := annotations[annotationDetachedTimeoutSeconds] + if !ok { + return nil, nil + } + switch typed := raw.(type) { + case int: + return &typed, nil + case int32: + v := int(typed) + return &v, nil + case int64: + v := int(typed) + return &v, nil + case float64: + v := int(typed) + return &v, nil + case string: + v, err := strconv.Atoi(typed) + if err != nil { + return nil, fmt.Errorf("invalid detached timeout annotation") + } + return &v, nil + default: + return nil, fmt.Errorf("invalid detached timeout annotation") + } +} + +func parseDestinationAnnotations(annotations map[string]interface{}) (functions.SuccessDestinationDetails, functions.FailureDestinationDetails, error) { + var success functions.SuccessDestinationDetails + var failure functions.FailureDestinationDetails + if annotations == nil || len(annotations) == 0 { + return nil, nil, nil + } + if kindRaw, ok := annotations[annotationSuccessDestinationKind]; ok { + kind, ok := kindRaw.(string) + if !ok { + return nil, nil, fmt.Errorf("invalid success destination kind") + } + ocidRaw, ok := annotations[annotationSuccessDestinationOCID] + if !ok { + return nil, nil, fmt.Errorf("invalid success destination ocid") + } + ocid, ok := ocidRaw.(string) + if !ok { + return nil, nil, fmt.Errorf("invalid success destination ocid") + } + s, err := parseSuccessDestination(strings.ToUpper(strings.TrimSpace(kind)), ocid) + if err != nil { + return nil, nil, err + } + success = s + } + if kindRaw, ok := annotations[annotationFailureDestinationKind]; ok { + kind, ok := kindRaw.(string) + if !ok { + return nil, nil, fmt.Errorf("invalid failure destination kind") + } + ocidRaw, ok := annotations[annotationFailureDestinationOCID] + if !ok { + return nil, nil, fmt.Errorf("invalid failure destination ocid") + } + ocid, ok := ocidRaw.(string) + if !ok { + return nil, nil, fmt.Errorf("invalid failure destination ocid") + } + f, err := parseFailureDestination(strings.ToUpper(strings.TrimSpace(kind)), ocid) + if err != nil { + return nil, nil, err + } + failure = f + } + return success, failure, nil +} + +func parseSuccessDestination(kind, ocid string) (functions.SuccessDestinationDetails, error) { + switch kind { + case "STREAM": + return functions.StreamSuccessDestinationDetails{StreamId: &ocid}, nil + case "QUEUE": + return functions.QueueSuccessDestinationDetails{QueueId: &ocid}, nil + case "NOTIFICATIONS", "NOTIFICATION": + return functions.NotificationSuccessDestinationDetails{TopicId: &ocid}, nil + case "NONE": + return functions.NoneSuccessDestinationDetails{}, nil + default: + return nil, fmt.Errorf("invalid success destination kind %q", kind) + } +} + +func parseFailureDestination(kind, ocid string) (functions.FailureDestinationDetails, error) { + switch kind { + case "STREAM": + return functions.StreamFailureDestinationDetails{StreamId: &ocid}, nil + case "QUEUE": + return functions.QueueFailureDestinationDetails{QueueId: &ocid}, nil + case "NOTIFICATIONS", "NOTIFICATION": + return functions.NotificationFailureDestinationDetails{TopicId: &ocid}, nil + case "NONE": + return functions.NoneFailureDestinationDetails{}, nil + default: + return nil, fmt.Errorf("invalid failure destination kind %q", kind) + } +} + func ociFnToV2(ociFn functions.Function) *modelsv2.Fn { annotations := make(map[string]interface{}) invokeEndpoint := fmt.Sprintf(invokeEndpointFmtString, *ociFn.InvokeEndpoint, *ociFn.Id) @@ -255,6 +392,10 @@ func ociFnToV2(ociFn functions.Function) *modelsv2.Fn { annotations[annotationImageDigest] = imageDigest annotations[annotationInvokeEndpoint] = invokeEndpoint + if ociFn.DetachedModeTimeoutInSeconds != nil { + annotations[annotationDetachedTimeoutSeconds] = *ociFn.DetachedModeTimeoutInSeconds + } + addDestinationAnnotations(annotations, ociFn.SuccessDestination, ociFn.FailureDestination) var timeoutPtr *int32 if ociFn.TimeoutInSeconds != nil { @@ -295,6 +436,10 @@ func ociFnSummaryToV2(ociFnSummary functions.FunctionSummary) *modelsv2.Fn { annotations[annotationImageDigest] = imageDigest annotations[annotationInvokeEndpoint] = invokeEndpoint + if ociFnSummary.DetachedModeTimeoutInSeconds != nil { + annotations[annotationDetachedTimeoutSeconds] = *ociFnSummary.DetachedModeTimeoutInSeconds + } + addDestinationAnnotations(annotations, ociFnSummary.SuccessDestination, ociFnSummary.FailureDestination) var timeoutPtr *int32 if ociFnSummary.TimeoutInSeconds != nil { @@ -315,3 +460,47 @@ func ociFnSummaryToV2(ociFnSummary functions.FunctionSummary) *modelsv2.Fn { UpdatedAt: strfmt.DateTime(ociFnSummary.TimeUpdated.Time), } } + +func addDestinationAnnotations(annotations map[string]interface{}, success functions.SuccessDestinationDetails, failure functions.FailureDestinationDetails) { + if annotations == nil { + return + } + if success != nil { + switch typed := success.(type) { + case functions.StreamSuccessDestinationDetails: + annotations[annotationSuccessDestinationKind] = "STREAM" + if typed.StreamId != nil { + annotations[annotationSuccessDestinationOCID] = *typed.StreamId + } + case functions.QueueSuccessDestinationDetails: + annotations[annotationSuccessDestinationKind] = "QUEUE" + if typed.QueueId != nil { + annotations[annotationSuccessDestinationOCID] = *typed.QueueId + } + case functions.NotificationSuccessDestinationDetails: + annotations[annotationSuccessDestinationKind] = "NOTIFICATIONS" + if typed.TopicId != nil { + annotations[annotationSuccessDestinationOCID] = *typed.TopicId + } + } + } + if failure != nil { + switch typed := failure.(type) { + case functions.StreamFailureDestinationDetails: + annotations[annotationFailureDestinationKind] = "STREAM" + if typed.StreamId != nil { + annotations[annotationFailureDestinationOCID] = *typed.StreamId + } + case functions.QueueFailureDestinationDetails: + annotations[annotationFailureDestinationKind] = "QUEUE" + if typed.QueueId != nil { + annotations[annotationFailureDestinationOCID] = *typed.QueueId + } + case functions.NotificationFailureDestinationDetails: + annotations[annotationFailureDestinationKind] = "NOTIFICATIONS" + if typed.TopicId != nil { + annotations[annotationFailureDestinationOCID] = *typed.TopicId + } + } + } +} diff --git a/vendor/github.com/gofrs/flock/.golangci.yml b/vendor/github.com/gofrs/flock/.golangci.yml new file mode 100644 index 000000000..3ad88a38f --- /dev/null +++ b/vendor/github.com/gofrs/flock/.golangci.yml @@ -0,0 +1,114 @@ +run: + timeout: 10m + +linters: + enable: + - asasalint + - bidichk + - dogsled + - dupword + - durationcheck + - err113 + - errname + - errorlint + - fatcontext + - forbidigo + - gocheckcompilerdirectives + - gochecknoinits + - gocritic + - godot + - godox + - gofumpt + - goheader + - goimports + - gomoddirectives + - goprintffuncname + - gosec + - inamedparam + - interfacebloat + - ireturn + - mirror + - misspell + - nolintlint + - revive + - stylecheck + - tenv + - testifylint + - thelper + - unconvert + - unparam + - usestdlibvars + - whitespace + +linters-settings: + misspell: + locale: US + godox: + keywords: + - FIXME + goheader: + template: |- + Copyright 2015 Tim Heckman. All rights reserved. + Copyright 2018-{{ YEAR }} The Gofrs. All rights reserved. + Use of this source code is governed by the BSD 3-Clause + license that can be found in the LICENSE file. + gofumpt: + extra-rules: true + gocritic: + enabled-tags: + - diagnostic + - style + - performance + disabled-checks: + - paramTypeCombine # already handle by gofumpt.extra-rules + - whyNoLint # already handle by nonolint + - unnamedResult + - hugeParam + - sloppyReassign + - rangeValCopy + - octalLiteral + - ptrToRefParam + - appendAssign + - ruleguard + - httpNoBody + - exposedSyncMutex + + revive: + rules: + - name: struct-tag + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: unused-parameter + - name: unreachable-code + - name: redefines-builtin-id + +issues: + exclude-use-default: true + max-issues-per-linter: 0 + max-same-issues: 0 + +output: + show-stats: true + sort-results: true + sort-order: + - linter + - file diff --git a/vendor/github.com/gofrs/flock/.travis.yml b/vendor/github.com/gofrs/flock/.travis.yml deleted file mode 100644 index b16d040fa..000000000 --- a/vendor/github.com/gofrs/flock/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.14.x - - 1.15.x -script: go test -v -check.vv -race ./... -sudo: false -notifications: - email: - on_success: never - on_failure: always diff --git a/vendor/github.com/gofrs/flock/LICENSE b/vendor/github.com/gofrs/flock/LICENSE index 8b8ff36fe..7de525bf0 100644 --- a/vendor/github.com/gofrs/flock/LICENSE +++ b/vendor/github.com/gofrs/flock/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2018-2024, The Gofrs Copyright (c) 2015-2020, Tim Heckman All rights reserved. diff --git a/vendor/github.com/gofrs/flock/Makefile b/vendor/github.com/gofrs/flock/Makefile new file mode 100644 index 000000000..65c139d68 --- /dev/null +++ b/vendor/github.com/gofrs/flock/Makefile @@ -0,0 +1,15 @@ +.PHONY: lint test test_race build_cross_os + +default: lint test build_cross_os + +test: + go test -v -cover ./... + +test_race: + CGO_ENABLED=1 go test -v -race ./... + +lint: + golangci-lint run + +build_cross_os: + ./build.sh diff --git a/vendor/github.com/gofrs/flock/README.md b/vendor/github.com/gofrs/flock/README.md index 71ce63692..a3479dba5 100644 --- a/vendor/github.com/gofrs/flock/README.md +++ b/vendor/github.com/gofrs/flock/README.md @@ -1,26 +1,22 @@ # flock -[![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock) -[![GoDoc](https://img.shields.io/badge/godoc-flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock) + +[![Go Reference](https://pkg.go.dev/badge/github.com/gofrs/flock.svg)](https://pkg.go.dev/github.com/gofrs/flock) [![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/flock)](https://goreportcard.com/report/github.com/gofrs/flock) -`flock` implements a thread-safe sync.Locker interface for file locking. It also -includes a non-blocking TryLock() function to allow locking without blocking execution. - -## License -`flock` is released under the BSD 3-Clause License. See the `LICENSE` file for more details. +`flock` implements a thread-safe file lock. -## Go Compatibility -This package makes use of the `context` package that was introduced in Go 1.7. As such, this -package has an implicit dependency on Go 1.7+. +It also includes a non-blocking `TryLock()` function to allow locking without blocking execution. ## Installation -``` + +```bash go get -u github.com/gofrs/flock ``` ## Usage -```Go + +```go import "github.com/gofrs/flock" fileLock := flock.New("/var/lock/go-lock.lock") @@ -38,4 +34,12 @@ if locked { ``` For more detailed usage information take a look at the package API docs on -[GoDoc](https://godoc.org/github.com/gofrs/flock). +[GoDoc](https://pkg.go.dev/github.com/gofrs/flock). + +## License + +`flock` is released under the BSD 3-Clause License. See the [`LICENSE`](./LICENSE) file for more details. + +## Project History + +This project was originally `github.com/theckman/go-flock`, it was transferred to Gofrs by the original author [Tim Heckman ](https://github.com/theckman). diff --git a/vendor/github.com/gofrs/flock/SECURITY.md b/vendor/github.com/gofrs/flock/SECURITY.md new file mode 100644 index 000000000..01419bd59 --- /dev/null +++ b/vendor/github.com/gofrs/flock/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +We support the latest version of this library. +We do not guarantee support of previous versions. + +If a defect is reported, it will generally be fixed on the latest version (provided it exists) irrespective of whether it was introduced in a prior version. + +## Reporting a Vulnerability + +To report a potential security vulnerability, please create a [security advisory](https://github.com/gofrs/flock/security/advisories/new). + +For us to respond to your report most effectively, please include any of the following: + +- Steps to reproduce or a proof-of-concept +- Any relevant information, including the versions used + +## Security Scorecard + +This project submits security [results](https://scorecard.dev/viewer/?uri=github.com/gofrs/flock) to the [OpenSSF Scorecard](https://securityscorecards.dev/). diff --git a/vendor/github.com/gofrs/flock/appveyor.yml b/vendor/github.com/gofrs/flock/appveyor.yml deleted file mode 100644 index 909b4bf7c..000000000 --- a/vendor/github.com/gofrs/flock/appveyor.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '{build}' - -build: false -deploy: false - -clone_folder: 'c:\gopath\src\github.com\gofrs\flock' - -environment: - GOPATH: 'c:\gopath' - GOVERSION: '1.15' - -init: - - git config --global core.autocrlf input - -install: - - rmdir c:\go /s /q - - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi - - msiexec /i go%GOVERSION%.windows-amd64.msi /q - - set Path=c:\go\bin;c:\gopath\bin;%Path% - - go version - - go env - -test_script: - - go get -t ./... - - go test -race -v ./... diff --git a/vendor/github.com/gofrs/flock/build.sh b/vendor/github.com/gofrs/flock/build.sh new file mode 100644 index 000000000..34d3a9c90 --- /dev/null +++ b/vendor/github.com/gofrs/flock/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e + +# Not supported by flock: +# - plan9/* +# - js/wasm +# - wasp1/wasm + +for row in $(go tool dist list -json | jq -r '.[] | select( .GOOS != "plan9" and .GOARCH != "wasm") | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + + GOOS=$(_jq '.GOOS') + GOARCH=$(_jq '.GOARCH') + + echo "$GOOS/$GOARCH" + GOOS=$GOOS GOARCH=$GOARCH go build +done diff --git a/vendor/github.com/gofrs/flock/flock.go b/vendor/github.com/gofrs/flock/flock.go index 95c784ca5..97ba857c6 100644 --- a/vendor/github.com/gofrs/flock/flock.go +++ b/vendor/github.com/gofrs/flock/flock.go @@ -1,4 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. +// Copyright 2018-2024 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. @@ -118,14 +119,15 @@ func (f *Flock) setFh() error { // open a new os.File instance // create it if it doesn't exist, and open the file read-only. flags := os.O_CREATE - if runtime.GOOS == "aix" { + if runtime.GOOS == "aix" || runtime.GOOS == "solaris" || runtime.GOOS == "illumos" { // AIX cannot preform write-lock (ie exclusive) on a // read-only file. flags |= os.O_RDWR } else { flags |= os.O_RDONLY } - fh, err := os.OpenFile(f.path, flags, os.FileMode(0600)) + + fh, err := os.OpenFile(f.path, flags, os.FileMode(0o600)) if err != nil { return err } @@ -135,7 +137,7 @@ func (f *Flock) setFh() error { return nil } -// ensure the file handle is closed if no lock is held +// ensure the file handle is closed if no lock is held. func (f *Flock) ensureFhState() { if !f.l && !f.r && f.fh != nil { f.fh.Close() diff --git a/vendor/github.com/gofrs/flock/flock_unix.go b/vendor/github.com/gofrs/flock/flock_unix.go index c315a3e29..4fde9f039 100644 --- a/vendor/github.com/gofrs/flock/flock_unix.go +++ b/vendor/github.com/gofrs/flock/flock_unix.go @@ -1,12 +1,14 @@ // Copyright 2015 Tim Heckman. All rights reserved. +// Copyright 2018-2024 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. -// +build !aix,!windows +//go:build !aix && !solaris && !windows package flock import ( + "errors" "os" "syscall" ) @@ -157,6 +159,7 @@ retry: *locked = true return true, nil } + if !retried { if shouldRetry, reopenErr := f.reopenFDOnError(err); reopenErr != nil { return false, reopenErr @@ -171,24 +174,26 @@ retry: // reopenFDOnError determines whether we should reopen the file handle // in readwrite mode and try again. This comes from util-linux/sys-utils/flock.c: -// Since Linux 3.4 (commit 55725513) -// Probably NFSv4 where flock() is emulated by fcntl(). +// +// Since Linux 3.4 (commit 55725513) +// Probably NFSv4 where flock() is emulated by fcntl(). func (f *Flock) reopenFDOnError(err error) (bool, error) { - if err != syscall.EIO && err != syscall.EBADF { + if !errors.Is(err, syscall.EIO) && !errors.Is(err, syscall.EBADF) { return false, nil } if st, err := f.fh.Stat(); err == nil { // if the file is able to be read and written - if st.Mode()&0600 == 0600 { + if st.Mode()&0o600 == 0o600 { f.fh.Close() f.fh = nil // reopen in read-write mode and set the filehandle - fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDWR, os.FileMode(0600)) + fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDWR, os.FileMode(0o600)) if err != nil { return false, err } f.fh = fh + return true, nil } } diff --git a/vendor/github.com/gofrs/flock/flock_aix.go b/vendor/github.com/gofrs/flock/flock_unix_variants.go similarity index 96% rename from vendor/github.com/gofrs/flock/flock_aix.go rename to vendor/github.com/gofrs/flock/flock_unix_variants.go index 7277c1b6b..e485e16a1 100644 --- a/vendor/github.com/gofrs/flock/flock_aix.go +++ b/vendor/github.com/gofrs/flock/flock_unix_variants.go @@ -1,5 +1,7 @@ -// Copyright 2019 Tim Heckman. All rights reserved. Use of this source code is -// governed by the BSD 3-Clause license that can be found in the LICENSE file. +// Copyright 2015 Tim Heckman. All rights reserved. +// Copyright 2018-2024 The Gofrs. All rights reserved. +// Use of this source code is governed by the BSD 3-Clause +// license that can be found in the LICENSE file. // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -13,7 +15,7 @@ // This code is adapted from the Go package: // cmd/go/internal/lockedfile/internal/filelock -//+build aix +//go:build aix || solaris package flock @@ -151,7 +153,6 @@ func (f *Flock) doLock(cmd cmdType, lt lockType, blocking bool) (bool, error) { } err = setlkw(f.fh.Fd(), cmd, lt) - if err != nil { f.doUnlock() if cmd == tryLock && err == unix.EACCES { diff --git a/vendor/github.com/gofrs/flock/flock_winapi.go b/vendor/github.com/gofrs/flock/flock_winapi.go index fe405a255..9e4df34b2 100644 --- a/vendor/github.com/gofrs/flock/flock_winapi.go +++ b/vendor/github.com/gofrs/flock/flock_winapi.go @@ -1,8 +1,9 @@ // Copyright 2015 Tim Heckman. All rights reserved. +// Copyright 2018-2024 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. -// +build windows +//go:build windows package flock @@ -31,10 +32,10 @@ const ( // // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx -func lockFileEx(handle syscall.Handle, flags uint32, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { - r1, _, errNo := syscall.Syscall6( - uintptr(procLockFileEx), - 6, +//nolint:unparam +func lockFileEx(handle syscall.Handle, flags, reserved, numberOfBytesToLockLow, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { + r1, _, errNo := syscall.SyscallN( + procLockFileEx, uintptr(handle), uintptr(flags), uintptr(reserved), @@ -53,16 +54,14 @@ func lockFileEx(handle syscall.Handle, flags uint32, reserved uint32, numberOfBy return true, 0 } -func unlockFileEx(handle syscall.Handle, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { - r1, _, errNo := syscall.Syscall6( - uintptr(procUnlockFileEx), - 5, +func unlockFileEx(handle syscall.Handle, reserved, numberOfBytesToLockLow, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { + r1, _, errNo := syscall.SyscallN( + procUnlockFileEx, uintptr(handle), uintptr(reserved), uintptr(numberOfBytesToLockLow), uintptr(numberOfBytesToLockHigh), - uintptr(unsafe.Pointer(offset)), - 0) + uintptr(unsafe.Pointer(offset))) if r1 != 1 { if errNo == 0 { diff --git a/vendor/github.com/gofrs/flock/flock_windows.go b/vendor/github.com/gofrs/flock/flock_windows.go index ddb534cce..1f0c96841 100644 --- a/vendor/github.com/gofrs/flock/flock_windows.go +++ b/vendor/github.com/gofrs/flock/flock_windows.go @@ -1,4 +1,5 @@ // Copyright 2015 Tim Heckman. All rights reserved. +// Copyright 2018-2024 The Gofrs. All rights reserved. // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. @@ -9,7 +10,7 @@ import ( ) // ErrorLockViolation is the error code returned from the Windows syscall when a -// lock would block and you ask to fail immediately. +// lock would block, and you ask to fail immediately. const ErrorLockViolation syscall.Errno = 0x21 // 33 // Lock is a blocking call to try and take an exclusive file lock. It will wait @@ -49,7 +50,8 @@ func (f *Flock) lock(locked *bool, flag uint32) error { defer f.ensureFhState() } - if _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { + _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}) + if errNo > 0 { return errNo } @@ -74,7 +76,8 @@ func (f *Flock) Unlock() error { } // mark the file as unlocked - if _, errNo := unlockFileEx(syscall.Handle(f.fh.Fd()), 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { + _, errNo := unlockFileEx(syscall.Handle(f.fh.Fd()), 0, 1, 0, &syscall.Overlapped{}) + if errNo > 0 { return errNo } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/LICENSE.txt b/vendor/github.com/oracle/oci-go-sdk/v65/LICENSE.txt index a8c318374..fcc68fc59 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/LICENSE.txt +++ b/vendor/github.com/oracle/oci-go-sdk/v65/LICENSE.txt @@ -1,8 +1,8 @@ -Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.  ____________________________ -Copyright (c) 2016, 2023 Oracle and/or its affiliates. +Copyright (c) 2016, 2026 Oracle and/or its affiliates. The Universal Permissive License (UPL), Version 1.0 @@ -39,7 +39,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The Apache Software License, Version 2.0 -Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/NOTICE.txt b/vendor/github.com/oracle/oci-go-sdk/v65/NOTICE.txt index 55a68d59c..42d987bdd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/NOTICE.txt +++ b/vendor/github.com/oracle/oci-go-sdk/v65/NOTICE.txt @@ -1 +1 @@ -Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. \ No newline at end of file +Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. \ No newline at end of file diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/artifacts_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/artifacts_client.go index 15946f7b7..266be2777 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/artifacts_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/artifacts_client.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -27,6 +30,9 @@ type ArtifactsClient struct { // NewArtifactsClientWithConfigurationProvider Creates a new default Artifacts client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewArtifactsClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ArtifactsClient, err error) { + if enabled := common.CheckForEnabledServices("artifacts"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -78,7 +84,7 @@ func (client *ArtifactsClient) setConfigurationProvider(configProvider common.Co region, _ := configProvider.Region() client.SetRegion(region) if client.Host == "" { - return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") } client.config = &configProvider return nil @@ -91,14 +97,15 @@ func (client *ArtifactsClient) ConfigurationProvider() *common.ConfigurationProv // ChangeContainerRepositoryCompartment Moves a container repository into a different compartment within the same tenancy. For information about moving // resources between compartments, see -// Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeContainerRepositoryCompartment.go.html to see an example of how to use ChangeContainerRepositoryCompartment API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeContainerRepositoryCompartment.go.html to see an example of how to use ChangeContainerRepositoryCompartment API. +// A default retry strategy applies to this operation ChangeContainerRepositoryCompartment() func (client ArtifactsClient) ChangeContainerRepositoryCompartment(ctx context.Context, request ChangeContainerRepositoryCompartmentRequest) (response ChangeContainerRepositoryCompartmentResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -140,7 +147,7 @@ func (client ArtifactsClient) changeContainerRepositoryCompartment(ctx context.C var response ChangeContainerRepositoryCompartmentResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ChangeContainerRepositoryCompartment") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -155,14 +162,15 @@ func (client ArtifactsClient) changeContainerRepositoryCompartment(ctx context.C // ChangeRepositoryCompartment Moves a repository into a different compartment within the same tenancy. For information about moving // resources between compartments, see -// Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeRepositoryCompartment.go.html to see an example of how to use ChangeRepositoryCompartment API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeRepositoryCompartment.go.html to see an example of how to use ChangeRepositoryCompartment API. +// A default retry strategy applies to this operation ChangeRepositoryCompartment() func (client ArtifactsClient) ChangeRepositoryCompartment(ctx context.Context, request ChangeRepositoryCompartmentRequest) (response ChangeRepositoryCompartmentResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -204,7 +212,7 @@ func (client ArtifactsClient) changeRepositoryCompartment(ctx context.Context, r var response ChangeRepositoryCompartmentResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ChangeRepositoryCompartment") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -219,12 +227,13 @@ func (client ArtifactsClient) changeRepositoryCompartment(ctx context.Context, r // CreateContainerImageSignature Upload a signature to an image. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerImageSignature.go.html to see an example of how to use CreateContainerImageSignature API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerImageSignature.go.html to see an example of how to use CreateContainerImageSignature API. +// A default retry strategy applies to this operation CreateContainerImageSignature() func (client ArtifactsClient) CreateContainerImageSignature(ctx context.Context, request CreateContainerImageSignatureRequest) (response CreateContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -266,7 +275,7 @@ func (client ArtifactsClient) createContainerImageSignature(ctx context.Context, var response CreateContainerImageSignatureResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "CreateContainerImageSignature") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -281,12 +290,13 @@ func (client ArtifactsClient) createContainerImageSignature(ctx context.Context, // CreateContainerRepository Create a new empty container repository. Avoid entering confidential information. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerRepository.go.html to see an example of how to use CreateContainerRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerRepository.go.html to see an example of how to use CreateContainerRepository API. +// A default retry strategy applies to this operation CreateContainerRepository() func (client ArtifactsClient) CreateContainerRepository(ctx context.Context, request CreateContainerRepositoryRequest) (response CreateContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -328,7 +338,7 @@ func (client ArtifactsClient) createContainerRepository(ctx context.Context, req var response CreateContainerRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "CreateContainerRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -343,9 +353,9 @@ func (client ArtifactsClient) createContainerRepository(ctx context.Context, req // CreateRepository Creates a new repository for storing artifacts. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateRepository.go.html to see an example of how to use CreateRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateRepository.go.html to see an example of how to use CreateRepository API. func (client ArtifactsClient) CreateRepository(ctx context.Context, request CreateRepositoryRequest) (response CreateRepositoryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -390,7 +400,7 @@ func (client ArtifactsClient) createRepository(ctx context.Context, request comm var response CreateRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "CreateRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -405,12 +415,13 @@ func (client ArtifactsClient) createRepository(ctx context.Context, request comm // DeleteContainerImage Delete a container image. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImage.go.html to see an example of how to use DeleteContainerImage API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImage.go.html to see an example of how to use DeleteContainerImage API. +// A default retry strategy applies to this operation DeleteContainerImage() func (client ArtifactsClient) DeleteContainerImage(ctx context.Context, request DeleteContainerImageRequest) (response DeleteContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -447,7 +458,7 @@ func (client ArtifactsClient) deleteContainerImage(ctx context.Context, request var response DeleteContainerImageResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteContainerImage") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -462,12 +473,13 @@ func (client ArtifactsClient) deleteContainerImage(ctx context.Context, request // DeleteContainerImageSignature Delete a container image signature. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImageSignature.go.html to see an example of how to use DeleteContainerImageSignature API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImageSignature.go.html to see an example of how to use DeleteContainerImageSignature API. +// A default retry strategy applies to this operation DeleteContainerImageSignature() func (client ArtifactsClient) DeleteContainerImageSignature(ctx context.Context, request DeleteContainerImageSignatureRequest) (response DeleteContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -504,7 +516,7 @@ func (client ArtifactsClient) deleteContainerImageSignature(ctx context.Context, var response DeleteContainerImageSignatureResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteContainerImageSignature") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -519,12 +531,13 @@ func (client ArtifactsClient) deleteContainerImageSignature(ctx context.Context, // DeleteContainerRepository Delete container repository. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerRepository.go.html to see an example of how to use DeleteContainerRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerRepository.go.html to see an example of how to use DeleteContainerRepository API. +// A default retry strategy applies to this operation DeleteContainerRepository() func (client ArtifactsClient) DeleteContainerRepository(ctx context.Context, request DeleteContainerRepositoryRequest) (response DeleteContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -561,7 +574,7 @@ func (client ArtifactsClient) deleteContainerRepository(ctx context.Context, req var response DeleteContainerRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteContainerRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -574,14 +587,15 @@ func (client ArtifactsClient) deleteContainerRepository(ctx context.Context, req return response, err } -// DeleteGenericArtifact Deletes an artifact with a specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// DeleteGenericArtifact Deletes an artifact with a specified OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifact.go.html to see an example of how to use DeleteGenericArtifact API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifact.go.html to see an example of how to use DeleteGenericArtifact API. +// A default retry strategy applies to this operation DeleteGenericArtifact() func (client ArtifactsClient) DeleteGenericArtifact(ctx context.Context, request DeleteGenericArtifactRequest) (response DeleteGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -618,7 +632,7 @@ func (client ArtifactsClient) deleteGenericArtifact(ctx context.Context, request var response DeleteGenericArtifactResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteGenericArtifact") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -633,12 +647,13 @@ func (client ArtifactsClient) deleteGenericArtifact(ctx context.Context, request // DeleteGenericArtifactByPath Deletes an artifact with a specified `artifactPath` and `version`. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifactByPath.go.html to see an example of how to use DeleteGenericArtifactByPath API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifactByPath.go.html to see an example of how to use DeleteGenericArtifactByPath API. +// A default retry strategy applies to this operation DeleteGenericArtifactByPath() func (client ArtifactsClient) DeleteGenericArtifactByPath(ctx context.Context, request DeleteGenericArtifactByPathRequest) (response DeleteGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -675,7 +690,7 @@ func (client ArtifactsClient) deleteGenericArtifactByPath(ctx context.Context, r var response DeleteGenericArtifactByPathResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteGenericArtifactByPath") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -690,12 +705,13 @@ func (client ArtifactsClient) deleteGenericArtifactByPath(ctx context.Context, r // DeleteRepository Deletes the specified repository. This operation fails unless all associated artifacts are in a DELETED state. You must delete all associated artifacts before deleting a repository. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteRepository.go.html to see an example of how to use DeleteRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteRepository.go.html to see an example of how to use DeleteRepository API. +// A default retry strategy applies to this operation DeleteRepository() func (client ArtifactsClient) DeleteRepository(ctx context.Context, request DeleteRepositoryRequest) (response DeleteRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -732,7 +748,7 @@ func (client ArtifactsClient) deleteRepository(ctx context.Context, request comm var response DeleteRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "DeleteRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -747,12 +763,13 @@ func (client ArtifactsClient) deleteRepository(ctx context.Context, request comm // GetContainerConfiguration Get container configuration. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerConfiguration.go.html to see an example of how to use GetContainerConfiguration API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerConfiguration.go.html to see an example of how to use GetContainerConfiguration API. +// A default retry strategy applies to this operation GetContainerConfiguration() func (client ArtifactsClient) GetContainerConfiguration(ctx context.Context, request GetContainerConfigurationRequest) (response GetContainerConfigurationResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -789,7 +806,7 @@ func (client ArtifactsClient) getContainerConfiguration(ctx context.Context, req var response GetContainerConfigurationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetContainerConfiguration") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -804,12 +821,13 @@ func (client ArtifactsClient) getContainerConfiguration(ctx context.Context, req // GetContainerImage Get container image metadata. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImage.go.html to see an example of how to use GetContainerImage API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImage.go.html to see an example of how to use GetContainerImage API. +// A default retry strategy applies to this operation GetContainerImage() func (client ArtifactsClient) GetContainerImage(ctx context.Context, request GetContainerImageRequest) (response GetContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -846,7 +864,7 @@ func (client ArtifactsClient) getContainerImage(ctx context.Context, request com var response GetContainerImageResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetContainerImage") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -861,12 +879,13 @@ func (client ArtifactsClient) getContainerImage(ctx context.Context, request com // GetContainerImageSignature Get container image signature metadata. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImageSignature.go.html to see an example of how to use GetContainerImageSignature API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImageSignature.go.html to see an example of how to use GetContainerImageSignature API. +// A default retry strategy applies to this operation GetContainerImageSignature() func (client ArtifactsClient) GetContainerImageSignature(ctx context.Context, request GetContainerImageSignatureRequest) (response GetContainerImageSignatureResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -903,7 +922,7 @@ func (client ArtifactsClient) getContainerImageSignature(ctx context.Context, re var response GetContainerImageSignatureResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetContainerImageSignature") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -918,12 +937,13 @@ func (client ArtifactsClient) getContainerImageSignature(ctx context.Context, re // GetContainerRepository Get container repository. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerRepository.go.html to see an example of how to use GetContainerRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerRepository.go.html to see an example of how to use GetContainerRepository API. +// A default retry strategy applies to this operation GetContainerRepository() func (client ArtifactsClient) GetContainerRepository(ctx context.Context, request GetContainerRepositoryRequest) (response GetContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -960,7 +980,7 @@ func (client ArtifactsClient) getContainerRepository(ctx context.Context, reques var response GetContainerRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetContainerRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -973,14 +993,15 @@ func (client ArtifactsClient) getContainerRepository(ctx context.Context, reques return response, err } -// GetGenericArtifact Gets information about an artifact with a specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// GetGenericArtifact Gets information about an artifact with a specified OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifact.go.html to see an example of how to use GetGenericArtifact API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifact.go.html to see an example of how to use GetGenericArtifact API. +// A default retry strategy applies to this operation GetGenericArtifact() func (client ArtifactsClient) GetGenericArtifact(ctx context.Context, request GetGenericArtifactRequest) (response GetGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1017,7 +1038,7 @@ func (client ArtifactsClient) getGenericArtifact(ctx context.Context, request co var response GetGenericArtifactResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetGenericArtifact") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1032,12 +1053,13 @@ func (client ArtifactsClient) getGenericArtifact(ctx context.Context, request co // GetGenericArtifactByPath Gets information about an artifact with a specified `artifactPath` and `version`. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifactByPath.go.html to see an example of how to use GetGenericArtifactByPath API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifactByPath.go.html to see an example of how to use GetGenericArtifactByPath API. +// A default retry strategy applies to this operation GetGenericArtifactByPath() func (client ArtifactsClient) GetGenericArtifactByPath(ctx context.Context, request GetGenericArtifactByPathRequest) (response GetGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1074,7 +1096,7 @@ func (client ArtifactsClient) getGenericArtifactByPath(ctx context.Context, requ var response GetGenericArtifactByPathResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetGenericArtifactByPath") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1089,12 +1111,13 @@ func (client ArtifactsClient) getGenericArtifactByPath(ctx context.Context, requ // GetRepository Gets the specified repository's information. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetRepository.go.html to see an example of how to use GetRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetRepository.go.html to see an example of how to use GetRepository API. +// A default retry strategy applies to this operation GetRepository() func (client ArtifactsClient) GetRepository(ctx context.Context, request GetRepositoryRequest) (response GetRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1131,7 +1154,7 @@ func (client ArtifactsClient) getRepository(ctx context.Context, request common. var response GetRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "GetRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1146,12 +1169,13 @@ func (client ArtifactsClient) getRepository(ctx context.Context, request common. // ListContainerImageSignatures List container image signatures in an image. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImageSignatures.go.html to see an example of how to use ListContainerImageSignatures API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImageSignatures.go.html to see an example of how to use ListContainerImageSignatures API. +// A default retry strategy applies to this operation ListContainerImageSignatures() func (client ArtifactsClient) ListContainerImageSignatures(ctx context.Context, request ListContainerImageSignaturesRequest) (response ListContainerImageSignaturesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1188,7 +1212,7 @@ func (client ArtifactsClient) listContainerImageSignatures(ctx context.Context, var response ListContainerImageSignaturesResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ListContainerImageSignatures") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1203,12 +1227,13 @@ func (client ArtifactsClient) listContainerImageSignatures(ctx context.Context, // ListContainerImages List container images in a compartment. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImages.go.html to see an example of how to use ListContainerImages API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImages.go.html to see an example of how to use ListContainerImages API. +// A default retry strategy applies to this operation ListContainerImages() func (client ArtifactsClient) ListContainerImages(ctx context.Context, request ListContainerImagesRequest) (response ListContainerImagesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1245,7 +1270,7 @@ func (client ArtifactsClient) listContainerImages(ctx context.Context, request c var response ListContainerImagesResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ListContainerImages") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1260,12 +1285,13 @@ func (client ArtifactsClient) listContainerImages(ctx context.Context, request c // ListContainerRepositories List container repositories in a compartment. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerRepositories.go.html to see an example of how to use ListContainerRepositories API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerRepositories.go.html to see an example of how to use ListContainerRepositories API. +// A default retry strategy applies to this operation ListContainerRepositories() func (client ArtifactsClient) ListContainerRepositories(ctx context.Context, request ListContainerRepositoriesRequest) (response ListContainerRepositoriesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1302,7 +1328,7 @@ func (client ArtifactsClient) listContainerRepositories(ctx context.Context, req var response ListContainerRepositoriesResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ListContainerRepositories") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1317,12 +1343,13 @@ func (client ArtifactsClient) listContainerRepositories(ctx context.Context, req // ListGenericArtifacts Lists artifacts in the specified repository. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListGenericArtifacts.go.html to see an example of how to use ListGenericArtifacts API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListGenericArtifacts.go.html to see an example of how to use ListGenericArtifacts API. +// A default retry strategy applies to this operation ListGenericArtifacts() func (client ArtifactsClient) ListGenericArtifacts(ctx context.Context, request ListGenericArtifactsRequest) (response ListGenericArtifactsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1359,7 +1386,7 @@ func (client ArtifactsClient) listGenericArtifacts(ctx context.Context, request var response ListGenericArtifactsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ListGenericArtifacts") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1374,12 +1401,13 @@ func (client ArtifactsClient) listGenericArtifacts(ctx context.Context, request // ListRepositories Lists repositories in the specified compartment. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListRepositories.go.html to see an example of how to use ListRepositories API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListRepositories.go.html to see an example of how to use ListRepositories API. +// A default retry strategy applies to this operation ListRepositories() func (client ArtifactsClient) ListRepositories(ctx context.Context, request ListRepositoriesRequest) (response ListRepositoriesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1416,7 +1444,7 @@ func (client ArtifactsClient) listRepositories(ctx context.Context, request comm var response ListRepositoriesResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "ListRepositories") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1429,14 +1457,73 @@ func (client ArtifactsClient) listRepositories(ctx context.Context, request comm return response, err } +// LookupContainerImageByUri Get container image metadata by URI. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/LookupContainerImageByUri.go.html to see an example of how to use LookupContainerImageByUri API. +// A default retry strategy applies to this operation LookupContainerImageByUri() +func (client ArtifactsClient) LookupContainerImageByUri(ctx context.Context, request LookupContainerImageByUriRequest) (response LookupContainerImageByUriResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.lookupContainerImageByUri, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = LookupContainerImageByUriResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = LookupContainerImageByUriResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(LookupContainerImageByUriResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LookupContainerImageByUriResponse") + } + return +} + +// lookupContainerImageByUri implements the OCIOperation interface (enables retrying operations) +func (client ArtifactsClient) lookupContainerImageByUri(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/container/images/actions/lookupImageByUri", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response LookupContainerImageByUriResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "LookupContainerImageByUri") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/registry/20160918/ContainerImage/LookupContainerImageByUri" + err = common.PostProcessServiceError(err, "Artifacts", "LookupContainerImageByUri", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RemoveContainerVersion Remove version from container image. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RemoveContainerVersion.go.html to see an example of how to use RemoveContainerVersion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RemoveContainerVersion.go.html to see an example of how to use RemoveContainerVersion API. +// A default retry strategy applies to this operation RemoveContainerVersion() func (client ArtifactsClient) RemoveContainerVersion(ctx context.Context, request RemoveContainerVersionRequest) (response RemoveContainerVersionResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1478,7 +1565,7 @@ func (client ArtifactsClient) removeContainerVersion(ctx context.Context, reques var response RemoveContainerVersionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "RemoveContainerVersion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1493,12 +1580,13 @@ func (client ArtifactsClient) removeContainerVersion(ctx context.Context, reques // RestoreContainerImage Restore a container image. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RestoreContainerImage.go.html to see an example of how to use RestoreContainerImage API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RestoreContainerImage.go.html to see an example of how to use RestoreContainerImage API. +// A default retry strategy applies to this operation RestoreContainerImage() func (client ArtifactsClient) RestoreContainerImage(ctx context.Context, request RestoreContainerImageRequest) (response RestoreContainerImageResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1540,7 +1628,7 @@ func (client ArtifactsClient) restoreContainerImage(ctx context.Context, request var response RestoreContainerImageResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "RestoreContainerImage") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1555,12 +1643,13 @@ func (client ArtifactsClient) restoreContainerImage(ctx context.Context, request // UpdateContainerConfiguration Update container configuration. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerConfiguration.go.html to see an example of how to use UpdateContainerConfiguration API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerConfiguration.go.html to see an example of how to use UpdateContainerConfiguration API. +// A default retry strategy applies to this operation UpdateContainerConfiguration() func (client ArtifactsClient) UpdateContainerConfiguration(ctx context.Context, request UpdateContainerConfigurationRequest) (response UpdateContainerConfigurationResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1597,7 +1686,7 @@ func (client ArtifactsClient) updateContainerConfiguration(ctx context.Context, var response UpdateContainerConfigurationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateContainerConfiguration") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1610,14 +1699,131 @@ func (client ArtifactsClient) updateContainerConfiguration(ctx context.Context, return response, err } +// UpdateContainerImage Modify the properties of a container image. Avoid entering confidential information. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImage.go.html to see an example of how to use UpdateContainerImage API. +// A default retry strategy applies to this operation UpdateContainerImage() +func (client ArtifactsClient) UpdateContainerImage(ctx context.Context, request UpdateContainerImageRequest) (response UpdateContainerImageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateContainerImage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerImageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerImageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerImageResponse") + } + return +} + +// updateContainerImage implements the OCIOperation interface (enables retrying operations) +func (client ArtifactsClient) updateContainerImage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/container/images/{imageId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerImageResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateContainerImage") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/registry/20160918/ContainerImage/UpdateContainerImage" + err = common.PostProcessServiceError(err, "Artifacts", "UpdateContainerImage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateContainerImageSignature Modify the properties of a container image signature. Avoid entering confidential information. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImageSignature.go.html to see an example of how to use UpdateContainerImageSignature API. +// A default retry strategy applies to this operation UpdateContainerImageSignature() +func (client ArtifactsClient) UpdateContainerImageSignature(ctx context.Context, request UpdateContainerImageSignatureRequest) (response UpdateContainerImageSignatureResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateContainerImageSignature, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerImageSignatureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerImageSignatureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerImageSignatureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerImageSignatureResponse") + } + return +} + +// updateContainerImageSignature implements the OCIOperation interface (enables retrying operations) +func (client ArtifactsClient) updateContainerImageSignature(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/container/imageSignatures/{imageSignatureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerImageSignatureResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateContainerImageSignature") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/registry/20160918/ContainerImageSignature/UpdateContainerImageSignature" + err = common.PostProcessServiceError(err, "Artifacts", "UpdateContainerImageSignature", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateContainerRepository Modify the properties of a container repository. Avoid entering confidential information. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerRepository.go.html to see an example of how to use UpdateContainerRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerRepository.go.html to see an example of how to use UpdateContainerRepository API. +// A default retry strategy applies to this operation UpdateContainerRepository() func (client ArtifactsClient) UpdateContainerRepository(ctx context.Context, request UpdateContainerRepositoryRequest) (response UpdateContainerRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1654,7 +1860,7 @@ func (client ArtifactsClient) updateContainerRepository(ctx context.Context, req var response UpdateContainerRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateContainerRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1667,14 +1873,15 @@ func (client ArtifactsClient) updateContainerRepository(ctx context.Context, req return response, err } -// UpdateGenericArtifact Updates the artifact with the specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). You can only update the tags of an artifact. +// UpdateGenericArtifact Updates the artifact with the specified OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). You can only update the tags of an artifact. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifact.go.html to see an example of how to use UpdateGenericArtifact API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifact.go.html to see an example of how to use UpdateGenericArtifact API. +// A default retry strategy applies to this operation UpdateGenericArtifact() func (client ArtifactsClient) UpdateGenericArtifact(ctx context.Context, request UpdateGenericArtifactRequest) (response UpdateGenericArtifactResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1711,7 +1918,7 @@ func (client ArtifactsClient) updateGenericArtifact(ctx context.Context, request var response UpdateGenericArtifactResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateGenericArtifact") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1726,12 +1933,13 @@ func (client ArtifactsClient) updateGenericArtifact(ctx context.Context, request // UpdateGenericArtifactByPath Updates an artifact with a specified `artifactPath` and `version`. You can only update the tags of an artifact. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifactByPath.go.html to see an example of how to use UpdateGenericArtifactByPath API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifactByPath.go.html to see an example of how to use UpdateGenericArtifactByPath API. +// A default retry strategy applies to this operation UpdateGenericArtifactByPath() func (client ArtifactsClient) UpdateGenericArtifactByPath(ctx context.Context, request UpdateGenericArtifactByPathRequest) (response UpdateGenericArtifactByPathResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1768,7 +1976,7 @@ func (client ArtifactsClient) updateGenericArtifactByPath(ctx context.Context, r var response UpdateGenericArtifactByPathResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateGenericArtifactByPath") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -1783,12 +1991,13 @@ func (client ArtifactsClient) updateGenericArtifactByPath(ctx context.Context, r // UpdateRepository Updates the properties of a repository. You can update the `displayName` and `description` properties. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateRepository.go.html to see an example of how to use UpdateRepository API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateRepository.go.html to see an example of how to use UpdateRepository API. +// A default retry strategy applies to this operation UpdateRepository() func (client ArtifactsClient) UpdateRepository(ctx context.Context, request UpdateRepositoryRequest) (response UpdateRepositoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -1825,7 +2034,7 @@ func (client ArtifactsClient) updateRepository(ctx context.Context, request comm var response UpdateRepositoryResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "artifacts", "UpdateRepository") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_details.go index a3b02862a..3166b2775 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // ChangeContainerRepositoryCompartmentDetails Change container repository compartment details. type ChangeContainerRepositoryCompartmentDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment into which to move the resource. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment into which to move the resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` } @@ -34,7 +37,7 @@ func (m ChangeContainerRepositoryCompartmentDetails) ValidateEnumValue() (bool, errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_request_response.go index 32351b0c9..d430904b1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_container_repository_compartment_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeContainerRepositoryCompartment.go.html to see an example of how to use ChangeContainerRepositoryCompartmentRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeContainerRepositoryCompartment.go.html to see an example of how to use ChangeContainerRepositoryCompartmentRequest. type ChangeContainerRepositoryCompartmentRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -78,7 +78,7 @@ func (request ChangeContainerRepositoryCompartmentRequest) RetryPolicy() *common func (request ChangeContainerRepositoryCompartmentRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_details.go index b25c4ace4..4b51a38a4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // ChangeRepositoryCompartmentDetails Details for changing a repository's compartment. type ChangeRepositoryCompartmentDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment into which the repository should be moved. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment into which the repository should be moved. CompartmentId *string `mandatory:"true" json:"compartmentId"` } @@ -34,7 +37,7 @@ func (m ChangeRepositoryCompartmentDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_request_response.go index 03d6ff2ea..f086c4e73 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/change_repository_compartment_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeRepositoryCompartment.go.html to see an example of how to use ChangeRepositoryCompartmentRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ChangeRepositoryCompartment.go.html to see an example of how to use ChangeRepositoryCompartmentRequest. type ChangeRepositoryCompartmentRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -78,7 +78,7 @@ func (request ChangeRepositoryCompartmentRequest) RetryPolicy() *common.RetryPol func (request ChangeRepositoryCompartmentRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_configuration.go index f2c7a2483..5d1af1ddd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_configuration.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -38,7 +41,7 @@ func (m ContainerConfiguration) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image.go index 93b996221..76619b551 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -22,7 +25,7 @@ type ContainerImage struct { // The compartment OCID to which the container image belongs. Inferred from the container repository. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the user or principal that created the resource. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user or principal that created the resource. CreatedBy *string `mandatory:"true" json:"createdBy"` // The container image digest. @@ -34,7 +37,7 @@ type ContainerImage struct { // Example: `ubuntu:latest` or `ubuntu:latest@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -53,7 +56,7 @@ type ContainerImage struct { // Total number of pulls. PullCount *int64 `mandatory:"true" json:"pullCount"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. RepositoryId *string `mandatory:"true" json:"repositoryId"` // The container repository name. @@ -65,6 +68,20 @@ type ContainerImage struct { // The versions associated with this image. Versions []ContainerVersion `mandatory:"true" json:"versions"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` + // An RFC 3339 timestamp indicating when the image was last pulled. TimeLastPulled *common.SDKTime `mandatory:"false" json:"timeLastPulled"` @@ -86,7 +103,7 @@ func (m ContainerImage) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_collection.go index 16479e433..6b2cb87f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_collection.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -37,7 +40,7 @@ func (m ContainerImageCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_layer.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_layer.go index 775500ed1..a36060a57 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_layer.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_layer.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -40,7 +43,7 @@ func (m ContainerImageLayer) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature.go index a1c34235b..4ceefa0f4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // ContainerImageSignature Container image signature metadata. type ContainerImageSignature struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which the container repository exists. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which the container repository exists. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The id of the user or principal that created the resource. @@ -29,19 +32,19 @@ type ContainerImageSignature struct { // Example: `wrmz22sixa::qdwyc2ptun::SHA_256_RSA_PKCS_PSS::2vwmobasva` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image signature. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. // Example: `ocid1.containerimagesignature.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" json:"imageId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. // Example: `ocid1.key.oc1..exampleuniqueID` KmsKeyId *string `mandatory:"true" json:"kmsKeyId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. // Example: `ocid1.keyversion.oc1..exampleuniqueID` KmsKeyVersionId *string `mandatory:"true" json:"kmsKeyVersionId"` @@ -56,6 +59,23 @@ type ContainerImageSignature struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the container image signature. + LifecycleState ContainerImageSignatureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` } func (m ContainerImageSignature) String() string { @@ -70,9 +90,12 @@ func (m ContainerImageSignature) ValidateEnumValue() (bool, error) { if _, ok := GetMappingContainerImageSignatureSigningAlgorithmEnum(string(m.SigningAlgorithm)); !ok && m.SigningAlgorithm != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SigningAlgorithm: %s. Supported values are: %s.", m.SigningAlgorithm, strings.Join(GetContainerImageSignatureSigningAlgorithmEnumStringValues(), ","))) } + if _, ok := GetMappingContainerImageSignatureLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerImageSignatureLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -126,3 +149,49 @@ func GetMappingContainerImageSignatureSigningAlgorithmEnum(val string) (Containe enum, ok := mappingContainerImageSignatureSigningAlgorithmEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ContainerImageSignatureLifecycleStateEnum Enum with underlying type: string +type ContainerImageSignatureLifecycleStateEnum string + +// Set of constants representing the allowable values for ContainerImageSignatureLifecycleStateEnum +const ( + ContainerImageSignatureLifecycleStateAvailable ContainerImageSignatureLifecycleStateEnum = "AVAILABLE" + ContainerImageSignatureLifecycleStateDeleting ContainerImageSignatureLifecycleStateEnum = "DELETING" + ContainerImageSignatureLifecycleStateDeleted ContainerImageSignatureLifecycleStateEnum = "DELETED" +) + +var mappingContainerImageSignatureLifecycleStateEnum = map[string]ContainerImageSignatureLifecycleStateEnum{ + "AVAILABLE": ContainerImageSignatureLifecycleStateAvailable, + "DELETING": ContainerImageSignatureLifecycleStateDeleting, + "DELETED": ContainerImageSignatureLifecycleStateDeleted, +} + +var mappingContainerImageSignatureLifecycleStateEnumLowerCase = map[string]ContainerImageSignatureLifecycleStateEnum{ + "available": ContainerImageSignatureLifecycleStateAvailable, + "deleting": ContainerImageSignatureLifecycleStateDeleting, + "deleted": ContainerImageSignatureLifecycleStateDeleted, +} + +// GetContainerImageSignatureLifecycleStateEnumValues Enumerates the set of values for ContainerImageSignatureLifecycleStateEnum +func GetContainerImageSignatureLifecycleStateEnumValues() []ContainerImageSignatureLifecycleStateEnum { + values := make([]ContainerImageSignatureLifecycleStateEnum, 0) + for _, v := range mappingContainerImageSignatureLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetContainerImageSignatureLifecycleStateEnumStringValues Enumerates the set of values in String for ContainerImageSignatureLifecycleStateEnum +func GetContainerImageSignatureLifecycleStateEnumStringValues() []string { + return []string{ + "AVAILABLE", + "DELETING", + "DELETED", + } +} + +// GetMappingContainerImageSignatureLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerImageSignatureLifecycleStateEnum(val string) (ContainerImageSignatureLifecycleStateEnum, bool) { + enum, ok := mappingContainerImageSignatureLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_collection.go index bf0559a85..a4a26dd7f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_collection.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -37,7 +40,7 @@ func (m ContainerImageSignatureCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_summary.go index 38c9c1695..0631c300f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_signature_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -26,19 +29,19 @@ type ContainerImageSignatureSummary struct { // Example: `wrmz22sixa::qdwyc2ptun::SHA_256_RSA_PKCS_PSS::2vwmobasva` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image signature. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. // Example: `ocid1.containerimagesignature.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" json:"imageId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. // Example: `ocid1.key.oc1..exampleuniqueID` KmsKeyId *string `mandatory:"true" json:"kmsKeyId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. // Example: `ocid1.keyversion.oc1..exampleuniqueID` KmsKeyVersionId *string `mandatory:"true" json:"kmsKeyVersionId"` @@ -53,6 +56,23 @@ type ContainerImageSignatureSummary struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the container image signature. + LifecycleState ContainerImageSignatureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` } func (m ContainerImageSignatureSummary) String() string { @@ -67,9 +87,12 @@ func (m ContainerImageSignatureSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingContainerImageSignatureSummarySigningAlgorithmEnum(string(m.SigningAlgorithm)); !ok && m.SigningAlgorithm != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SigningAlgorithm: %s. Supported values are: %s.", m.SigningAlgorithm, strings.Join(GetContainerImageSignatureSummarySigningAlgorithmEnumStringValues(), ","))) } + if _, ok := GetMappingContainerImageSignatureLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerImageSignatureLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_summary.go index 7cf3c7b93..26c04048e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_image_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -31,7 +34,7 @@ type ContainerImageSummary struct { // Example: `ubuntu:latest` or `ubuntu:latest@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -47,6 +50,20 @@ type ContainerImageSummary struct { // An RFC 3339 timestamp indicating when the image was created. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` + // The most recent version associated with this image. Version *string `mandatory:"false" json:"version"` } @@ -65,7 +82,7 @@ func (m ContainerImageSummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository.go index 69ced711e..0dc5e31c9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -28,7 +31,7 @@ type ContainerRepository struct { // The container repository name. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -56,6 +59,23 @@ type ContainerRepository struct { // Total storage size in GBs that will be charged. BillableSizeInGBs *int64 `mandatory:"true" json:"billableSizeInGBs"` + // The tenancy namespace used in the container repository path. + Namespace *string `mandatory:"true" json:"namespace"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` + Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` // An RFC 3339 timestamp indicating when an image was last pushed to the repository. @@ -76,7 +96,7 @@ func (m ContainerRepository) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_collection.go index 10d39892b..cca65f95a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_collection.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -49,7 +52,7 @@ func (m ContainerRepositoryCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_readme.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_readme.go index ee639e0b6..98487e99f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_readme.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_readme.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -40,7 +43,7 @@ func (m ContainerRepositoryReadme) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_summary.go index 8169cdc32..5d9695e39 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_repository_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -25,7 +28,7 @@ type ContainerRepositorySummary struct { // The container repository name. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -49,6 +52,23 @@ type ContainerRepositorySummary struct { // Total storage size in GBs that will be charged. BillableSizeInGBs *int64 `mandatory:"true" json:"billableSizeInGBs"` + + // The tenancy namespace used in the container repository path. + Namespace *string `mandatory:"true" json:"namespace"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The system tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` } func (m ContainerRepositorySummary) String() string { @@ -65,7 +85,7 @@ func (m ContainerRepositorySummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_version.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_version.go index beca7e6cd..f8c82b519 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_version.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/container_version.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -40,7 +43,7 @@ func (m ContainerVersion) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_details.go index f727585be..2eee8ac7a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,18 +22,18 @@ import ( // CreateContainerImageSignatureDetails Upload container image signature request details. type CreateContainerImageSignatureDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which the container repository exists. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which the container repository exists. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" json:"imageId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyId used to sign the container image. // Example: `ocid1.key.oc1..exampleuniqueID` KmsKeyId *string `mandatory:"true" json:"kmsKeyId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. // Example: `ocid1.keyversion.oc1..exampleuniqueID` KmsKeyVersionId *string `mandatory:"true" json:"kmsKeyVersionId"` @@ -42,6 +45,16 @@ type CreateContainerImageSignatureDetails struct { // The algorithm to be used for signing. These are the only supported signing algorithms for container images. SigningAlgorithm CreateContainerImageSignatureDetailsSigningAlgorithmEnum `mandatory:"true" json:"signingAlgorithm"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateContainerImageSignatureDetails) String() string { @@ -58,7 +71,7 @@ func (m CreateContainerImageSignatureDetails) ValidateEnumValue() (bool, error) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_request_response.go index d3dec4f46..239ef4ce3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_image_signature_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerImageSignature.go.html to see an example of how to use CreateContainerImageSignatureRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerImageSignature.go.html to see an example of how to use CreateContainerImageSignatureRequest. type CreateContainerImageSignatureRequest struct { // Upload container image signature details @@ -74,7 +74,7 @@ func (request CreateContainerImageSignatureRequest) RetryPolicy() *common.RetryP func (request CreateContainerImageSignatureRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_details.go index ec49fbca2..8cc4eb40f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // CreateContainerRepositoryDetails Create container repository details. type CreateContainerRepositoryDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the resource. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to create the resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The container repository name. @@ -32,6 +35,16 @@ type CreateContainerRepositoryDetails struct { IsPublic *bool `mandatory:"false" json:"isPublic"` Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateContainerRepositoryDetails) String() string { @@ -45,7 +58,7 @@ func (m CreateContainerRepositoryDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_request_response.go index e16c384b7..16d4c664e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_container_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerRepository.go.html to see an example of how to use CreateContainerRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateContainerRepository.go.html to see an example of how to use CreateContainerRepositoryRequest. type CreateContainerRepositoryRequest struct { // Create container repository details. @@ -69,7 +69,7 @@ func (request CreateContainerRepositoryRequest) RetryPolicy() *common.RetryPolic func (request CreateContainerRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_generic_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_generic_repository_details.go index 45320bb5e..947ee164e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_generic_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_generic_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // CreateGenericRepositoryDetails Parameters needed to create an artifact repository. type CreateGenericRepositoryDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the repository's compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository's compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Whether to make the repository immutable. The artifacts of an immutable repository cannot be overwritten. @@ -33,42 +36,42 @@ type CreateGenericRepositoryDetails struct { Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m CreateGenericRepositoryDetails) GetDisplayName() *string { return m.DisplayName } -//GetCompartmentId returns CompartmentId +// GetCompartmentId returns CompartmentId func (m CreateGenericRepositoryDetails) GetCompartmentId() *string { return m.CompartmentId } -//GetDescription returns Description +// GetDescription returns Description func (m CreateGenericRepositoryDetails) GetDescription() *string { return m.Description } -//GetIsImmutable returns IsImmutable +// GetIsImmutable returns IsImmutable func (m CreateGenericRepositoryDetails) GetIsImmutable() *bool { return m.IsImmutable } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m CreateGenericRepositoryDetails) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m CreateGenericRepositoryDetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } @@ -84,7 +87,7 @@ func (m CreateGenericRepositoryDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_details.go index 1eb1ddb7f..8c87a959e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // CreateRepositoryDetails Parameters needed to create an artifact repository. type CreateRepositoryDetails interface { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the repository's compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository's compartment. GetCompartmentId() *string // Whether to make the repository immutable. The artifacts of an immutable repository cannot be overwritten. @@ -33,24 +36,24 @@ type CreateRepositoryDetails interface { GetDescription() *string // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} } type createrepositorydetails struct { JsonData []byte - CompartmentId *string `mandatory:"true" json:"compartmentId"` - IsImmutable *bool `mandatory:"true" json:"isImmutable"` DisplayName *string `mandatory:"false" json:"displayName"` Description *string `mandatory:"false" json:"description"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + IsImmutable *bool `mandatory:"true" json:"isImmutable"` RepositoryType string `json:"repositoryType"` } @@ -90,41 +93,41 @@ func (m *createrepositorydetails) UnmarshalPolymorphicJSON(data []byte) (interfa err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for CreateRepositoryDetails: %s.", m.RepositoryType) + common.Logf("Received unsupported enum value for CreateRepositoryDetails: %s.", m.RepositoryType) return *m, nil } } -//GetCompartmentId returns CompartmentId -func (m createrepositorydetails) GetCompartmentId() *string { - return m.CompartmentId -} - -//GetIsImmutable returns IsImmutable -func (m createrepositorydetails) GetIsImmutable() *bool { - return m.IsImmutable -} - -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m createrepositorydetails) GetDisplayName() *string { return m.DisplayName } -//GetDescription returns Description +// GetDescription returns Description func (m createrepositorydetails) GetDescription() *string { return m.Description } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m createrepositorydetails) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m createrepositorydetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } +// GetCompartmentId returns CompartmentId +func (m createrepositorydetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetIsImmutable returns IsImmutable +func (m createrepositorydetails) GetIsImmutable() *bool { + return m.IsImmutable +} + func (m createrepositorydetails) String() string { return common.PointerString(m) } @@ -136,7 +139,7 @@ func (m createrepositorydetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_request_response.go index 7db838d54..684790164 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/create_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateRepository.go.html to see an example of how to use CreateRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/CreateRepository.go.html to see an example of how to use CreateRepositoryRequest. type CreateRepositoryRequest struct { // Creates a new repository for storing artifacts. @@ -69,7 +69,7 @@ func (request CreateRepositoryRequest) RetryPolicy() *common.RetryPolicy { func (request CreateRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_request_response.go index 4bdd273ec..71fa1cfcf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImage.go.html to see an example of how to use DeleteContainerImageRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImage.go.html to see an example of how to use DeleteContainerImageRequest. type DeleteContainerImageRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` @@ -68,7 +68,7 @@ func (request DeleteContainerImageRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteContainerImageRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_signature_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_signature_request_response.go index ae523c67a..3d27ce57c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_signature_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_image_signature_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImageSignature.go.html to see an example of how to use DeleteContainerImageSignatureRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerImageSignature.go.html to see an example of how to use DeleteContainerImageSignatureRequest. type DeleteContainerImageSignatureRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. // Example: `ocid1.containersignature.oc1..exampleuniqueID` ImageSignatureId *string `mandatory:"true" contributesTo:"path" name:"imageSignatureId"` @@ -68,7 +68,7 @@ func (request DeleteContainerImageSignatureRequest) RetryPolicy() *common.RetryP func (request DeleteContainerImageSignatureRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_repository_request_response.go index 1032a1d1e..0afe42d17 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_container_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerRepository.go.html to see an example of how to use DeleteContainerRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteContainerRepository.go.html to see an example of how to use DeleteContainerRepositoryRequest. type DeleteContainerRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -68,7 +68,7 @@ func (request DeleteContainerRepositoryRequest) RetryPolicy() *common.RetryPolic func (request DeleteContainerRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_by_path_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_by_path_request_response.go index 421a60843..fae8648e4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_by_path_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_by_path_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifactByPath.go.html to see an example of how to use DeleteGenericArtifactByPathRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifactByPath.go.html to see an example of how to use DeleteGenericArtifactByPathRequest. type DeleteGenericArtifactByPathRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -76,7 +76,7 @@ func (request DeleteGenericArtifactByPathRequest) RetryPolicy() *common.RetryPol func (request DeleteGenericArtifactByPathRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_request_response.go index 1962b825c..39be2461e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_generic_artifact_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifact.go.html to see an example of how to use DeleteGenericArtifactRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteGenericArtifact.go.html to see an example of how to use DeleteGenericArtifactRequest. type DeleteGenericArtifactRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. // Example: `ocid1.genericartifact.oc1..exampleuniqueID` ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` @@ -68,7 +68,7 @@ func (request DeleteGenericArtifactRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteGenericArtifactRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_repository_request_response.go index 910ff3083..dafc382cc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/delete_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteRepository.go.html to see an example of how to use DeleteRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/DeleteRepository.go.html to see an example of how to use DeleteRepositoryRequest. type DeleteRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -68,7 +68,7 @@ func (request DeleteRepositoryRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact.go index 63ee5e574..022aeb638 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // GenericArtifact The metadata of the artifact. type GenericArtifact struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. // Example: `ocid1.genericartifact.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -27,10 +30,10 @@ type GenericArtifact struct { // Example: `project01/my-web-app/artifact-abc:1.0.0` DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository's compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository's compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. RepositoryId *string `mandatory:"true" json:"repositoryId"` // A user-defined path to describe the location of an artifact. Slashes do not create a directory structure, but you can use slashes to organize the repository. An artifact path does not include an artifact version. @@ -51,12 +54,12 @@ type GenericArtifact struct { LifecycleState GenericArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` @@ -78,7 +81,7 @@ func (m GenericArtifact) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_collection.go index c0349d6c9..4ff3264f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_collection.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -34,7 +37,7 @@ func (m GenericArtifactCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_summary.go index 7a5f48637..280cde334 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_artifact_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -19,7 +22,7 @@ import ( // GenericArtifactSummary Summary information for an artifact. type GenericArtifactSummary struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. // Example: `ocid1.genericartifact.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -30,7 +33,7 @@ type GenericArtifactSummary struct { // The OCID of the artifact's compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. RepositoryId *string `mandatory:"true" json:"repositoryId"` // A user-defined path to describe the location of an artifact. Slashes do not create a directory structure, but you can use slashes to organize the repository. An artifact path does not include an artifact version. @@ -51,12 +54,12 @@ type GenericArtifactSummary struct { LifecycleState GenericArtifactLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` @@ -78,7 +81,7 @@ func (m GenericArtifactSummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository.go index ca48c9a56..b0afbba30 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // GenericRepository The metadata for the artifact repository. type GenericRepository struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -37,12 +40,12 @@ type GenericRepository struct { IsImmutable *bool `mandatory:"true" json:"isImmutable"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` @@ -53,47 +56,47 @@ type GenericRepository struct { LifecycleState RepositoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } -//GetId returns Id +// GetId returns Id func (m GenericRepository) GetId() *string { return m.Id } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m GenericRepository) GetDisplayName() *string { return m.DisplayName } -//GetCompartmentId returns CompartmentId +// GetCompartmentId returns CompartmentId func (m GenericRepository) GetCompartmentId() *string { return m.CompartmentId } -//GetDescription returns Description +// GetDescription returns Description func (m GenericRepository) GetDescription() *string { return m.Description } -//GetIsImmutable returns IsImmutable +// GetIsImmutable returns IsImmutable func (m GenericRepository) GetIsImmutable() *bool { return m.IsImmutable } -//GetLifecycleState returns LifecycleState +// GetLifecycleState returns LifecycleState func (m GenericRepository) GetLifecycleState() RepositoryLifecycleStateEnum { return m.LifecycleState } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m GenericRepository) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m GenericRepository) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } -//GetTimeCreated returns TimeCreated +// GetTimeCreated returns TimeCreated func (m GenericRepository) GetTimeCreated() *common.SDKTime { return m.TimeCreated } @@ -112,7 +115,7 @@ func (m GenericRepository) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetRepositoryLifecycleStateEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository_summary.go index f5b9381a3..0866df7af 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/generic_repository_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // GenericRepositorySummary Summary information for a repository. type GenericRepositorySummary struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` Id *string `mandatory:"true" json:"id"` @@ -34,12 +37,12 @@ type GenericRepositorySummary struct { IsImmutable *bool `mandatory:"true" json:"isImmutable"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` @@ -53,47 +56,47 @@ type GenericRepositorySummary struct { LifecycleState RepositoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } -//GetId returns Id +// GetId returns Id func (m GenericRepositorySummary) GetId() *string { return m.Id } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m GenericRepositorySummary) GetDisplayName() *string { return m.DisplayName } -//GetCompartmentId returns CompartmentId +// GetCompartmentId returns CompartmentId func (m GenericRepositorySummary) GetCompartmentId() *string { return m.CompartmentId } -//GetDescription returns Description +// GetDescription returns Description func (m GenericRepositorySummary) GetDescription() *string { return m.Description } -//GetIsImmutable returns IsImmutable +// GetIsImmutable returns IsImmutable func (m GenericRepositorySummary) GetIsImmutable() *bool { return m.IsImmutable } -//GetLifecycleState returns LifecycleState +// GetLifecycleState returns LifecycleState func (m GenericRepositorySummary) GetLifecycleState() RepositoryLifecycleStateEnum { return m.LifecycleState } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m GenericRepositorySummary) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m GenericRepositorySummary) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } -//GetTimeCreated returns TimeCreated +// GetTimeCreated returns TimeCreated func (m GenericRepositorySummary) GetTimeCreated() *common.SDKTime { return m.TimeCreated } @@ -112,7 +115,7 @@ func (m GenericRepositorySummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetRepositoryLifecycleStateEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_configuration_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_configuration_request_response.go index 75d69c33f..723714af6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_configuration_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_configuration_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerConfiguration.go.html to see an example of how to use GetContainerConfigurationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerConfiguration.go.html to see an example of how to use GetContainerConfigurationRequest. type GetContainerConfigurationRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // Unique identifier for the request. @@ -62,7 +62,7 @@ func (request GetContainerConfigurationRequest) RetryPolicy() *common.RetryPolic func (request GetContainerConfigurationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_request_response.go index b84f2f36b..8445b185b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImage.go.html to see an example of how to use GetContainerImageRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImage.go.html to see an example of how to use GetContainerImageRequest. type GetContainerImageRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` @@ -63,7 +63,7 @@ func (request GetContainerImageRequest) RetryPolicy() *common.RetryPolicy { func (request GetContainerImageRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_signature_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_signature_request_response.go index 56b49d590..e60d448ce 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_signature_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_image_signature_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImageSignature.go.html to see an example of how to use GetContainerImageSignatureRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerImageSignature.go.html to see an example of how to use GetContainerImageSignatureRequest. type GetContainerImageSignatureRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. // Example: `ocid1.containersignature.oc1..exampleuniqueID` ImageSignatureId *string `mandatory:"true" contributesTo:"path" name:"imageSignatureId"` @@ -63,7 +63,7 @@ func (request GetContainerImageSignatureRequest) RetryPolicy() *common.RetryPoli func (request GetContainerImageSignatureRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_repository_request_response.go index 1f634433b..26222dfc4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_container_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerRepository.go.html to see an example of how to use GetContainerRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetContainerRepository.go.html to see an example of how to use GetContainerRepositoryRequest. type GetContainerRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -63,7 +63,7 @@ func (request GetContainerRepositoryRequest) RetryPolicy() *common.RetryPolicy { func (request GetContainerRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_by_path_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_by_path_request_response.go index dc6cb7803..3b91149be 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_by_path_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_by_path_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifactByPath.go.html to see an example of how to use GetGenericArtifactByPathRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifactByPath.go.html to see an example of how to use GetGenericArtifactByPathRequest. type GetGenericArtifactByPathRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -71,7 +71,7 @@ func (request GetGenericArtifactByPathRequest) RetryPolicy() *common.RetryPolicy func (request GetGenericArtifactByPathRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_request_response.go index 2433ef9ce..25fb1d787 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_generic_artifact_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifact.go.html to see an example of how to use GetGenericArtifactRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetGenericArtifact.go.html to see an example of how to use GetGenericArtifactRequest. type GetGenericArtifactRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. // Example: `ocid1.genericartifact.oc1..exampleuniqueID` ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` @@ -63,7 +63,7 @@ func (request GetGenericArtifactRequest) RetryPolicy() *common.RetryPolicy { func (request GetGenericArtifactRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_repository_request_response.go index 0c5c3ea32..c1516a5dd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/get_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetRepository.go.html to see an example of how to use GetRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/GetRepository.go.html to see an example of how to use GetRepositoryRequest. type GetRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -63,7 +63,7 @@ func (request GetRepositoryRequest) RetryPolicy() *common.RetryPolicy { func (request GetRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_image_signatures_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_image_signatures_request_response.go index 9ed3918c3..d1f4bd228 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_image_signatures_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_image_signatures_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImageSignatures.go.html to see an example of how to use ListContainerImageSignaturesRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImageSignatures.go.html to see an example of how to use ListContainerImageSignaturesRequest. type ListContainerImageSignaturesRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // When set to true, the hierarchy of compartments is traversed @@ -45,11 +45,11 @@ type ListContainerImageSignaturesRequest struct { // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. // Example: `ocid1.keyversion.oc1..exampleuniqueID` KmsKeyId *string `mandatory:"false" contributesTo:"query" name:"kmsKeyId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the kmsKeyVersionId used to sign the container image. // Example: `ocid1.keyversion.oc1..exampleuniqueID` KmsKeyVersionId *string `mandatory:"false" contributesTo:"query" name:"kmsKeyVersionId"` @@ -58,13 +58,13 @@ type ListContainerImageSignaturesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. @@ -130,7 +130,7 @@ func (request ListContainerImageSignaturesRequest) ValidateEnumValue() (bool, er errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListContainerImageSignaturesSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -146,7 +146,7 @@ type ListContainerImageSignaturesResponse struct { // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_images_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_images_request_response.go index 9e4748380..29f028546 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_images_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_images_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImages.go.html to see an example of how to use ListContainerImagesRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerImages.go.html to see an example of how to use ListContainerImagesRequest. type ListContainerImagesRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // When set to true, the hierarchy of compartments is traversed @@ -51,15 +51,19 @@ type ListContainerImagesRequest struct { // A filter to return only resources that match the given lifecycle state name exactly. LifecycleState *string `mandatory:"false" contributesTo:"query" name:"lifecycleState"` + // The digest of the container image. + // Example: `sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa` + ImageDigest *string `mandatory:"false" contributesTo:"query" name:"imageDigest"` + // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. @@ -122,7 +126,7 @@ func (request ListContainerImagesRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListContainerImagesSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -138,7 +142,7 @@ type ListContainerImagesResponse struct { // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_repositories_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_repositories_request_response.go index 315fea666..e5d3d413d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_repositories_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_container_repositories_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerRepositories.go.html to see an example of how to use ListContainerRepositoriesRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListContainerRepositories.go.html to see an example of how to use ListContainerRepositoriesRequest. type ListContainerRepositoriesRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // When set to true, the hierarchy of compartments is traversed @@ -42,13 +42,13 @@ type ListContainerRepositoriesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. @@ -111,7 +111,7 @@ func (request ListContainerRepositoriesRequest) ValidateEnumValue() (bool, error errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListContainerRepositoriesSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -127,7 +127,7 @@ type ListContainerRepositoriesResponse struct { // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_generic_artifacts_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_generic_artifacts_request_response.go index 37cdee3ba..a690cacda 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_generic_artifacts_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_generic_artifacts_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListGenericArtifacts.go.html to see an example of how to use ListGenericArtifactsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListGenericArtifacts.go.html to see an example of how to use ListGenericArtifactsRequest. type ListGenericArtifactsRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // A filter to return the artifacts only for the specified repository OCID. @@ -44,13 +44,13 @@ type ListGenericArtifactsRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. @@ -113,7 +113,7 @@ func (request ListGenericArtifactsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListGenericArtifactsSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -129,7 +129,7 @@ type ListGenericArtifactsResponse struct { // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_repositories_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_repositories_request_response.go index 03fa773ce..72a28148d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_repositories_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/list_repositories_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListRepositories.go.html to see an example of how to use ListRepositoriesRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/ListRepositories.go.html to see an example of how to use ListRepositoriesRequest. type ListRepositoriesRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // A filter to return the resources for the specified OCID. @@ -35,13 +35,13 @@ type ListRepositoriesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. @@ -104,7 +104,7 @@ func (request ListRepositoriesRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListRepositoriesSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -120,7 +120,7 @@ type ListRepositoriesResponse struct { // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_details.go new file mode 100644 index 000000000..5b5e22811 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Artifacts and Container Images API +// +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). +// + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LookupContainerImageByUriDetails Details for fetching a container image by its URI. +type LookupContainerImageByUriDetails struct { + + // The container image URI starting with the namespace. + // Example: namespace/reponame:version + // Example: namespace/reponame@sha256:50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c + ImageUri *string `mandatory:"true" json:"imageUri"` +} + +func (m LookupContainerImageByUriDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LookupContainerImageByUriDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_request_response.go new file mode 100644 index 000000000..d8d4014f6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/lookup_container_image_by_uri_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// LookupContainerImageByUriRequest wrapper for the LookupContainerImageByUri operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/LookupContainerImageByUri.go.html to see an example of how to use LookupContainerImageByUriRequest. +type LookupContainerImageByUriRequest struct { + + // Get container image metadata by URI. + LookupContainerImageByUriDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request LookupContainerImageByUriRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request LookupContainerImageByUriRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request LookupContainerImageByUriRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request LookupContainerImageByUriRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request LookupContainerImageByUriRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LookupContainerImageByUriResponse wrapper for the LookupContainerImageByUri operation +type LookupContainerImageByUriResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerImage instance + ContainerImage `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response LookupContainerImageByUriResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response LookupContainerImageByUriResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_details.go index 13437d033..bc563bed5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -34,7 +37,7 @@ func (m RemoveContainerVersionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_request_response.go index 5bc95ab1c..9b343ee03 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/remove_container_version_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RemoveContainerVersion.go.html to see an example of how to use RemoveContainerVersionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RemoveContainerVersion.go.html to see an example of how to use RemoveContainerVersionRequest. type RemoveContainerVersionRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` @@ -78,7 +78,7 @@ func (request RemoveContainerVersionRequest) RetryPolicy() *common.RetryPolicy { func (request RemoveContainerVersionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository.go index cf2e228ad..d10e78723 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // Repository The metadata for the artifact repository. type Repository interface { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` GetId() *string @@ -40,12 +43,12 @@ type Repository interface { GetLifecycleState() RepositoryLifecycleStateEnum // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} @@ -106,52 +109,52 @@ func (m *repository) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for Repository: %s.", m.RepositoryType) + common.Logf("Received unsupported enum value for Repository: %s.", m.RepositoryType) return *m, nil } } -//GetId returns Id +// GetId returns Id func (m repository) GetId() *string { return m.Id } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m repository) GetDisplayName() *string { return m.DisplayName } -//GetCompartmentId returns CompartmentId +// GetCompartmentId returns CompartmentId func (m repository) GetCompartmentId() *string { return m.CompartmentId } -//GetDescription returns Description +// GetDescription returns Description func (m repository) GetDescription() *string { return m.Description } -//GetIsImmutable returns IsImmutable +// GetIsImmutable returns IsImmutable func (m repository) GetIsImmutable() *bool { return m.IsImmutable } -//GetLifecycleState returns LifecycleState +// GetLifecycleState returns LifecycleState func (m repository) GetLifecycleState() RepositoryLifecycleStateEnum { return m.LifecycleState } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m repository) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m repository) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } -//GetTimeCreated returns TimeCreated +// GetTimeCreated returns TimeCreated func (m repository) GetTimeCreated() *common.SDKTime { return m.TimeCreated } @@ -170,7 +173,7 @@ func (m repository) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_collection.go index aeba36abe..1b4c99da5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_collection.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -35,7 +38,7 @@ func (m RepositoryCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -63,6 +66,5 @@ func (m *RepositoryCollection) UnmarshalJSON(data []byte) (e error) { m.Items[i] = nil } } - return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_summary.go index 605142843..4ecf56bba 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/repository_summary.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,7 +23,7 @@ import ( // RepositorySummary Summary information for a repository. type RepositorySummary interface { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` GetId() *string @@ -37,12 +40,12 @@ type RepositorySummary interface { GetLifecycleState() RepositoryLifecycleStateEnum // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} @@ -55,6 +58,7 @@ type RepositorySummary interface { type repositorysummary struct { JsonData []byte + Description *string `mandatory:"false" json:"description"` Id *string `mandatory:"true" json:"id"` DisplayName *string `mandatory:"true" json:"displayName"` CompartmentId *string `mandatory:"true" json:"compartmentId"` @@ -63,7 +67,6 @@ type repositorysummary struct { FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - Description *string `mandatory:"false" json:"description"` RepositoryType string `json:"repositoryType"` } @@ -106,56 +109,56 @@ func (m *repositorysummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for RepositorySummary: %s.", m.RepositoryType) + common.Logf("Received unsupported enum value for RepositorySummary: %s.", m.RepositoryType) return *m, nil } } -//GetId returns Id +// GetDescription returns Description +func (m repositorysummary) GetDescription() *string { + return m.Description +} + +// GetId returns Id func (m repositorysummary) GetId() *string { return m.Id } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m repositorysummary) GetDisplayName() *string { return m.DisplayName } -//GetCompartmentId returns CompartmentId +// GetCompartmentId returns CompartmentId func (m repositorysummary) GetCompartmentId() *string { return m.CompartmentId } -//GetIsImmutable returns IsImmutable +// GetIsImmutable returns IsImmutable func (m repositorysummary) GetIsImmutable() *bool { return m.IsImmutable } -//GetLifecycleState returns LifecycleState +// GetLifecycleState returns LifecycleState func (m repositorysummary) GetLifecycleState() RepositoryLifecycleStateEnum { return m.LifecycleState } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m repositorysummary) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m repositorysummary) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } -//GetTimeCreated returns TimeCreated +// GetTimeCreated returns TimeCreated func (m repositorysummary) GetTimeCreated() *common.SDKTime { return m.TimeCreated } -//GetDescription returns Description -func (m repositorysummary) GetDescription() *string { - return m.Description -} - func (m repositorysummary) String() string { return common.PointerString(m) } @@ -170,7 +173,7 @@ func (m repositorysummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_details.go index bf09fcb77..8d80c253a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -34,7 +37,7 @@ func (m RestoreContainerImageDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_request_response.go index ef6e94d10..4571e0ac4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/restore_container_image_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RestoreContainerImage.go.html to see an example of how to use RestoreContainerImageRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/RestoreContainerImage.go.html to see an example of how to use RestoreContainerImageRequest. type RestoreContainerImageRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. // Example: `ocid1.containerimage.oc1..exampleuniqueID` ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` @@ -78,7 +78,7 @@ func (request RestoreContainerImageRequest) RetryPolicy() *common.RetryPolicy { func (request RestoreContainerImageRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_details.go index 6ed8dd884..484b35a5d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -35,7 +38,7 @@ func (m UpdateContainerConfigurationDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_request_response.go index 2c4f7639f..9ba4e1aec 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_configuration_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerConfiguration.go.html to see an example of how to use UpdateContainerConfigurationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerConfiguration.go.html to see an example of how to use UpdateContainerConfigurationRequest. type UpdateContainerConfigurationRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // Update container configuration details. @@ -70,7 +70,7 @@ func (request UpdateContainerConfigurationRequest) RetryPolicy() *common.RetryPo func (request UpdateContainerConfigurationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_details.go new file mode 100644 index 000000000..bf396c0ae --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Artifacts and Container Images API +// +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). +// + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageDetails Details for updating a container image. +type UpdateContainerImageDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerImageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_request_response.go new file mode 100644 index 000000000..70e1ead24 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerImageRequest wrapper for the UpdateContainerImage operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImage.go.html to see an example of how to use UpdateContainerImageRequest. +type UpdateContainerImageRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image. + // Example: `ocid1.containerimage.oc1..exampleuniqueID` + ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` + + // Update container image details. + UpdateContainerImageDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateContainerImageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerImageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateContainerImageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerImageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateContainerImageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerImageResponse wrapper for the UpdateContainerImage operation +type UpdateContainerImageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerImage instance + ContainerImage `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateContainerImageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerImageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_details.go new file mode 100644 index 000000000..61f7d0917 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Artifacts and Container Images API +// +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). +// + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerImageSignatureDetails Details for updating a container image signature. +type UpdateContainerImageSignatureDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerImageSignatureDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerImageSignatureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_request_response.go new file mode 100644 index 000000000..71612152a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_image_signature_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package artifacts + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerImageSignatureRequest wrapper for the UpdateContainerImageSignature operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerImageSignature.go.html to see an example of how to use UpdateContainerImageSignatureRequest. +type UpdateContainerImageSignatureRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container image signature. + // Example: `ocid1.containersignature.oc1..exampleuniqueID` + ImageSignatureId *string `mandatory:"true" contributesTo:"path" name:"imageSignatureId"` + + // Update container image signature details. + UpdateContainerImageSignatureDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateContainerImageSignatureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerImageSignatureRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateContainerImageSignatureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerImageSignatureRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateContainerImageSignatureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerImageSignatureResponse wrapper for the UpdateContainerImageSignature operation +type UpdateContainerImageSignatureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerImageSignature instance + ContainerImageSignature `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateContainerImageSignatureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerImageSignatureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_details.go index 5e9cc6ea5..75e4a3d5b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -26,6 +29,16 @@ type UpdateContainerRepositoryDetails struct { IsPublic *bool `mandatory:"false" json:"isPublic"` Readme *ContainerRepositoryReadme `mandatory:"false" json:"readme"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateContainerRepositoryDetails) String() string { @@ -39,7 +52,7 @@ func (m UpdateContainerRepositoryDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_request_response.go index f68434ad2..6ba056d3a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_container_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerRepository.go.html to see an example of how to use UpdateContainerRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateContainerRepository.go.html to see an example of how to use UpdateContainerRepositoryRequest. type UpdateContainerRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository. // Example: `ocid1.containerrepo.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -71,7 +71,7 @@ func (request UpdateContainerRepositoryRequest) RetryPolicy() *common.RetryPolic func (request UpdateContainerRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_details.go index cb9c3bdf7..dcce305be 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -20,12 +23,12 @@ import ( type UpdateGenericArtifactByPathDetails struct { // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -41,7 +44,7 @@ func (m UpdateGenericArtifactByPathDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_request_response.go index 35a7db94e..781c55415 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_by_path_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifactByPath.go.html to see an example of how to use UpdateGenericArtifactByPathRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifactByPath.go.html to see an example of how to use UpdateGenericArtifactByPathRequest. type UpdateGenericArtifactByPathRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -79,7 +79,7 @@ func (request UpdateGenericArtifactByPathRequest) RetryPolicy() *common.RetryPol func (request UpdateGenericArtifactByPathRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_details.go index 55900adee..48a16fd0e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -16,16 +19,16 @@ import ( "strings" ) -// UpdateGenericArtifactDetails Details for updating an artifact by providing its OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// UpdateGenericArtifactDetails Details for updating an artifact by providing its OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). type UpdateGenericArtifactDetails struct { // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -41,7 +44,7 @@ func (m UpdateGenericArtifactDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_request_response.go index d05abd9ef..b60de387f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_artifact_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,14 +15,14 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifact.go.html to see an example of how to use UpdateGenericArtifactRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateGenericArtifact.go.html to see an example of how to use UpdateGenericArtifactRequest. type UpdateGenericArtifactRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the artifact. // Example: `ocid1.genericartifact.oc1..exampleuniqueID` ArtifactId *string `mandatory:"true" contributesTo:"path" name:"artifactId"` - // Updates the artifact with the specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). You can only update the tags of an artifact. + // Updates the artifact with the specified OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). You can only update the tags of an artifact. UpdateGenericArtifactDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` @@ -71,7 +71,7 @@ func (request UpdateGenericArtifactRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateGenericArtifactRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_repository_details.go index 5b2426b97..45463b391 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_generic_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -27,32 +30,32 @@ type UpdateGenericRepositoryDetails struct { Description *string `mandatory:"false" json:"description"` // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m UpdateGenericRepositoryDetails) GetDisplayName() *string { return m.DisplayName } -//GetDescription returns Description +// GetDescription returns Description func (m UpdateGenericRepositoryDetails) GetDescription() *string { return m.Description } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m UpdateGenericRepositoryDetails) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m UpdateGenericRepositoryDetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } @@ -68,7 +71,7 @@ func (m UpdateGenericRepositoryDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_details.go index 6856dacda..d6f67f612 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_details.go @@ -1,11 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Artifacts and Container Images API // -// API covering the Artifacts and Registry (https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryoverview.htm) services. -// Use this API to manage resources such as generic artifacts and container images. +// Use the Artifacts and Container Images API to manage container images and non-container generic artifacts. +// - For container images such as Docker images, use the ContainerImage resource. Save the images in a ContainerRepository. +// - For non-container generic artifacts or blobs, use the GenericArtifact resource. Save the artifacts in an Repository. +// - To upload and download non-container generic artifacts, instead of the Artifacts and Container Images API, use the Generic Artifacts Content API. +// For more information, see the user guides for Container Registry (https://docs.oracle.com/iaas/Content/Registry/home.htm) and Artifact Registry (https://docs.oracle.com/iaas/Content/artifacts/home.htm). // package artifacts @@ -27,12 +30,12 @@ type UpdateRepositoryDetails interface { GetDescription() *string // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} } @@ -80,27 +83,27 @@ func (m *updaterepositorydetails) UnmarshalPolymorphicJSON(data []byte) (interfa err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for UpdateRepositoryDetails: %s.", m.RepositoryType) + common.Logf("Received unsupported enum value for UpdateRepositoryDetails: %s.", m.RepositoryType) return *m, nil } } -//GetDisplayName returns DisplayName +// GetDisplayName returns DisplayName func (m updaterepositorydetails) GetDisplayName() *string { return m.DisplayName } -//GetDescription returns Description +// GetDescription returns Description func (m updaterepositorydetails) GetDescription() *string { return m.Description } -//GetFreeformTags returns FreeformTags +// GetFreeformTags returns FreeformTags func (m updaterepositorydetails) GetFreeformTags() map[string]string { return m.FreeformTags } -//GetDefinedTags returns DefinedTags +// GetDefinedTags returns DefinedTags func (m updaterepositorydetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } @@ -116,7 +119,7 @@ func (m updaterepositorydetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_request_response.go index 3479a9815..af425d975 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/artifacts/update_repository_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateRepository.go.html to see an example of how to use UpdateRepositoryRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/artifacts/UpdateRepository.go.html to see an example of how to use UpdateRepositoryRequest. type UpdateRepositoryRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the repository. // Example: `ocid1.artifactrepository.oc1..exampleuniqueID` RepositoryId *string `mandatory:"true" contributesTo:"path" name:"repositoryId"` @@ -71,7 +71,7 @@ func (request UpdateRepositoryRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateRepositoryRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/certificate_retriever.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/certificate_retriever.go index df5f04c52..128dddb82 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/certificate_retriever.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/certificate_retriever.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/configuration.go index 6d5ddd22d..797411afb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/configuration.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/dispatcher_modifier.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/dispatcher_modifier.go index 9a3420d40..e4e662f2b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/dispatcher_modifier.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/dispatcher_modifier.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client.go index 7f8844777..32390bd4e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Package auth provides supporting functions and structs for authentication @@ -13,8 +13,10 @@ import ( "errors" "fmt" "io/ioutil" + "maps" "math" "net/http" + "net/url" "os" "strings" "sync" @@ -133,6 +135,189 @@ func newStaticFederationClient(sessionToken string, supplier sessionKeySupplier) }, nil } +// oAuth2FederationClient retrieves a security token from the scoped OAuth endpoint in Auth Service +type oAuth2FederationClient struct { + sessionKeySupplier cacheableSessionKeySupplier + authClientKeyProvider common.KeyProvider + authClient *common.BaseClient + securityToken securityToken + lastRefresh time.Time + scope string + targetCompartment string + mux sync.Mutex +} + +var OAuthTokenStaleWindow = 20 * time.Minute + +// newOAuth2FederationClient creates a new oAuth2FederationClient from the provided configProvider and Auth request parameters +func newOAuth2FederationClient(configProvider common.ConfigurationProvider, scope string, targetCompartment string, sessionKeySupplier cacheableSessionKeySupplier) (federationClient, error) { + client := &oAuth2FederationClient{} + client.sessionKeySupplier = sessionKeySupplier + region, err := configProvider.Region() + if err != nil { + return nil, fmt.Errorf("failed to build OAuth Federation Client: %s", err.Error()) + } + authClient := newAuthClient(common.StringToRegion(region), configProvider, "v1/oauth2/scoped") + client.authClient = authClient + client.authClientKeyProvider = configProvider + client.scope = scope + client.targetCompartment = targetCompartment + return client, nil +} + +// KeyID calls the KeyID method of the auth provider given to the federation client +func (c *oAuth2FederationClient) KeyID() (string, error) { + return c.authClientKeyProvider.KeyID() +} + +// PrivateRSAKey calls the PrivateRSAKey method of the auth provider given to the federation client +func (c *oAuth2FederationClient) PrivateRSAKey() (*rsa.PrivateKey, error) { + return c.authClientKeyProvider.PrivateRSAKey() +} + +func (c *oAuth2FederationClient) GetClaim(key string) (interface{}, error) { + c.mux.Lock() + defer c.mux.Unlock() + + if err := c.renewKeyAndSecurityTokenIfNotValid(); err != nil { + return nil, err + } + return c.securityToken.GetClaim(key) +} + +// isTokenStale returns true if the JWT token is older than OAuthTokenStaleWindow +func (c *oAuth2FederationClient) isTokenStale() bool { + return c.lastRefresh.IsZero() || time.Now().After(c.lastRefresh.Add(OAuthTokenStaleWindow)) +} + +func (c *oAuth2FederationClient) renewKeyAndSecurityTokenIfNotValid() (err error) { + return c.renewSecurityTokenIfNotValid() +} + +func (c *oAuth2FederationClient) renewSecurityTokenIfNotValid() (err error) { + + // Get a new token if this one is stale (or nil), even if it is still valid + if c.securityToken == nil || c.isTokenStale() { + if err = c.renewSecurityToken(); err != nil { + if c.securityToken != nil && c.securityToken.Valid() { + // Token is stale but still valid. We failed to get a new token + // but we can still use the old one + common.Debugln("failed to refresh OAuth token. Using valid cached token and cached session keys") + c.sessionKeySupplier.Revert() + return nil + } + + return fmt.Errorf("failed to refresh token: %s", err.Error()) + } + } + + // Token exists and is not stale, + // or token was stale and a new one was retrieved + return nil +} + +func (c *oAuth2FederationClient) renewSecurityToken() (err error) { + if err = c.sessionKeySupplier.Refresh(); err != nil { + return fmt.Errorf("failed to refresh session key: %s", err.Error()) + } + + common.Logf("Renewing security token at: %v\n", time.Now().Format("15:04:05.000")) + if newToken, err := c.getSecurityToken(); err != nil { + return fmt.Errorf("failed to get security token: %s", err.Error()) + } else { + // only update token if a new one was retrieved. + c.lastRefresh = time.Now() + c.securityToken = newToken + } + + common.Logf("Security token renewed at: %v\n", time.Now().Format("15:04:05.000")) + + return nil + +} + +func (c *oAuth2FederationClient) getSecurityToken() (securityToken, error) { + var err error + var httpRequest http.Request + var httpResponse *http.Response + defer common.CloseBodyIfValid(httpResponse) + for retry := 0; retry < 3; retry++ { + request := c.makeOAuthFederationRequest() + + if httpRequest, err = common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "", request); err != nil { + return nil, fmt.Errorf("failed to make http request: %s", err.Error()) + } + + if httpResponse, err = c.authClient.Call(context.Background(), &httpRequest); err == nil { + break + } + // Don't retry on 4xx errors + if httpResponse != nil && httpResponse.StatusCode >= 400 && httpResponse.StatusCode <= 499 { + return nil, fmt.Errorf("error %s returned by auth service: %s", httpResponse.Status, err.Error()) + } + nextDuration := time.Duration(1000.0*(math.Pow(2.0, float64(retry)))) * time.Millisecond + time.Sleep(nextDuration) + } + if err != nil { + return nil, fmt.Errorf("failed to call: %s", err.Error()) + } + + response := oAuthFederationResponse{} + if err = common.UnmarshalResponse(httpResponse, &response); err != nil { + return nil, fmt.Errorf("failed to unmarshal the response: %s", err.Error()) + } + + return newPrincipalToken(response.Token.Token) + +} + +type oAuthFederationRequest struct { + OAuthFederationDetails `contributesTo:"body"` +} + +// OAuthFederationDetails Scoped Oauth federation details +// The scope type should correspond to the type of config provider used to create +// the OAuth Federation Client +type OAuthFederationDetails struct { + Scope string `mandatory:"true" json:"scope,omitempty"` + PublicKey string `mandatory:"true" json:"public_key,omitempty"` + TargetCompartment string `mandatory:"true" json:"target_compartment,omitempty"` +} + +type oAuthFederationResponse struct { + Token `presentIn:"body"` +} + +func (c *oAuth2FederationClient) makeOAuthFederationRequest() *oAuthFederationRequest { + publicKey := sanitizeCertificateString(string(c.sessionKeySupplier.PublicKeyPemRaw())) + details := OAuthFederationDetails{ + Scope: c.scope, + PublicKey: publicKey, + TargetCompartment: c.targetCompartment, + } + return &oAuthFederationRequest{details} +} + +func (c *oAuth2FederationClient) PrivateKey() (*rsa.PrivateKey, error) { + c.mux.Lock() + defer c.mux.Unlock() + + if err := c.renewSecurityTokenIfNotValid(); err != nil { + return nil, err + } + return c.sessionKeySupplier.PrivateKey(), nil +} + +func (c *oAuth2FederationClient) SecurityToken() (token string, err error) { + c.mux.Lock() + defer c.mux.Unlock() + + if err = c.renewSecurityTokenIfNotValid(); err != nil { + return "", err + } + return c.securityToken.String(), nil +} + // x509FederationClient retrieves a security token from Auth service. type x509FederationClient struct { tenancyID string @@ -151,7 +336,7 @@ func newX509FederationClient(region common.Region, tenancyID string, leafCertifi intermediateCertificateRetrievers: intermediateCertificateRetrievers, } client.sessionKeySupplier = newSessionKeySupplier() - authClient := newAuthClient(region, client) + authClient := newAuthClient(region, client, "v1/x509") var err error @@ -176,7 +361,7 @@ func newX509FederationClientWithCerts(region common.Region, tenancyID string, le intermediateCertificateRetrievers: intermediateRetrievers, } client.sessionKeySupplier = newSessionKeySupplier() - authClient := newAuthClient(region, client) + authClient := newAuthClient(region, client, "v1/x509") var err error @@ -194,15 +379,23 @@ var ( bodyHeaders = []string{"content-length", "content-type", "x-content-sha256"} ) -func newAuthClient(region common.Region, provider common.KeyProvider) *common.BaseClient { +func newAuthClient(region common.Region, provider common.KeyProvider, authBasePath string) *common.BaseClient { signer := common.RequestSigner(provider, genericHeaders, bodyHeaders) client := common.DefaultBaseClientWithSigner(signer) + if regionURL, ok := os.LookupEnv("OCI_SDK_AUTH_CLIENT_REGION_URL"); ok { client.Host = regionURL } else { client.Host = region.Endpoint("auth") } - client.BasePath = "v1/x509" + client.BasePath = authBasePath + + if common.GlobalAuthClientCircuitBreakerSetting != nil { + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.GlobalAuthClientCircuitBreakerSetting) + } else if !common.IsEnvVarFalse("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED") { + common.Logf("Configuring DefaultAuthClientCircuitBreakerSetting for federation client") + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultAuthClientCircuitBreakerSetting()) + } return &client } @@ -210,7 +403,7 @@ func newAuthClient(region common.Region, provider common.KeyProvider) *common.Ba func (c *x509FederationClient) KeyID() (string, error) { tenancy := c.tenancyID fingerprint := fingerprint(c.leafCertificateRetriever.Certificate()) - return fmt.Sprintf("%s/fed-x509/%s", tenancy, fingerprint), nil + return fmt.Sprintf("%s/fed-x509-sha256/%s", tenancy, fingerprint), nil } // For authClient to sign requests to X509 Federation Endpoint @@ -288,7 +481,7 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) { var httpResponse *http.Response defer common.CloseBodyIfValid(httpResponse) - for retry := 0; retry < 5; retry++ { + for retry := 0; retry < 3; retry++ { request := c.makeX509FederationRequest() if httpRequest, err = common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "", request); err != nil { @@ -298,7 +491,10 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) { if httpResponse, err = c.authClient.Call(context.Background(), &httpRequest); err == nil { break } - + // Don't retry on 4xx errors + if httpResponse != nil && httpResponse.StatusCode >= 400 && httpResponse.StatusCode <= 499 { + return nil, fmt.Errorf("error %s returned by auth service: %s", httpResponse.Status, err.Error()) + } nextDuration := time.Duration(1000.0*(math.Pow(2.0, float64(retry)))) * time.Millisecond time.Sleep(nextDuration) } @@ -333,6 +529,7 @@ type X509FederationDetails struct { Certificate string `mandatory:"true" json:"certificate,omitempty"` PublicKey string `mandatory:"true" json:"publicKey,omitempty"` IntermediateCertificates []string `mandatory:"false" json:"intermediateCertificates,omitempty"` + FingerprintAlgorithm string `mandatory:"false" json:"fingerprintAlgorithm,omitempty"` } type x509FederationResponse struct { @@ -356,6 +553,7 @@ func (c *x509FederationClient) makeX509FederationRequest() *x509FederationReques Certificate: certificate, PublicKey: publicKey, IntermediateCertificates: intermediateCertificates, + FingerprintAlgorithm: "SHA256", } return &x509FederationRequest{details} } @@ -376,6 +574,12 @@ type sessionKeySupplier interface { PublicKeyPemRaw() []byte } +// cacheableSessionKeySupplier extends sessionKeySupplier with the ability to revert to the previous key pair. +type cacheableSessionKeySupplier interface { + sessionKeySupplier + Revert() +} + // genericKeySupplier implements sessionKeySupplier and provides an arbitrary refresh mechanism type genericKeySupplier struct { RefreshFn func() (*rsa.PrivateKey, []byte, error) @@ -532,6 +736,58 @@ func (s *inMemorySessionKeySupplier) PublicKeyPemRaw() []byte { return c } +type inMemoryCacheableSessionKeySupplier struct { + inMemorySessionKeySupplier + cachedPublicKeyPemRaw []byte + cachedPrivateKey *rsa.PrivateKey +} + +// newCacheableSessionKeySupplier creates and returns an inMemoryCacheableSessionKeySupplier instance which generates key pairs of size 2048. +func newCacheableSessionKeySupplier() cacheableSessionKeySupplier { + return &inMemoryCacheableSessionKeySupplier{inMemorySessionKeySupplier: inMemorySessionKeySupplier{keySize: 2048}} +} + +func (s *inMemoryCacheableSessionKeySupplier) Refresh() (err error) { + + common.Debugln("Refreshing cacheable session key") + + // Cache current keys before generating new ones + s.cachedPrivateKey = s.privateKey + if s.publicKeyPemRaw != nil { + s.cachedPublicKeyPemRaw = make([]byte, len(s.publicKeyPemRaw)) + copy(s.cachedPublicKeyPemRaw, s.publicKeyPemRaw) + } else { + s.cachedPublicKeyPemRaw = nil + } + var privateKey *rsa.PrivateKey + privateKey, err = rsa.GenerateKey(rand.Reader, s.keySize) + if err != nil { + return fmt.Errorf("failed to generate a new keypair: %s", err) + } + var publicKeyAsnBytes []byte + if publicKeyAsnBytes, err = x509.MarshalPKIXPublicKey(privateKey.Public()); err != nil { + return fmt.Errorf("failed to marshal the public part of the new keypair: %s", err.Error()) + } + publicKeyPemRaw := pem.EncodeToMemory(&pem.Block{ + Type: "PUBLIC KEY", + Bytes: publicKeyAsnBytes, + }) + s.privateKey = privateKey + s.publicKeyPemRaw = publicKeyPemRaw + + return nil +} + +func (s *inMemoryCacheableSessionKeySupplier) Revert() { + s.privateKey = s.cachedPrivateKey + if s.cachedPublicKeyPemRaw != nil { + s.publicKeyPemRaw = make([]byte, len(s.cachedPublicKeyPemRaw)) + copy(s.publicKeyPemRaw, s.cachedPublicKeyPemRaw) + } else { + s.publicKeyPemRaw = nil + } +} + type securityToken interface { fmt.Stringer Valid() bool @@ -571,3 +827,219 @@ func (t *principalToken) GetClaim(key string) (interface{}, error) { } return nil, ErrNoSuchClaim } + +// nilSigner is required to avoid common.BaseClient panic. +type nilSigner struct{} + +// Sign fulfills the HTTPRequestSigner interface. +func (e nilSigner) Sign(r *http.Request) error { + return nil +} + +// newIDAuthClient returns a BaseClient that does not sign requests and has the auth +// client circuit breaker +func newIDAuthClient(host string, authBasePath string) *common.BaseClient { + client := common.DefaultBaseClientWithSigner(nilSigner{}) + client.Host = host + client.BasePath = authBasePath + if common.GlobalAuthClientCircuitBreakerSetting != nil { + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.GlobalAuthClientCircuitBreakerSetting) + } else if !common.IsEnvVarFalse("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED") { + common.Logf("Configuring DefaultAuthClientCircuitBreakerSetting for federation client") + client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultAuthClientCircuitBreakerSetting()) + } + return &client +} + +// tokenExchangeResponse provides a struct for unmarshaling tokens. +type tokenExchangeResponse struct { + Token `presentIn:"body"` +} + +// tokenExchangeFederationClient implements federationClient. +type tokenExchangeFederationClient struct { + client *common.BaseClient + securityToken securityToken + privateKey *rsa.PrivateKey + tokenIssuer TokenIssuer + domainUrl string + authCode string + requestData map[string][]string + instancePrincipalProvider common.ConfigurationProvider + mux sync.Mutex +} + +// newTokenExchangeFederationClient creates a federation client. +func newTokenExchangeFederationClient(issuer TokenIssuer, host string, + authCode string, requestData map[string][]string, + instancePrincipalProvider common.ConfigurationProvider) *tokenExchangeFederationClient { + defaultGenericHeaders := []string{"date", "(request-target)", "host"} + bodyHeaders := []string{"content-length", "content-type", "x-content-sha256"} + var client *common.BaseClient + if instancePrincipalProvider != nil { + signer := common.RequestSigner(instancePrincipalProvider, defaultGenericHeaders, bodyHeaders) + baseClient := common.DefaultBaseClientWithSigner(signer) + client = &baseClient + client.Host = host + client.BasePath = "oauth2/v1/token" + } else { + client = newIDAuthClient(host, "/oauth2/v1/token") + } + fc := tokenExchangeFederationClient{ + tokenIssuer: issuer, + client: client, + authCode: authCode, + requestData: requestData, + instancePrincipalProvider: instancePrincipalProvider, + } + return &fc +} + +// PrivateKey receiver implements federationClient interface. Safe for concurrent use. +func (fc *tokenExchangeFederationClient) PrivateKey() (*rsa.PrivateKey, error) { + if err := fc.renewSecurityTokenIfNotValid(); err != nil { + return nil, err + } + return fc.privateKey, nil +} + +// SecurityToken receiver implements federationClient interface. Safe for concurrent +// use. +func (fc *tokenExchangeFederationClient) SecurityToken() (string, error) { + if err := fc.renewSecurityTokenIfNotValid(); err != nil { + return "", err + } + return fmt.Sprintf("ST$%s", fc.securityToken.String()), nil +} + +// GetClaim returns claims embedded in the Security Token. +func (fc *tokenExchangeFederationClient) GetClaim(key string) (interface{}, error) { + if err := fc.renewSecurityTokenIfNotValid(); err != nil { + return nil, fmt.Errorf("unable to retrieve claim: %w", err) + } + return fc.securityToken.GetClaim(key) +} + +// renewSecurityTokenIfNotValid checks if token is valid and initiates refresh if needed. +// Mutex is locked here if an operation is needed to prevent concurrency errors. +func (fc *tokenExchangeFederationClient) renewSecurityTokenIfNotValid() error { + if fc.securityToken == nil || !fc.securityToken.Valid() { + // Lock here to prevent renewSecurityToken from making surplus calls to the + // authorization server and identity domain + fc.mux.Lock() + defer fc.mux.Unlock() + // Ensure token is not renewed by previously blocked operation + if fc.securityToken != nil && fc.securityToken.Valid() { + return nil + } + return fc.renewSecurityToken() + } + return nil +} + +// renewSecurityToken initiates renewal of the Security Token returned by the +// tokenExchangeFederationClient. Should only be called by renewSecurityTokenIfNotValid. +// Rotates RSA key and updates federation client with fresh Security Token and private key. +func (fc *tokenExchangeFederationClient) renewSecurityToken() (err error) { + var token string + // Since we are running arbitrary code, we catch panics and return the cause + // as an error + func() { + // Scope recover around caller-provided code + common.Logf("attempting to retrieve token from issuer") + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("panic occurred during token renewal: %v", r) + } + }() + // Get a fresh token from the issuer + token, err = fc.tokenIssuer.GetToken() + }() + if err != nil { + return fmt.Errorf("unable to refresh JWT: %w", err) + } + privateKey, err := rsa.GenerateKey(rand.Reader, 3072) + if err != nil { + return fmt.Errorf("unable to generate RSA key: %w", err) + } + publicKey, err := privateToPublicDERBase64(privateKey) + if err != nil { + return fmt.Errorf("unable to derive public key: %w", err) + } + securityToken, err := fc.newTokenExchangeToken(token, publicKey) + if err != nil { + return fmt.Errorf("unable to exchange JWT for security token: %w", err) + } + // privateKey and securityToken ONLY updated here while under lock from renewSecurityTokenIfNotValid + fc.privateKey = privateKey + fc.securityToken = securityToken + return nil +} + +// newTokenExchangeToken assembles and returns a tokenExchangeToken issued by OCI. +func (fc *tokenExchangeFederationClient) newTokenExchangeToken(token string, + publicKey string) (tokenExchangeToken, error) { + var t tokenExchangeToken + var err error + // Retry and backoff + maxRetries := 3 + var httpResponse *http.Response + defer common.CloseBodyIfValid(httpResponse) + for retry := 1; retry <= maxRetries; retry++ { + common.Logf("attempt %d to retrieve Security Token", retry) + form := make(url.Values, 0) + maps.Copy(form, fc.requestData) + form.Set("public_key", publicKey) + if token != "" { + form.Set("subject_token", token) + } + formString := form.Encode() + formBody := strings.NewReader(formString) + httpRequest, err := http.NewRequest(http.MethodPost, fc.client.Host, formBody) + if err != nil { + return t, fmt.Errorf("failed to make request to token endpoint: %w", err) + } + httpRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded") + if fc.instancePrincipalProvider != nil { + httpRequest.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) + } else if fc.authCode != "" { + httpRequest.Header.Set("Authorization", "Basic "+fc.authCode) + } + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + response, err := fc.client.Call(ctx, httpRequest) + if (err == nil && response.StatusCode == http.StatusOK) || + // Do not retry 4XX response codes + (response != nil && response.StatusCode >= 400 && response.StatusCode <= 499) || + // Skip last sleep on max attempts + (retry == maxRetries) { + httpResponse = response + cancel() + break + } + if response != nil { + common.Logf("invalid response from domain: %s", response.Status) + } else { + common.Logf("invalid response from domain: %v", err) + } + common.CloseBodyIfValid(response) + cancel() + sleep := time.Duration(1000.0*(math.Pow(2.0, float64(retry)))) * time.Millisecond + time.Sleep(sleep) + } + if httpResponse == nil { + return t, fmt.Errorf("no response from domain") + } + if httpResponse.StatusCode != http.StatusOK { + return t, fmt.Errorf("invalid token endpoint response %s", httpResponse.Status) + } + responseBody := tokenExchangeResponse{} + if err = common.UnmarshalResponse(httpResponse, &responseBody); err != nil { + return t, fmt.Errorf("failed to unmarshal response: %w", err) + } + parsedToken, err := parseJwt(responseBody.Token.Token) + if err != nil { + return t, fmt.Errorf("unable to parse token: %w", err) + } + t.token = *parsedToken + return t, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client_oke_workload_identity.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client_oke_workload_identity.go index e63d5b4f6..a134d519e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client_oke_workload_identity.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client_oke_workload_identity.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth @@ -11,12 +11,13 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "github.com/oracle/oci-go-sdk/v65/common/utils" "io" "net/http" "sync" "time" + + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/utils" ) const ( @@ -26,29 +27,49 @@ const ( // Workload RPST Issuance Service (WRIS) // x509FederationClientForOkeWorkloadIdentity retrieves a security token from Auth service. type x509FederationClientForOkeWorkloadIdentity struct { - tenancyID string - sessionKeySupplier sessionKeySupplier - securityToken securityToken - authClient *common.BaseClient - mux sync.Mutex - proxymuxEndpoint string - kubernetesServiceAccountToken string // jwt - kubernetesServiceAccountCert *x509.CertPool + tenancyID string + sessionKeySupplier sessionKeySupplier + securityToken securityToken + authClient *common.BaseClient + httpClient *http.Client + mux sync.Mutex + proxymuxEndpoint string + saTokenProvider ServiceAccountTokenProvider + kubernetesServiceAccountCert *x509.CertPool } -func newX509FederationClientForOkeWorkloadIdentity(endpoint string, kubernetesServiceAccountToken string, +func newX509FederationClientForOkeWorkloadIdentity(endpoint string, saTokenProvider ServiceAccountTokenProvider, kubernetesServiceAccountCert *x509.CertPool) (federationClient, error) { client := &x509FederationClientForOkeWorkloadIdentity{ - proxymuxEndpoint: endpoint, - kubernetesServiceAccountToken: kubernetesServiceAccountToken, - kubernetesServiceAccountCert: kubernetesServiceAccountCert, + proxymuxEndpoint: endpoint, + saTokenProvider: saTokenProvider, + kubernetesServiceAccountCert: kubernetesServiceAccountCert, } client.sessionKeySupplier = newSessionKeySupplier() + client.httpClient = newOkeWorkloadIdentityHTTPClient(kubernetesServiceAccountCert) return client, nil } +func newOkeWorkloadIdentityHTTPClient(kubernetesServiceAccountCert *x509.CertPool) *http.Client { + return &http.Client{ + Timeout: 30 * time.Second, + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + RootCAs: kubernetesServiceAccountCert, + }, + }, + } +} + +func (c *x509FederationClientForOkeWorkloadIdentity) proxymuxHTTPClient() *http.Client { + if c.httpClient == nil { + c.httpClient = newOkeWorkloadIdentityHTTPClient(c.kubernetesServiceAccountCert) + } + return c.httpClient +} + func (c *x509FederationClientForOkeWorkloadIdentity) renewSecurityToken() (err error) { if err = c.sessionKeySupplier.Refresh(); err != nil { return fmt.Errorf("failed to refresh session key: %s", err.Error()) @@ -72,34 +93,35 @@ type token struct { // getSecurityToken get security token from Proxymux func (c *x509FederationClientForOkeWorkloadIdentity) getSecurityToken() (securityToken, error) { - client := http.Client{ - Timeout: 30 * time.Second, - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{ - RootCAs: c.kubernetesServiceAccountCert, - }, - }, - } - publicKey := string(c.sessionKeySupplier.PublicKeyPemRaw()) + common.Logf("Public Key for OKE Workload Identity is:", publicKey) rawPayload := workloadIdentityRequestPayload{Podkey: publicKey} payload, err := json.Marshal(rawPayload) if err != nil { return nil, fmt.Errorf("error getting security token%s", err) } + common.Logf("Payload for OKE Workload Identity is:", string(payload)) request, err := http.NewRequest(http.MethodPost, c.proxymuxEndpoint, bytes.NewBuffer(payload)) if err != nil { common.Logf("error %s", err) return nil, fmt.Errorf("error getting security token %s", err) } - request.Header.Add("Authorization", "Bearer "+c.kubernetesServiceAccountToken) + + kubernetesServiceAccountToken, err := c.saTokenProvider.ServiceAccountToken() + if err != nil { + common.Logf("error %s", err) + return nil, fmt.Errorf("error getting service account token %s", err) + } + + common.Logf("Service Account Token for OKE Workload Identity is: ", kubernetesServiceAccountToken) + request.Header.Add("Authorization", "Bearer "+kubernetesServiceAccountToken) request.Header.Set("Content-Type", "application/json") opcRequestID := utils.GenerateOpcRequestID() request.Header.Set("opc-request-id", opcRequestID) - response, err := client.Do(request) + response, err := c.proxymuxHTTPClient().Do(request) if err != nil { return nil, fmt.Errorf("error %s", err) } @@ -112,35 +134,42 @@ func (c *x509FederationClientForOkeWorkloadIdentity) getSecurityToken() (securit } }(response.Body) + // Ensure body is read before returning, to allow connection reuse. + if _, err = body.ReadFrom(response.Body); err != nil { + return nil, fmt.Errorf("error reading Workload Identity token generation response: %s. Please contact OKE team", err) + } + statusCode := response.StatusCode if statusCode != http.StatusOK { - return nil, fmt.Errorf("failed to get a RPST token from Proxymux: URL: %s, Status: %s, Message: %s", - c.proxymuxEndpoint, response.Status, body.String()) - } + if statusCode == http.StatusForbidden { + return nil, fmt.Errorf("please ensure the cluster type is enhanced: Status: %s, Message: %s", + response.Status, body.String()) + } else { + return nil, fmt.Errorf("failed to get a Workload Identity token. Status: %s, Message: %s. Please contact OKE team", + response.Status, body.String()) + } - if _, err = body.ReadFrom(response.Body); err != nil { - return nil, fmt.Errorf("error reading body from Proxymux response: %s", err) } rawBody := body.String() rawBody = rawBody[1 : len(rawBody)-1] decodedBodyStr, err := base64.StdEncoding.DecodeString(rawBody) if err != nil { - return nil, fmt.Errorf("error decoding Proxymux response using base64 scheme: %s", err) + return nil, fmt.Errorf("error decoding Workload Identity token: %s. Please contact OKE team", err) } var parsedBody token err = json.Unmarshal(decodedBodyStr, &parsedBody) if err != nil { - return nil, fmt.Errorf("error parsing Proxymux response body: %s", err) + return nil, fmt.Errorf("error parsing Workload Identity token: %s. Please contact OKE team", err) } token := parsedBody.Token - if &token == nil || len(token) == 0 { - return nil, fmt.Errorf("invalid (empty) token received from Proxymux") + if len(token) == 0 { + return nil, fmt.Errorf("invalid (empty) Workload Identity token received. Please contact OKE team") } if len(token) < 3 { - return nil, fmt.Errorf("invalid token received from Proxymux") + return nil, fmt.Errorf("invalid Workload Identity token received. Please contact OKE team") } return newPrincipalToken(token[3:]) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_delegation_token_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_delegation_token_provider.go index b793d0637..94adec771 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_delegation_token_provider.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_delegation_token_provider.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_key_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_key_provider.go index d4a4f97a9..0f365ab4d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_key_provider.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_key_provider.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth @@ -7,16 +7,17 @@ import ( "bytes" "crypto/rsa" "fmt" + "math/rand" "net/http" - "strings" + "os" "time" "github.com/oracle/oci-go-sdk/v65/common" ) const ( - metadataBaseURL = `http://169.254.169.254/opc/v2` - metadataFallbackURL = `http://169.254.169.254/opc/v1` + defaultMetadataBaseURL = `http://169.254.169.254/opc/v2` + metadataBaseURLEnvVar = `OCI_METADATA_BASE_URL` regionPath = `/instance/region` leafCertificatePath = `/identity/cert.pem` leafCertificateKeyPath = `/identity/key.pem` @@ -59,7 +60,7 @@ func (ipe instancePrincipalError) Error() string { // KeyID that is not expired at the moment, the PrivateRSAKey that the client acquires at a next moment could be // invalid because the KeyID could be already expired. func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (provider *instancePrincipalKeyProvider, err error) { - updateX509CertRetrieverURLParas(metadataBaseURL) + updateX509CertRetrieverURLParas(getMetadataBaseURL()) clientModifier := newDispatcherModifier(modifier) client, err := clientModifier.Modify(&http.Client{}) @@ -104,19 +105,19 @@ func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher) func getRegionForFederationClient(dispatcher common.HTTPRequestDispatcher, url string) (r common.Region, err error) { var body bytes.Buffer var statusCode int - MaxRetriesFederationClient := 3 + MaxRetriesFederationClient := 8 for currTry := 0; currTry < MaxRetriesFederationClient; currTry++ { body, statusCode, err = httpGet(dispatcher, url) if err == nil && statusCode == 200 { return common.StringToRegion(body.String()), nil } common.Logf("Error in getting region from url: %s, Status code: %v, Error: %s", url, statusCode, err.Error()) - if statusCode == 404 && strings.Compare(url, metadataBaseURL+regionPath) == 0 { - common.Logf("Falling back to http://169.254.169.254/opc/v1 to try again...") - updateX509CertRetrieverURLParas(metadataFallbackURL) - url = regionURL + nextDuration := time.Duration(float64(int(1)< 30*time.Second { + nextDuration = 30*time.Second + time.Duration(rand.Float64())*time.Second } - time.Sleep(1 * time.Second) + common.Logf("Retrying for getRegionForFederationClinet function, current retry count is:%v, sleep after %v", currTry+1, nextDuration) + time.Sleep(nextDuration) } return } @@ -157,3 +158,12 @@ func (p *instancePrincipalKeyProvider) TenancyOCID() (string, error) { func (p *instancePrincipalKeyProvider) Refreshable() bool { return true } + +// Gets the Meta Data Base url from the Environment variable SNTL_METADATA_BASE_URL +// If it is not present, returns default value instead +func getMetadataBaseURL() string { + if baseURL := os.Getenv(metadataBaseURLEnvVar); baseURL != "" { + return baseURL + } + return defaultMetadataBaseURL +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/jwt.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/jwt.go index 36d79b7a1..a87706a02 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/jwt.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/jwt.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/oauth2_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/oauth2_provider.go new file mode 100644 index 000000000..56b61043d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/oauth2_provider.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package auth + +import ( + "crypto/rsa" + "fmt" + + "github.com/oracle/oci-go-sdk/v65/common" +) + +// OAuth2ConfigurationProvider provides Oauth2 type authentication +type OAuth2ConfigurationProvider struct { + federationClient federationClient + sessionKeySupplier cacheableSessionKeySupplier + region string +} + +// NewOAuth2ConfigurationProvider builds an OAuth2ConfigurationProvider from an existing config provider, and auth endpoint parameters +// The config provider can be for instance, resource, or service principals. +func NewOAuth2ConfigurationProvider(configProvider common.ConfigurationProvider, scope string, targetCompartment string) (common.ConfigurationProvider, error) { + sessionKeySupplier := newCacheableSessionKeySupplier() + region, err := configProvider.Region() + if err != nil { + return nil, fmt.Errorf("failed to get region from configProvider: %s", err.Error()) + } + federationClient, err := newOAuth2FederationClient(configProvider, scope, targetCompartment, sessionKeySupplier) + if err != nil { + err = fmt.Errorf("failed to create auth provider: %w", err) + return nil, err + } + return &OAuth2ConfigurationProvider{ + federationClient: federationClient, + sessionKeySupplier: sessionKeySupplier, + region: region, + }, nil +} + +// KeyID checks if the current security token is valid, and retrieves a new token from Auth Service if not +func (p OAuth2ConfigurationProvider) KeyID() (string, error) { + var securityToken string + var err error + if securityToken, err = p.federationClient.SecurityToken(); err != nil { + err = fmt.Errorf("failed to get security token: %s", err.Error()) + return "", err + } + return fmt.Sprintf("ST$%s", securityToken), nil +} + +// PrivateRSAKey returns the private key of the session key supplier created for the OAuth Provider +func (p OAuth2ConfigurationProvider) PrivateRSAKey() (privateKey *rsa.PrivateKey, err error) { + if privateKey, err = p.federationClient.PrivateKey(); err != nil { + err = fmt.Errorf("failed to get private key: %s", err.Error()) + return nil, err + } + return privateKey, nil +} + +func (p OAuth2ConfigurationProvider) SecurityToken() (string, error) { + return p.federationClient.SecurityToken() +} + +func (p OAuth2ConfigurationProvider) TenancyOCID() (string, error) { + return "", nil +} + +func (p OAuth2ConfigurationProvider) UserOCID() (string, error) { + return "", nil +} + +func (p OAuth2ConfigurationProvider) KeyFingerprint() (string, error) { + return "", nil +} + +func (p OAuth2ConfigurationProvider) Region() (string, error) { + return p.region, nil +} + +func (p OAuth2ConfigurationProvider) AuthType() (common.AuthConfig, error) { + return common.AuthConfig{AuthType: common.OAuthDelegationToken}, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_delegation_token_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_delegation_token_provider.go new file mode 100644 index 000000000..d00c48a21 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_delegation_token_provider.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package auth + +import ( + "crypto/rsa" + "fmt" + + "github.com/oracle/oci-go-sdk/v65/common" +) + +type resourcePrincipalDelegationTokenConfigurationProvider struct { + resourcePrincipalKeyProvider ConfigurationProviderWithClaimAccess + delegationToken string + region *common.Region +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { + return r.resourcePrincipalKeyProvider.PrivateRSAKey() +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) KeyID() (string, error) { + return r.resourcePrincipalKeyProvider.KeyID() +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) TenancyOCID() (string, error) { + return r.resourcePrincipalKeyProvider.TenancyOCID() +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) UserOCID() (string, error) { + return "", nil +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) KeyFingerprint() (string, error) { + return "", nil +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) Region() (string, error) { + if r.region == nil { + common.Debugf("Region in resource principal delegation token configuration provider is nil. Returning configuration provider region: %s", r.region) + return r.resourcePrincipalKeyProvider.Region() + } + return string(*r.region), nil +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) AuthType() (common.AuthConfig, error) { + token := r.delegationToken + return common.AuthConfig{AuthType: common.ResourcePrincipalDelegationToken, OboToken: &token}, nil +} + +func (r resourcePrincipalDelegationTokenConfigurationProvider) GetClaim(key string) (interface{}, error) { + return r.resourcePrincipalKeyProvider.GetClaim(key) +} + +type resourcePrincipalDelegationTokenError struct { + err error +} + +func (rpe resourcePrincipalDelegationTokenError) Error() string { + return fmt.Sprintf("%s\nResource principals delegation token authentication can only be used on specific OCI services. Please confirm this code is running on the correct environment", rpe.err.Error()) +} + +// ResourcePrincipalDelegationTokenConfigurationProvider returns a configuration for obo token resource principals +func ResourcePrincipalDelegationTokenConfigurationProvider(delegationToken *string) (ConfigurationProviderWithClaimAccess, error) { + if delegationToken == nil || len(*delegationToken) == 0 { + return nil, resourcePrincipalDelegationTokenError{err: fmt.Errorf("failed to create a delagationTokenConfigurationProvider: token is a mandatory input parameter")} + } + return newResourcePrincipalDelegationTokenConfigurationProvider(delegationToken, "", nil) +} + +// ResourcePrincipalDelegationTokenConfigurationProviderForRegion returns a configuration for obo token resource principals with a given region +func ResourcePrincipalDelegationTokenConfigurationProviderForRegion(delegationToken *string, region common.Region) (ConfigurationProviderWithClaimAccess, error) { + if delegationToken == nil || len(*delegationToken) == 0 { + return nil, resourcePrincipalDelegationTokenError{err: fmt.Errorf("failed to create a delagationTokenConfigurationProvider: token is a mandatory input parameter")} + } + return newResourcePrincipalDelegationTokenConfigurationProvider(delegationToken, region, nil) +} + +func newResourcePrincipalDelegationTokenConfigurationProvider(delegationToken *string, region common.Region, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (ConfigurationProviderWithClaimAccess, error) { + + keyProvider, err := ResourcePrincipalConfigurationProvider() + if err != nil { + return nil, resourcePrincipalDelegationTokenError{err: fmt.Errorf("failed to create a new key provider for resource principal: %s", err.Error())} + } + if len(region) > 0 { + return resourcePrincipalDelegationTokenConfigurationProvider{keyProvider, *delegationToken, ®ion}, err + } + return resourcePrincipalDelegationTokenConfigurationProvider{keyProvider, *delegationToken, nil}, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resouce_principal_key_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_key_provider.go similarity index 70% rename from vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resouce_principal_key_provider.go rename to vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_key_provider.go index a2d4e1ba4..9f2971aa4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resouce_principal_key_provider.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_key_provider.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth @@ -35,10 +35,29 @@ const ( ResourcePrincipalSessionTokenEndpoint = "OCI_RESOURCE_PRINCIPAL_RPST_ENDPOINT" //ResourcePrincipalTokenEndpoint endpoint for retrieving the Resource Principal Token ResourcePrincipalTokenEndpoint = "OCI_RESOURCE_PRINCIPAL_RPT_ENDPOINT" + + //ResourcePrincipalVersion3_0 is a supported version for resource principals + ResourcePrincipalVersion3_0 = "3.0" + ResourcePrincipalVersionForLeaf = "OCI_RESOURCE_PRINCIPAL_VERSION_FOR_LEAF_RESOURCE" + ResourcePrincipalRptEndpointForLeaf = "OCI_RESOURCE_PRINCIPAL_RPT_ENDPOINT_FOR_LEAF_RESOURCE" + ResourcePrincipalRptPathForLeaf = "OCI_RESOURCE_PRINCIPAL_RPT_PATH_FOR_LEAF_RESOURCE" + ResourcePrincipalRpstEndpointForLeaf = "OCI_RESOURCE_PRINCIPAL_RPST_ENDPOINT_FOR_LEAF_RESOURCE" + ResourcePrincipalResourceIdForLeaf = "OCI_RESOURCE_PRINCIPAL_RESOURCE_ID_FOR_LEAF_RESOURCE" + ResourcePrincipalPrivatePemForLeaf = "OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM_FOR_LEAF_RESOURCE" + ResourcePrincipalPrivatePemPassphraseForLeaf = "OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM_PASSPHRASE_FOR_LEAF_RESOURCE" + ResourcePrincipalRpstForLeaf = "OCI_RESOURCE_PRINCIPAL_RPST_FOR_LEAF_RESOURCE" + ResourcePrincipalRegionForLeaf = "OCI_RESOURCE_PRINCIPAL_REGION_FOR_LEAF_RESOURCE" + ResourcePrincipalRptURLForParent = "OCI_RESOURCE_PRINCIPAL_RPT_URL_FOR_PARENT_RESOURCE" + ResourcePrincipalRpstEndpointForParent = "OCI_RESOURCE_PRINCIPAL_RPST_ENDPOINT_FOR_PARENT_RESOURCE" + ResourcePrincipalTenancyIDForLeaf = "OCI_RESOURCE_PRINCIPAL_TENANCY_ID_FOR_LEAF_RESOURCE" + OpcParentRptUrlHeader = "opc-parent-rpt-url" + // KubernetesServiceAccountTokenPath that contains cluster information KubernetesServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" - // KubernetesServiceAccountCertPath that contains cluster information - KubernetesServiceAccountCertPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + // DefaultKubernetesServiceAccountCertPath that contains cluster information + DefaultKubernetesServiceAccountCertPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + // OciKubernetesServiceAccountCertPath Environment variable for Kubernetes Service Account Cert Path + OciKubernetesServiceAccountCertPath = "OCI_KUBERNETES_SERVICE_ACCOUNT_CERT_PATH" // KubernetesServiceHostEnvVar environment var holding the kubernetes host KubernetesServiceHostEnvVar = "KUBERNETES_SERVICE_HOST" // KubernetesProxymuxServicePort environment var holding the kubernetes port @@ -88,6 +107,8 @@ func ResourcePrincipalConfigurationProvider() (ConfigurationProviderWithClaimAcc *rpst, *private, passphrase, *region) case ResourcePrincipalVersion1_1: return newResourcePrincipalKeyProvider11(DefaultRptPathProvider{}) + case ResourcePrincipalVersion3_0: + return newResourcePrincipalKeyProvider30() default: err := fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar) return nil, resourcePrincipalError{err: err} @@ -96,6 +117,12 @@ func ResourcePrincipalConfigurationProvider() (ConfigurationProviderWithClaimAcc // OkeWorkloadIdentityConfigurationProvider returns a resource principal configuration provider by OKE Workload Identity func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimAccess, error) { + return OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider(NewDefaultServiceAccountTokenProvider()) +} + +// OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider returns a resource principal configuration provider by OKE Workload Identity +// with service account token provider +func OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider(saTokenProvider ServiceAccountTokenProvider) (ConfigurationProviderWithClaimAccess, error) { var version string var ok bool if version, ok = os.LookupEnv(ResourcePrincipalVersionEnvVar); !ok { @@ -104,17 +131,17 @@ func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimA } if version == ResourcePrincipalVersion1_1 || version == ResourcePrincipalVersion2_2 { - kubernetesServiceAccountToken, err := ioutil.ReadFile(KubernetesServiceAccountTokenPath) - if err != nil { - err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", - KubernetesServiceAccountTokenPath) - return nil, resourcePrincipalError{err: err} + + saCertPath := requireEnv(OciKubernetesServiceAccountCertPath) + + if saCertPath == nil { + tmp := DefaultKubernetesServiceAccountCertPath + saCertPath = &tmp } - kubernetesServiceAccountCertRaw, err := ioutil.ReadFile(KubernetesServiceAccountCertPath) + kubernetesServiceAccountCertRaw, err := ioutil.ReadFile(*saCertPath) if err != nil { - err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", - KubernetesServiceAccountCertPath) + err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", *saCertPath) return nil, resourcePrincipalError{err: err} } @@ -136,14 +163,48 @@ func OkeWorkloadIdentityConfigurationProvider() (ConfigurationProviderWithClaimA } proxymuxEndpoint := fmt.Sprintf("https://%s:%s/resourcePrincipalSessionTokens", *k8sServiceHost, KubernetesProxymuxServicePort) - return newOkeWorkloadIdentityProvider(proxymuxEndpoint, string(kubernetesServiceAccountToken), - kubernetesServiceAccountCert, *region) + return newOkeWorkloadIdentityProvider(proxymuxEndpoint, saTokenProvider, kubernetesServiceAccountCert, *region) } err := fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar) return nil, resourcePrincipalError{err: err} } +func OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProviderK8sService(k8sServiceHost *string, saTokenProvider ServiceAccountTokenProvider, remoteCAbytes []byte) (ConfigurationProviderWithClaimAccess, error) { + saCertPath := requireEnv(OciKubernetesServiceAccountCertPath) + + if saCertPath == nil { + tmp := DefaultKubernetesServiceAccountCertPath + saCertPath = &tmp + } + + kubernetesServiceAccountCertRaw, err := ioutil.ReadFile(*saCertPath) + if err != nil { + err = fmt.Errorf("can not create resource principal, error getting Kubernetes Service Account Token at %s", *saCertPath) + return nil, resourcePrincipalError{err: err} + } + + kubernetesServiceAccountCert := x509.NewCertPool() + kubernetesServiceAccountCert.AppendCertsFromPEM(kubernetesServiceAccountCertRaw) + if ok := kubernetesServiceAccountCert.AppendCertsFromPEM(remoteCAbytes); !ok { + err := fmt.Errorf("failed to load remote CA") + return nil, resourcePrincipalError{err: err} + } + + region := requireEnv(ResourcePrincipalRegionEnvVar) + if region == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", + ResourcePrincipalRegionEnvVar) + return nil, resourcePrincipalError{err: err} + } + + proxymuxEndpoint := fmt.Sprintf("https://%s:%s/resourcePrincipalSessionTokens", *k8sServiceHost, KubernetesProxymuxServicePort) + + return newOkeWorkloadIdentityProvider(proxymuxEndpoint, saTokenProvider, kubernetesServiceAccountCert, *region) + + return nil, resourcePrincipalError{err: err} +} + // ResourcePrincipalConfigurationProviderForRegion returns a resource principal configuration provider using well known // environment variables to look up token information, for a given region. The environment variables can either paths or contain the material value // of the keys. However, in the case of the keys and tokens paths and values can not be mixed @@ -288,11 +349,56 @@ func newResourcePrincipalKeyProvider22(sessionTokenLocation, privatePemLocation return &rs, nil } -func newOkeWorkloadIdentityProvider(proxymuxEndpoint string, kubernetesServiceAccountToken string, +func newResourcePrincipalKeyProvider30() (ConfigurationProviderWithClaimAccess, error) { + rpVersionForLeafResource := requireEnv(ResourcePrincipalVersionForLeaf) + if rpVersionForLeafResource == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalVersionForLeaf) + return nil, resourcePrincipalError{err: err} + } + var leafResourceAuthProvider ConfigurationProviderWithClaimAccess + var err error + switch *rpVersionForLeafResource { + case ResourcePrincipalVersion1_1: + leafResourceAuthProvider, err = newResourcePrincipalKeyProvider11(RptPathProviderForLeafResource{}) + if err != nil { + return nil, err + } + return ResourcePrincipalConfigurationProviderV3(leafResourceAuthProvider) + case ResourcePrincipalVersion2_2: + rpst := requireEnv(ResourcePrincipalRpstForLeaf) + if rpst == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalRpstForLeaf) + return nil, resourcePrincipalError{err: err} + } + private := requireEnv(ResourcePrincipalPrivatePemForLeaf) + if private == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalPrivatePemForLeaf) + return nil, resourcePrincipalError{err: err} + } + passphrase := requireEnv(ResourcePrincipalPrivatePemPassphraseForLeaf) + region := requireEnv(ResourcePrincipalRegionForLeaf) + if region == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalRegionForLeaf) + return nil, resourcePrincipalError{err: err} + } + leafResourceAuthProvider, err = newResourcePrincipalKeyProvider22( + *rpst, *private, passphrase, *region) + if err != nil { + return nil, err + } + return ResourcePrincipalConfigurationProviderV3(leafResourceAuthProvider) + default: + err := fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionForLeaf) + return nil, resourcePrincipalError{err: err} + + } +} + +func newOkeWorkloadIdentityProvider(proxymuxEndpoint string, saTokenProvider ServiceAccountTokenProvider, kubernetesServiceAccountCert *x509.CertPool, region string) (*resourcePrincipalKeyProvider, error) { var err error var fd federationClient - fd, err = newX509FederationClientForOkeWorkloadIdentity(proxymuxEndpoint, kubernetesServiceAccountToken, kubernetesServiceAccountCert) + fd, err = newX509FederationClientForOkeWorkloadIdentity(proxymuxEndpoint, saTokenProvider, kubernetesServiceAccountCert) if err != nil { err := fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_token_path_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_token_path_provider.go index 599b5ca4d..8407e0096 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_token_path_provider.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_token_path_provider.go @@ -1,12 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "fmt" + "github.com/oracle/oci-go-sdk/v65/common" "io/ioutil" "net/http" + "time" ) const ( @@ -116,6 +118,33 @@ func (pp DefaultRptPathProvider) ResourceID() (*string, error) { return rpID, nil } +type RptPathProviderForLeafResource struct { + path string + resourceID string +} + +func (pp RptPathProviderForLeafResource) Path() (*string, error) { + path := requireEnv(ResourcePrincipalRptPathForLeaf) + if path == nil { + rpPath := imdsPathTemplate + return &rpPath, nil + } + return path, nil +} + +// ResourceID returns the resource associated with the resource principal +func (pp RptPathProviderForLeafResource) ResourceID() (*string, error) { + rpID := requireEnv(ResourcePrincipalResourceIdForLeaf) + if rpID == nil { + instanceID, err := getInstanceIDFromMetadata() + if err != nil { + return nil, err + } + return &instanceID, nil + } + return rpID, nil +} + func getInstanceIDFromMetadata() (instanceID string, err error) { client := &http.Client{} req, err := http.NewRequest("GET", instanceIDURL, nil) @@ -136,3 +165,83 @@ func getInstanceIDFromMetadata() (instanceID string, err error) { bodyString := string(bodyBytes) return bodyString, nil } + +// ServiceAccountTokenProvider comment +type ServiceAccountTokenProvider interface { + ServiceAccountToken() (string, error) +} + +// DefaultServiceAccountTokenProvider is supplied by user when instantiating +// OkeWorkloadIdentityConfigurationProvider +type DefaultServiceAccountTokenProvider struct { + tokenPath string `mandatory:"false"` +} + +// NewDefaultServiceAccountTokenProvider returns a new instance of defaultServiceAccountTokenProvider +func NewDefaultServiceAccountTokenProvider() DefaultServiceAccountTokenProvider { + return DefaultServiceAccountTokenProvider{ + tokenPath: KubernetesServiceAccountTokenPath, + } +} + +// WithSaTokenPath Builder method to override the to SA ken path +func (d DefaultServiceAccountTokenProvider) WithSaTokenPath(tokenPath string) DefaultServiceAccountTokenProvider { + d.tokenPath = tokenPath + return d +} + +// ServiceAccountToken returns a service account token +func (d DefaultServiceAccountTokenProvider) ServiceAccountToken() (string, error) { + saTokenString, err := ioutil.ReadFile(d.tokenPath) + if err != nil { + common.Logf("error %s", err) + return "", fmt.Errorf("error reading service account token: %s", err) + } + isSaTokenValid, err := isValidSaToken(string(saTokenString)) + if !isSaTokenValid { + common.Logf("error %s", err) + return "", fmt.Errorf("error validating service account token: %s", err) + } + return string(saTokenString), err +} + +// SuppliedServiceAccountTokenProvider is supplied by user when instantiating +// OkeWorkloadIdentityConfigurationProviderWithServiceAccountTokenProvider +type SuppliedServiceAccountTokenProvider struct { + tokenString string `mandatory:"false"` +} + +// NewSuppliedServiceAccountTokenProvider returns a new instance of defaultServiceAccountTokenProvider +func NewSuppliedServiceAccountTokenProvider(tokenString string) SuppliedServiceAccountTokenProvider { + return SuppliedServiceAccountTokenProvider{tokenString: tokenString} +} + +// ServiceAccountToken returns a service account token +func (d SuppliedServiceAccountTokenProvider) ServiceAccountToken() (string, error) { + isSaTokenValid, err := isValidSaToken(d.tokenString) + if !isSaTokenValid { + common.Logf("error %s", err) + return "", fmt.Errorf("error validating service account token %s", err) + } + return d.tokenString, nil +} + +// isValidSaToken returns true is a saTokenString provides a valid service account token +func isValidSaToken(saTokenString string) (bool, error) { + var jwtToken *jwtToken + var err error + if jwtToken, err = parseJwt(saTokenString); err != nil { + return false, fmt.Errorf("failed to parse the default service token string \"%s\": %s", saTokenString, err.Error()) + } + now := time.Now().Unix() + int64(bufferTimeBeforeTokenExpiration.Seconds()) + if jwtToken.payload["exp"] == nil { + return false, fmt.Errorf("service token doesn't have an `exp` field") + } + expiredAt := int64(jwtToken.payload["exp"].(float64)) + expired := expiredAt <= now + if expired { + return false, fmt.Errorf("service token expired at: %v", time.Unix(expiredAt, 0).Format("15:04:05.000")) + } + + return true, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v1.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v1.go index 4556aedb5..eb7ab5466 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v1.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v1.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v3.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v3.go new file mode 100644 index 000000000..47a985f04 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principals_v3.go @@ -0,0 +1,351 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package auth + +import ( + "context" + "crypto/rsa" + "fmt" + "net/http" + "net/url" + "strings" + "sync" + "time" + + "github.com/oracle/oci-go-sdk/v65/common" +) + +type resourcePrincipalV3Client struct { + securityToken securityToken + mux sync.Mutex + sessionKeySupplier sessionKeySupplier + rptUrl string + rpstUrl string + + leafResourcePrincipalKeyProvider ConfigurationProviderWithClaimAccess + + //ResourcePrincipalTargetServiceClient client that calls the target service to acquire a resource principal token + //ResourcePrincipalTargetServiceClient common.BaseClient + + //ResourcePrincipalSessionTokenClient. The client used to communicate with identity to exchange a resource principal for + // resource principal session token + //ResourcePrincipalSessionTokenClient common.BaseClient +} + +// acquireResourcePrincipalToken acquires the resource principal from the target service +func (c *resourcePrincipalV3Client) acquireResourcePrincipalToken(rptClient common.BaseClient, path string, signer common.HTTPRequestSigner) (tokenResponse resourcePrincipalTokenResponse, parentRptURL string, err error) { + rpServiceClient := rptClient + rpServiceClient.Signer = signer + + //Create a request with the instanceId + request := common.MakeDefaultHTTPRequest(http.MethodGet, path) + + //Call the target service + response, err := rpServiceClient.Call(context.Background(), &request) + if err != nil { + return + } + + defer common.CloseBodyIfValid(response) + + // Extract the opc-parent-rpt-url header value + parentRptURL = response.Header.Get(OpcParentRptUrlHeader) + + tokenResponse = resourcePrincipalTokenResponse{} + err = common.UnmarshalResponse(response, &tokenResponse) + return +} + +// exchangeToken exchanges a resource principal token from the target service with a session token from identity +func (c *resourcePrincipalV3Client) exchangeToken(rpstClient common.BaseClient, signer common.HTTPRequestSigner, publicKeyBase64 string, tokenResponse resourcePrincipalTokenResponse) (sessionToken string, err error) { + rpServiceClient := rpstClient + rpServiceClient.Signer = signer + + // Call identity service to get resource principal session token + sessionTokenReq := resourcePrincipalSessionTokenRequest{ + resourcePrincipalSessionTokenRequestBody{ + ServicePrincipalSessionToken: tokenResponse.Body.ServicePrincipalSessionToken, + ResourcePrincipalToken: tokenResponse.Body.ResourcePrincipalToken, + SessionPublicKey: publicKeyBase64, + }, + } + + sessionTokenHTTPReq, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, + "", sessionTokenReq) + if err != nil { + return + } + + sessionTokenHTTPRes, err := rpServiceClient.Call(context.Background(), &sessionTokenHTTPReq) + if err != nil { + return + } + defer common.CloseBodyIfValid(sessionTokenHTTPRes) + + sessionTokenRes := x509FederationResponse{} + err = common.UnmarshalResponse(sessionTokenHTTPRes, &sessionTokenRes) + if err != nil { + return + } + + sessionToken = sessionTokenRes.Token.Token + return +} + +// getSecurityToken makes the appropriate calls to acquire a resource principal security token +func (c *resourcePrincipalV3Client) getSecurityToken() (securityToken, error) { + + //c.leafResourcePrincipalKeyProvider.KeyID() + //common.Debugf("Refreshing resource principal token") + + //Read the public key from the session supplier. + pem := c.sessionKeySupplier.PublicKeyPemRaw() + pemSanitized := sanitizeCertificateString(string(pem)) + + return c.getSecurityTokenWithDepth(c.leafResourcePrincipalKeyProvider, 1, c.rptUrl, pemSanitized) + +} + +func (c *resourcePrincipalV3Client) getSecurityTokenWithDepth(keyProvider ConfigurationProviderWithClaimAccess, depth int, rptUrl, publicKey string) (securityToken, error) { + //Build the target service client + rpTargetServiceClient, err := common.NewClientWithConfig(keyProvider) + if err != nil { + return nil, err + } + + rpTokenURL, err := url.Parse(rptUrl) + if err != nil { + return nil, err + } + + common.Debugf("rptURL: %v", rpTokenURL) + + rpTargetServiceClient.Host = rpTokenURL.Scheme + "://" + rpTokenURL.Host + + //Build the identity client for token service + rpTokenSessionClient, err := common.NewClientWithConfig(keyProvider) + if err != nil { + return nil, err + } + + // Set RPST endpoint if passed in from env var, otherwise create it from region + if c.rpstUrl != "" { + rpSessionTokenURL, err := url.Parse(c.rpstUrl) + if err != nil { + return nil, err + } + + rpTokenSessionClient.Host = rpSessionTokenURL.Scheme + "://" + rpSessionTokenURL.Host + } else { + regionStr, err := c.leafResourcePrincipalKeyProvider.Region() + if err != nil { + return nil, fmt.Errorf("missing RPST env var and cannot determine region: %v", err) + } + region := common.StringToRegion(regionStr) + rpTokenSessionClient.Host = fmt.Sprintf("https://%s", region.Endpoint("auth")) + } + + rpTokenSessionClient.BasePath = identityResourcePrincipalSessionTokenPath + + //Acquire resource principal token from target service + common.Debugf("Acquiring resource principal token from target service") + tokenResponse, parentRptURL, err := c.acquireResourcePrincipalToken(rpTargetServiceClient, rpTokenURL.Path, common.DefaultRequestSigner(keyProvider)) + if err != nil { + return nil, err + } + + //Exchange resource principal token for session token from identity + common.Debugf("Exchanging resource principal token for resource principal session token") + sessionToken, err := c.exchangeToken(rpTokenSessionClient, common.DefaultRequestSigner(keyProvider), publicKey, tokenResponse) + if err != nil { + return nil, err + } + + // Base condition for recursion + // return the security token obtained last in the following cases + // 1. if depth is more than 10 + // 2. if opc-parent-rpt-url header is not passed or is empty + // 3. if opc-parent-rpt-url matches the last rpt url + if depth >= 10 || parentRptURL == "" || strings.EqualFold(parentRptURL, rptUrl) { + return newPrincipalToken(sessionToken) + } + + fd, err := newStaticFederationClient(sessionToken, c.sessionKeySupplier) + + if err != nil { + err := fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) + return nil, resourcePrincipalError{err: err} + } + + region, _ := keyProvider.Region() + + configProviderForNextCall := resourcePrincipalKeyProvider{ + fd, common.Region(region), + } + + return c.getSecurityTokenWithDepth(&configProviderForNextCall, depth+1, parentRptURL, publicKey) + +} + +func (c *resourcePrincipalV3Client) renewSecurityToken() (err error) { + if err = c.sessionKeySupplier.Refresh(); err != nil { + return fmt.Errorf("failed to refresh session key: %s", err.Error()) + } + + common.Logf("Renewing security token at: %v\n", time.Now().Format("15:04:05.000")) + if c.securityToken, err = c.getSecurityToken(); err != nil { + return fmt.Errorf("failed to get security token: %s", err.Error()) + } + common.Logf("Security token renewed at: %v\n", time.Now().Format("15:04:05.000")) + + return nil +} + +func (c *resourcePrincipalV3Client) renewSecurityTokenIfNotValid() (err error) { + if c.securityToken == nil || !c.securityToken.Valid() { + if err = c.renewSecurityToken(); err != nil { + return fmt.Errorf("failed to renew resource principal security token: %s", err.Error()) + } + } + return nil +} + +func (c *resourcePrincipalV3Client) PrivateKey() (*rsa.PrivateKey, error) { + c.mux.Lock() + defer c.mux.Unlock() + if err := c.renewSecurityTokenIfNotValid(); err != nil { + return nil, err + } + return c.sessionKeySupplier.PrivateKey(), nil +} + +func (c *resourcePrincipalV3Client) SecurityToken() (token string, err error) { + c.mux.Lock() + defer c.mux.Unlock() + + if err = c.renewSecurityTokenIfNotValid(); err != nil { + return "", err + } + return c.securityToken.String(), nil +} + +type resourcePrincipalKeyProviderV3 struct { + resourcePrincipalClient resourcePrincipalV3Client +} + +type resourcePrincipalV30ConfigurationProvider struct { + keyProvider resourcePrincipalKeyProviderV3 + region *common.Region +} + +func (r *resourcePrincipalV30ConfigurationProvider) Refreshable() bool { + return true +} + +func (r *resourcePrincipalV30ConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { + privateKey, err := r.keyProvider.resourcePrincipalClient.PrivateKey() + if err != nil { + err = fmt.Errorf("failed to get resource principal private key: %s", err.Error()) + return nil, err + } + return privateKey, nil +} + +func (r *resourcePrincipalV30ConfigurationProvider) KeyID() (string, error) { + var securityToken string + var err error + if securityToken, err = r.keyProvider.resourcePrincipalClient.SecurityToken(); err != nil { + return "", fmt.Errorf("failed to get resource principal security token: %s", err.Error()) + } + return fmt.Sprintf("ST$%s", securityToken), nil +} + +func (r *resourcePrincipalV30ConfigurationProvider) TenancyOCID() (string, error) { + return r.keyProvider.resourcePrincipalClient.leafResourcePrincipalKeyProvider.TenancyOCID() +} + +func (r *resourcePrincipalV30ConfigurationProvider) UserOCID() (string, error) { + return "", nil +} + +func (r *resourcePrincipalV30ConfigurationProvider) KeyFingerprint() (string, error) { + return "", nil +} + +func (r *resourcePrincipalV30ConfigurationProvider) Region() (string, error) { + if r.region == nil { + common.Debugf("Region in resource principal configuration provider v30 is nil.") + return "", nil + } + return string(*r.region), nil +} + +func (r *resourcePrincipalV30ConfigurationProvider) AuthType() (common.AuthConfig, error) { + return common.AuthConfig{common.UnknownAuthenticationType, false, nil}, + fmt.Errorf("unsupported, keep the interface") +} + +func (r *resourcePrincipalV30ConfigurationProvider) GetClaim(key string) (interface{}, error) { + //TODO implement me + panic("implement me") +} + +type resourcePrincipalV30ConfiguratorBuilder struct { + leafResourcePrincipalKeyProvider ConfigurationProviderWithClaimAccess + rptUrlForParent, rpstUrlForParent *string +} + +// ResourcePrincipalV3ConfiguratorBuilder creates a new resourcePrincipalV30ConfiguratorBuilder. +func ResourcePrincipalV3ConfiguratorBuilder(leafResourcePrincipalKeyProvider ConfigurationProviderWithClaimAccess) *resourcePrincipalV30ConfiguratorBuilder { + return &resourcePrincipalV30ConfiguratorBuilder{ + leafResourcePrincipalKeyProvider: leafResourcePrincipalKeyProvider, + } +} + +// WithParentRPTURL sets the rptUrlForParent field. +func (b *resourcePrincipalV30ConfiguratorBuilder) WithParentRPTURL(rptUrlForParent string) *resourcePrincipalV30ConfiguratorBuilder { + b.rptUrlForParent = &rptUrlForParent + return b +} + +// WithParentRPSTURL sets the rpstUrlForParent field. +func (b *resourcePrincipalV30ConfiguratorBuilder) WithParentRPSTURL(rpstUrlForParent string) *resourcePrincipalV30ConfiguratorBuilder { + b.rpstUrlForParent = &rpstUrlForParent + return b +} + +// Build creates a ConfigurationProviderWithClaimAccess based on the configured values. +func (b *resourcePrincipalV30ConfiguratorBuilder) Build() (ConfigurationProviderWithClaimAccess, error) { + + if b.rptUrlForParent == nil { + err := fmt.Errorf("can not create resource principal, environment variable: %s, not present", + ResourcePrincipalRptURLForParent) + return nil, resourcePrincipalError{err: err} + } + + if b.rpstUrlForParent == nil { + common.Debugf("Environment variable %s not present, setting to empty string", ResourcePrincipalRpstEndpointForParent) + *b.rpstUrlForParent = "" + } + + rpFedClient := resourcePrincipalV3Client{} + rpFedClient.rptUrl = *b.rptUrlForParent + rpFedClient.rpstUrl = *b.rpstUrlForParent + rpFedClient.sessionKeySupplier = newSessionKeySupplier() + rpFedClient.leafResourcePrincipalKeyProvider = b.leafResourcePrincipalKeyProvider + region, _ := b.leafResourcePrincipalKeyProvider.Region() + + return &resourcePrincipalV30ConfigurationProvider{ + keyProvider: resourcePrincipalKeyProviderV3{rpFedClient}, + region: (*common.Region)(®ion), + }, nil +} + +// ResourcePrincipalConfigurationProviderV3 ResourcePrincipalConfigurationProvider is a function that creates and configures a resource principal. +func ResourcePrincipalConfigurationProviderV3(leafResourcePrincipalKeyProvider ConfigurationProviderWithClaimAccess) (ConfigurationProviderWithClaimAccess, error) { + builder := ResourcePrincipalV3ConfiguratorBuilder(leafResourcePrincipalKeyProvider) + builder.rptUrlForParent = requireEnv(ResourcePrincipalRptURLForParent) + builder.rpstUrlForParent = requireEnv(ResourcePrincipalRpstEndpointForParent) + return builder.Build() +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/utils.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/utils.go index 8583960f8..45c82060e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/utils.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/utils.go @@ -1,12 +1,14 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "bytes" - "crypto/sha1" + "crypto/rsa" + "crypto/sha256" "crypto/x509" + "encoding/base64" "fmt" "net/http" "net/http/httputil" @@ -61,11 +63,11 @@ func extractTenancyIDFromCertificate(cert *x509.Certificate) string { } func fingerprint(certificate *x509.Certificate) string { - fingerprint := sha1.Sum(certificate.Raw) + fingerprint := sha256.Sum256(certificate.Raw) return colonSeparatedString(fingerprint) } -func colonSeparatedString(fingerprint [sha1.Size]byte) string { +func colonSeparatedString(fingerprint [sha256.Size]byte) string { spaceSeparated := fmt.Sprintf("% x", fingerprint) return strings.Replace(spaceSeparated, " ", ":", -1) } @@ -96,3 +98,13 @@ func GetGenericConfigurationProvider(configProvider common.ConfigurationProvider } return configProvider, nil } + +// privateToPublicDERBase64 takes an RSA Private Key and returns a public key in +// DER format. +func privateToPublicDERBase64(pk *rsa.PrivateKey) (string, error) { + publicBytes, err := x509.MarshalPKIXPublicKey(pk.Public()) + if err != nil { + return "", err + } + return base64.StdEncoding.EncodeToString(publicBytes), nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/workload_identity_federation.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/workload_identity_federation.go new file mode 100644 index 000000000..86464478a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/auth/workload_identity_federation.go @@ -0,0 +1,241 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package auth + +import ( + "crypto/md5" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/hex" + "fmt" + "strings" + + "github.com/oracle/oci-go-sdk/v65/common" +) + +type TokenExchangeBuilder struct { + DomainUrl string + ClientId string + ClientSecret string + Region string + RequestedTokenType string + ResType string + RpstExp string + SubjectTokenType string + PublicKey string + InstancePrincipalProvider common.ConfigurationProvider +} + +// TokenIssuer defines a type capable of retrieving tokens for the issuing +// authorization server. +type TokenIssuer interface { + GetToken() (string, error) +} + +// StaticTokenIssuer is a defined TokenIssuer that holds a static token. Not suitable +// for use longer than the validity period of the token. +type StaticTokenIssuer struct { + token string +} + +// GetToken satisfies the TokenIssuer interface for StaticTokenIssuer by returning +// the token held by StaticTokenIssuer. +func (s StaticTokenIssuer) GetToken() (string, error) { + return s.token, nil +} + +// TokenExchangeConfigurationProvider provides OCI configuration via token exchange, +// exposing claims and supporting a custom HTTP client. +type TokenExchangeConfigurationProvider struct { + federationClient federationClient + region common.Region +} + +// TokenExchangeConfigurationProviderFromIssuer creates a Configuration Provider from a +// function provided to retrieve a token from an identity provider. +func TokenExchangeConfigurationProviderFromIssuer(tokenIssuer TokenIssuer, + tokenExchangeBuilder TokenExchangeBuilder) (common.ConfigurationProvider, error) { + + if tokenIssuer == nil { + return nil, fmt.Errorf("invalid TokenIssuer") + } + + var authCode string + if tokenExchangeBuilder.ClientId != "" && tokenExchangeBuilder.ClientSecret != "" { + authCode = base64.StdEncoding.EncodeToString([]byte( + tokenExchangeBuilder.ClientId + ":" + tokenExchangeBuilder.ClientSecret)) + } + + requestData := map[string][]string{ + "grant_type": {"urn:ietf:params:oauth:grant-type:token-exchange"}, + } + + if tokenExchangeBuilder.RequestedTokenType == "" { + return nil, fmt.Errorf("requested_token_type must be provided and non-empty") + } else { + requestData["requested_token_type"] = []string{tokenExchangeBuilder.RequestedTokenType} + } + + if tokenExchangeBuilder.SubjectTokenType != "" { + requestData["subject_token_type"] = []string{tokenExchangeBuilder.SubjectTokenType} + } + + if tokenExchangeBuilder.PublicKey != "" { + requestData["public_key"] = []string{tokenExchangeBuilder.PublicKey} + } + + if tokenExchangeBuilder.RequestedTokenType == "urn:oci:token-type:oci-rpst" { + if tokenExchangeBuilder.ResType != "" { + requestData["res_type"] = []string{tokenExchangeBuilder.ResType} + } else { + return nil, fmt.Errorf("res_type parameter is required when requested_token_type is urn:oci:token-type:oci-rpst") + } + + if tokenExchangeBuilder.RpstExp != "" { + requestData["rpst_exp"] = []string{tokenExchangeBuilder.RpstExp} + } + } + + instancePrincipalProvider := tokenExchangeBuilder.InstancePrincipalProvider + + if instancePrincipalProvider == nil && authCode == "" { + return nil, fmt.Errorf("InstancePrincipalProvider or ClientId and ClientSecret must be provided and non-nil") + } + + fc := newTokenExchangeFederationClient(tokenIssuer, tokenExchangeBuilder.DomainUrl, authCode, requestData, instancePrincipalProvider) + + return TokenExchangeConfigurationProvider{ + federationClient: fc, + region: common.StringToRegion(tokenExchangeBuilder.Region), + }, nil +} + +// TokenExchangeConfigurationProviderFromToken returns a new configuration provider +// from a static token. +func TokenExchangeConfigurationProviderFromToken(token string, tokenExchangeBuilder TokenExchangeBuilder) (common.ConfigurationProvider, error) { + + issuer := StaticTokenIssuer{token: token} + + return TokenExchangeConfigurationProviderFromIssuer(issuer, tokenExchangeBuilder) +} + +func (c TokenExchangeConfigurationProvider) GetClaim(key string) (interface{}, error) { + return c.federationClient.GetClaim(key) +} + +func (c TokenExchangeConfigurationProvider) KeyID() (string, error) { + return c.federationClient.SecurityToken() +} + +func (c TokenExchangeConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { + return c.federationClient.PrivateKey() +} + +// TenancyOCID provides the required receiver for the ConfigurationProvider interface +func (c TokenExchangeConfigurationProvider) TenancyOCID() (string, error) { + claim, err := c.federationClient.GetClaim("tenant") + if err != nil { + return "", err + } + + ocid, ok := claim.(string) + if !ok { + return "", ErrNonStringClaim + } + + return ocid, nil +} + +// UserOCID provides the required receiver for the ConfigurationProvider interface. +func (c TokenExchangeConfigurationProvider) UserOCID() (string, error) { + claim, err := c.federationClient.GetClaim("sub") + if err != nil { + return "", err + } + + ocid, ok := claim.(string) + if !ok { + return "", ErrNonStringClaim + } + + return ocid, nil +} + +// KeyFingerprint provides the required receiver for the ConfigurationProvider +// interface. +func (c TokenExchangeConfigurationProvider) KeyFingerprint() (string, error) { + privateKey, err := c.PrivateRSAKey() + if err != nil { + return "", err + } + der, err := x509.MarshalPKIXPublicKey(privateKey.Public()) + if err != nil { + return "", err + } + + sum := md5.Sum(der) + hexStr := hex.EncodeToString(sum[:]) // 32 hex chars + + var sb strings.Builder + for i := 0; i < len(hexStr); i += 2 { + if i > 0 { + sb.WriteByte(':') + } + sb.WriteString(hexStr[i : i+2]) + } + return sb.String(), nil + +} + +// Region provides the required receiver for the ConfigurationProvider interface. +func (c TokenExchangeConfigurationProvider) Region() (string, error) { + r := string(c.region) + if r == "" { + return "", fmt.Errorf("no region assigned") + } + + return r, nil +} + +// AuthType provides the required receiver for the ConfigurationProvider interface. +func (c TokenExchangeConfigurationProvider) AuthType() (common.AuthConfig, error) { + + return common.AuthConfig{ + AuthType: common.WorkloadIdentityFederation, + IsFromConfigFile: false, + }, nil +} + +// tokenExchangeToken contains token and any related fields. +type tokenExchangeToken struct { + token jwtToken +} + +// String implements fmt.Stringer. +func (t tokenExchangeToken) String() string { + return t.token.raw +} + +// Valid implements the securityToken interface. +func (t tokenExchangeToken) Valid() bool { + return !t.token.expired() +} + +// GetClaim implements the ClaimHolder interface. +func (t tokenExchangeToken) GetClaim(key string) (interface{}, error) { + + // Per RFC7519 parsers should return only the lexically last member in the case + // of duplicate claim names. We check payload first and return if claim found + // and check header only if claim is not found in payload. + if claim, ok := t.token.payload[key]; ok { + return claim, nil + } + + if claim, ok := t.token.header[key]; ok { + return claim, nil + } + + return nil, ErrNoSuchClaim +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/circuit_breaker.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/circuit_breaker.go index 85633f4a9..a58d2b41f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/circuit_breaker.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/circuit_breaker.go @@ -1,10 +1,11 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "fmt" + "math/rand" "net/http" "os" "strconv" @@ -29,6 +30,16 @@ const ( DefaultCircuitBreakerServiceName string = "" // DefaultCircuitBreakerHistoryCount is the default count of failed response history in circuit breaker DefaultCircuitBreakerHistoryCount int = 5 + // MinAuthClientCircuitBreakerResetTimeout is the min value of openStateWindow, which is the wait time before setting the breaker to halfOpen state from open state + MinAuthClientCircuitBreakerResetTimeout = 30 + // MaxAuthClientCircuitBreakerResetTimeout is the max value of openStateWindow, which is the wait time before setting the breaker to halfOpen state from open state + MaxAuthClientCircuitBreakerResetTimeout = 49 + // AuthClientCircuitBreakerName is the default circuit breaker name for the DefaultAuthClientCircuitBreakerSetting + AuthClientCircuitBreakerName = "FederationClientCircuitBreaker" + // AuthClientCircuitBreakerDefaultFailureThreshold is the default requests failure rate for the DefaultAuthClientCircuitBreakerSetting + AuthClientCircuitBreakerDefaultFailureThreshold float64 = 0.65 + // AuthClientCircuitBreakerDefaultMinimumRequests is the default value of minimumRequests in closed status + AuthClientCircuitBreakerDefaultMinimumRequests uint32 = 3 ) // CircuitBreakerSetting wraps all exposed configurable params of circuit breaker @@ -52,7 +63,7 @@ type CircuitBreakerSetting struct { successStatCodeMap map[int]bool // successStatErrCodeMap is the error(s) of StatusCode and ErrorCode returned from service, which should be considered // as the success or failure accounted by circuit breaker - // the default value is {409, "IncorrectState"} + // the default value is {409, "IncorrectState"}, {409, "LockConflict"} successStatErrCodeMap map[StatErrCode]bool // serviceName is the name of the service which can be set using withServiceName option for NewCircuitBreaker. // the default value is empty string @@ -62,7 +73,7 @@ type CircuitBreakerSetting struct { numberOfRecordedHistoryResponse int } -// Convert CircuitBreakerSetting to human-readable string representation +// String Converts CircuitBreakerSetting to human-readable string representation func (cbst CircuitBreakerSetting) String() string { return fmt.Sprintf("{name=%v, isEnabled=%v, closeStateWindow=%v, openStateWindow=%v, failureRateThreshold=%v, minimumRequests=%v, successStatCodeMap=%v, successStatErrCodeMap=%v, serviceName=%v, historyCount=%v}", cbst.name, cbst.isEnabled, cbst.closeStateWindow, cbst.openStateWindow, cbst.failureRateThreshold, cbst.minimumRequests, cbst.successStatCodeMap, cbst.successStatErrCodeMap, cbst.serviceName, cbst.numberOfRecordedHistoryResponse) @@ -77,7 +88,7 @@ type ResponseHistory struct { statusCode int } -// Convert ResponseHistory to human-readable string representation +// String Converts ResponseHistory to human-readable string representation func (rh ResponseHistory) String() string { return fmt.Sprintf("Opc-Req-id - %v\nErrorCode - %v - %v\nErrorMessage - %v\n\n", rh.opcReqID, rh.statusCode, rh.errorCode, rh.errorMessage) } @@ -155,6 +166,7 @@ func NewGoCircuitBreaker(st gobreaker.Settings) *gobreaker.CircuitBreaker { func DefaultCircuitBreakerSetting() *CircuitBreakerSetting { successStatErrCodeMap := map[StatErrCode]bool{ {409, "IncorrectState"}: false, + {409, "LockConflict"}: false, } successStatCodeMap := map[int]bool{ 429: false, @@ -179,6 +191,7 @@ func DefaultCircuitBreakerSetting() *CircuitBreakerSetting { func DefaultCircuitBreakerSettingWithServiceName(servicename string) *CircuitBreakerSetting { successStatErrCodeMap := map[StatErrCode]bool{ {409, "IncorrectState"}: false, + {409, "LockConflict"}: false, } successStatCodeMap := map[int]bool{ 429: false, @@ -213,7 +226,7 @@ func NewCircuitBreakerSettingWithOptions(opts ...CircuitBreakerOption) *CircuitB for _, opt := range opts { opt(cbst) } - if defaultLogger.LogLevel() == verboseLogging { + if defaultLogger != nil && defaultLogger.LogLevel() == verboseLogging { Debugf("Circuit Breaker setting: %s\n", cbst.String()) } @@ -383,3 +396,17 @@ func ConfigCircuitBreakerFromGlobalVar(baseClient *BaseClient) { baseClient.Configuration.CircuitBreaker = NewCircuitBreaker(GlobalCircuitBreakerSetting) } } + +// DefaultAuthClientCircuitBreakerSetting returns the default circuit breaker setting for the Auth Client +func DefaultAuthClientCircuitBreakerSetting() *CircuitBreakerSetting { + return NewCircuitBreakerSettingWithOptions( + WithOpenStateWindow(time.Duration(rand.Intn(MaxAuthClientCircuitBreakerResetTimeout+1-MinAuthClientCircuitBreakerResetTimeout)+MinAuthClientCircuitBreakerResetTimeout)*time.Second), + WithName(AuthClientCircuitBreakerName), + WithFailureRateThreshold(AuthClientCircuitBreakerDefaultFailureThreshold), + WithMinimumRequests(AuthClientCircuitBreakerDefaultMinimumRequests), + ) +} + +// GlobalAuthClientCircuitBreakerSetting is global level circuit breaker setting for the Auth Client +// than client level circuit breaker +var GlobalAuthClientCircuitBreakerSetting *CircuitBreakerSetting = nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go index ff02e129d..28a8054f7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Package common provides supporting functions and structs used by service packages @@ -7,13 +7,10 @@ package common import ( "bytes" "context" - "crypto/tls" - "crypto/x509" "fmt" "io" "io/ioutil" "math/rand" - "net" "net/http" "net/http/httputil" "net/url" @@ -22,7 +19,9 @@ import ( "path" "path/filepath" "reflect" + "regexp" "runtime" + "strconv" "strings" "sync" "sync/atomic" @@ -103,13 +102,51 @@ const ( //circuitBreakerNumberOfHistoryResponseEnv is the number of recorded history responses circuitBreakerNumberOfHistoryResponseEnv = "OCI_SDK_CIRCUITBREAKER_NUM_HISTORY_RESPONSE" + // ociDefaultRefreshIntervalForCustomCerts is the env var for overriding the defaultRefreshIntervalForCustomCerts. + // The value represents the refresh interval in minutes and has a higher precedence than defaultRefreshIntervalForCustomCerts + // but has a lower precedence then the refresh interval configured via OciGlobalRefreshIntervalForCustomCerts + // If the value is negative, then it is assumed that this property is not configured + // if the value is Zero, then the refresh of custom certs will be disabled + ociDefaultRefreshIntervalForCustomCerts = "OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS" + // ociDefaultCertsPath is the env var for the path to the SSL cert file ociDefaultCertsPath = "OCI_DEFAULT_CERTS_PATH" + // ociDefaultClientCertsPath is the env var for the path to the custom client cert + ociDefaultClientCertsPath = "OCI_DEFAULT_CLIENT_CERTS_PATH" + + // ociDefaultClientCertsPrivateKeyPath is the env var for the path to the custom client cert private key + ociDefaultClientCertsPrivateKeyPath = "OCI_DEFAULT_CLIENT_CERTS_PRIVATE_KEY_PATH" + //maxAttemptsForRefreshableRetry is the number of retry when 401 happened on a refreshable auth type maxAttemptsForRefreshableRetry = 3 + + //defaultRefreshIntervalForCustomCerts is the default refresh interval in minutes + defaultRefreshIntervalForCustomCerts = 30 + + // CustomClientTimeoutEnvVar allows the user to set the timeout in seconds to be used by each service client. + CustomClientTimeoutEnvVar = "OCI_CUSTOM_CLIENT_TIMEOUT" + + // Environment variable to check whether dual stack endpoints should be enabled + ociDualStackEndpointEnabledEnvVar = "OCI_DUAL_STACK_ENDPOINT_ENABLED" + + // String representing a single "phrase" of an endpoint template option + endpointTemplateOptionPhrase = "((\\w|\\.|\\-)+)" + + // Checks for template for endpoint options + patternForEndpointTemplateOptions = "\\{" + endpointTemplateOptionPhrase + "\\?((" + endpointTemplateOptionPhrase + ":" + endpointTemplateOptionPhrase + ")" + + "|(" + endpointTemplateOptionPhrase + ":\\s*)|(\\s*:" + endpointTemplateOptionPhrase + "))}" + + dualStackOption = "{dualStack" ) +// OciGlobalRefreshIntervalForCustomCerts is the global policy for overriding the refresh interval in minutes. +// This variable has a higher precedence than the env variable OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS +// and the defaultRefreshIntervalForCustomCerts values. +// If the value is negative, then it is assumed that this property is not configured +// if the value is Zero, then the refresh of custom certs will be disabled +var OciGlobalRefreshIntervalForCustomCerts int = -1 + // RequestInterceptor function used to customize the request before calling the underlying service type RequestInterceptor func(*http.Request) error @@ -119,11 +156,24 @@ type HTTPRequestDispatcher interface { Do(req *http.Request) (*http.Response, error) } -// CustomClientConfiguration contains configurations set at client level, currently it only includes RetryPolicy +// CustomClientConfiguration contains configurations set at client level type CustomClientConfiguration struct { - RetryPolicy *RetryPolicy - CircuitBreaker *OciCircuitBreaker + + // Retry policy used on calls made by the client + RetryPolicy *RetryPolicy + + // The Circuit Breaker used to regulate calls made by the client + CircuitBreaker *OciCircuitBreaker + + // Allows user to decide if they want to use realm specific endpoints RealmSpecificServiceEndpointTemplateEnabled *bool + + // Allows user to decide if they want to use dual stack endpoints + EnableDualStackEndpoints *bool + + // Set on creation of the client, based on the below flag from the service spec + // x-obmcs-endpoint-template-options: dualStack: true/false + ServiceUsesDualStackByDefault *bool } // BaseClient struct implements all basic operations to call oci web services. @@ -147,6 +197,10 @@ type BaseClient struct { BasePath string Configuration CustomClientConfiguration + + //Whether the OCI_INCLUDE_REQUEST_TELEMETRY_DATA environment variable was true at the time of client creation, + //indicating that x-oci-service-name and x-oci-operation-id headers should be sent. + ociIncludeRequestTelemetryDataEnabled bool } // SetCustomClientConfiguration sets client with retry and other custom configurations @@ -169,6 +223,56 @@ func (client *BaseClient) Endpoint() string { return host } +func UpdateEndpointTemplateForOptions(client *BaseClient) { + templateRegex := regexp.MustCompile(patternForEndpointTemplateOptions) + templates := templateRegex.FindAllString(client.Host, -1) + for _, option := range templates { + optionParam := "" + optionEnabledParam := option[strings.Index(option, "?")+1 : strings.Index(option, ":")] + optionDisabledParam := option[strings.Index(option, ":")+1 : strings.Index(option, "}")] + + // Option case: Dual Stack Endpoints + if strings.Contains(option, dualStackOption) { + dualStackEnvVarValue := os.Getenv(ociDualStackEndpointEnabledEnvVar) + if client.IsServiceDualStackEnabledByDefault() { + if !client.IsDualStackEndpointEnabled() || (dualStackEnvVarValue != "" && strings.ToLower(dualStackEnvVarValue) == "false") { + optionParam = optionDisabledParam + } else { + optionParam = optionEnabledParam + } + } else { + if client.IsDualStackEndpointEnabled() || (dualStackEnvVarValue != "" && strings.ToLower(dualStackEnvVarValue) == "true") { + optionParam = optionEnabledParam + } else { + optionParam = optionDisabledParam + } + } + } + client.Host = strings.Replace(client.Host, option, optionParam, -1) + } +} + +// UseDualStackEndpointsByDefault sets whether dual stack endpoints are used by default +func (client *BaseClient) UseDualStackEndpointsByDefault(useByDefault bool) { + client.Configuration.EnableDualStackEndpoints = &useByDefault + client.Configuration.ServiceUsesDualStackByDefault = &useByDefault +} + +// EnableDualStackEndpoints sets whether dual stack endpoints should be used for this client +func (client *BaseClient) EnableDualStackEndpoints(EnableDualStack bool) { + client.Configuration.EnableDualStackEndpoints = &EnableDualStack +} + +// IsDualStackEndpointEnabled is used to check if Dual Stack Endpoints are Enabled +func (client *BaseClient) IsDualStackEndpointEnabled() bool { + return client.Configuration.EnableDualStackEndpoints != nil && *client.Configuration.EnableDualStackEndpoints +} + +// IsServiceDualStackEnabledByDefault is used to check if Dual Stack Endpoints enabled by default for the service of the client +func (client *BaseClient) IsServiceDualStackEnabledByDefault() bool { + return client.Configuration.ServiceUsesDualStackByDefault != nil && *client.Configuration.ServiceUsesDualStackByDefault +} + func defaultUserAgent() string { userAgent := fmt.Sprintf(defaultUserAgentTemplate, defaultSDKMarker, Version(), runtime.GOOS, runtime.GOARCH, runtime.Version()) appendUA := os.Getenv(appendUserAgentEnv) @@ -188,11 +292,14 @@ func getNextSeed() int64 { func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) BaseClient { rand.Seed(getNextSeed()) + includeTelemetry := strings.EqualFold(os.Getenv("OCI_INCLUDE_REQUEST_TELEMETRY_DATA"), "true") + baseClient := BaseClient{ - UserAgent: defaultUserAgent(), - Interceptor: nil, - Signer: signer, - HTTPClient: dispatcher, + UserAgent: defaultUserAgent(), + Interceptor: nil, + Signer: signer, + HTTPClient: dispatcher, + ociIncludeRequestTelemetryDataEnabled: includeTelemetry, } // check the default retry environment variable setting @@ -208,40 +315,36 @@ func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) B baseClient.Configuration.RetryPolicy = GlobalRetry } + baseClient.UseDualStackEndpointsByDefault(false) + return baseClient } func defaultHTTPDispatcher() http.Client { var httpClient http.Client - var tp = http.DefaultTransport.(*http.Transport) - if isExpectHeaderDisabled := IsEnvVarFalse(UsingExpectHeaderEnvVar); !isExpectHeaderDisabled { - tp.Proxy = http.ProxyFromEnvironment - tp.DialContext = (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext - tp.ForceAttemptHTTP2 = true - tp.MaxIdleConns = 100 - tp.IdleConnTimeout = 90 * time.Second - tp.TLSHandshakeTimeout = 10 * time.Second - tp.ExpectContinueTimeout = 3 * time.Second - } - if certFile, ok := os.LookupEnv(ociDefaultCertsPath); ok { - pool := x509.NewCertPool() - pemCert := readCertPem(certFile) - cert, err := x509.ParseCertificate(pemCert) - if err != nil { - Logf("unable to parse content to cert fallback to pem format from env var value: %s", certFile) - pool.AppendCertsFromPEM(pemCert) + refreshInterval := getCustomCertRefreshInterval() + if refreshInterval <= 0 { + Debug("Custom cert refresh has been disabled") + } + var tp = &OciHTTPTransportWrapper{ + RefreshRate: time.Duration(refreshInterval) * time.Minute, + TLSConfigProvider: GetTLSConfigTemplateForTransport(), + } + + // Set client timeout to default or value set in environment variable + clientTimeout := defaultTimeout + if customTimeout := os.Getenv(CustomClientTimeoutEnvVar); customTimeout != "" { + if timeInSeconds, err := strconv.Atoi(customTimeout); err != nil || timeInSeconds < 0 { + Logf("WARNING: %s set but could not be converted to a postive integer", CustomClientTimeoutEnvVar) } else { - Logf("using custom cert parsed from env var value: %s", certFile) - pool.AddCert(cert) + Debugf("Using custom client timeout of %s seconds", customTimeout) + clientTimeout = time.Duration(timeInSeconds) * time.Second } - tp.TLSClientConfig = &tls.Config{RootCAs: pool} } + + // Create the underlying HTTP client httpClient = http.Client{ - Timeout: defaultTimeout, + Timeout: clientTimeout, Transport: tp, } return httpClient @@ -336,6 +439,18 @@ func DefaultConfigProvider() ConfigurationProvider { return provider } +// CustomProfileSessionTokenConfigProvider returns the session token config provider of the given profile. +// This will look for the configuration in the given config file path. +func CustomProfileSessionTokenConfigProvider(customConfigPath string, profile string) ConfigurationProvider { + if customConfigPath == "" { + customConfigPath = getDefaultConfigFilePath() + } + + sessionTokenConfigurationProvider, _ := ConfigurationProviderForSessionTokenWithProfile(customConfigPath, profile, "") + Debugf("Configuration provided by: %s", sessionTokenConfigurationProvider) + return sessionTokenConfigurationProvider +} + func getDefaultConfigFilePath() string { homeFolder := getHomeFolder() defaultConfigFile := filepath.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) @@ -417,7 +532,7 @@ func (client *BaseClient) prepareRequest(request *http.Request) (err error) { request.URL.Host = clientURL.Host request.URL.Scheme = clientURL.Scheme currentPath := request.URL.Path - if !strings.Contains(currentPath, fmt.Sprintf("/%s", client.BasePath)) { + if !strings.HasPrefix(currentPath, fmt.Sprintf("/%s", client.BasePath)) { request.URL.Path = path.Clean(fmt.Sprintf("/%s/%s", client.BasePath, currentPath)) err := setRawPath(request.URL) if err != nil { @@ -494,10 +609,7 @@ func logResponse(response *http.Response, fn func(format string, v ...interface{ } func checkBodyLengthExceedLimit(contentLength int64) bool { - if contentLength > maxBodyLenForDebug { - return true - } - return false + return contentLength > maxBodyLenForDebug } // OCIRequest is any request made to an OCI service. @@ -538,7 +650,7 @@ func (rsc *OCIReadSeekCloser) Seek(offset int64, whence int) (int64, error) { return rsc.rc.(io.Seeker).Seek(offset, whence) } // once the binary request body is wrapped with ioutil.NopCloser: - if rsc.isNopCloser() { + if isNopCloser(rsc.rc) { unwrappedInterface := reflect.ValueOf(rsc.rc).Field(0).Interface() if _, ok := unwrappedInterface.(io.Seeker); ok { return unwrappedInterface.(io.Seeker).Seek(offset, whence) @@ -576,7 +688,7 @@ func (rsc *OCIReadSeekCloser) Seekable() bool { return true } // once the binary request body is wrapped with ioutil.NopCloser: - if rsc.isNopCloser() { + if isNopCloser(rsc.rc) { if _, ok := reflect.ValueOf(rsc.rc).Field(0).Interface().(io.Seeker); ok { return true } @@ -584,14 +696,6 @@ func (rsc *OCIReadSeekCloser) Seekable() bool { return false } -// Helper function to judge if this struct is a nopCloser or nopCloserWriterTo -func (rsc *OCIReadSeekCloser) isNopCloser() bool { - if reflect.TypeOf(rsc.rc) == reflect.TypeOf(ioutil.NopCloser(nil)) || reflect.TypeOf(rsc.rc) == reflect.TypeOf(ioutil.NopCloser(bytes.NewReader(nil))) { - return true - } - return false -} - // OCIResponse is the response from issuing a request to an OCI service. type OCIResponse interface { // HTTPResponse returns the raw HTTP response. @@ -603,23 +707,78 @@ type OCIOperation func(context.Context, OCIRequest, *OCIReadSeekCloser, map[stri // ClientCallDetails a set of settings used by the a single Call operation of the http Client type ClientCallDetails struct { - Signer HTTPRequestSigner + Signer HTTPRequestSigner + ServiceName string + OperationName string } // Call executes the http request with the given context func (client BaseClient) Call(ctx context.Context, request *http.Request) (response *http.Response, err error) { + details := ClientCallDetails{Signer: client.Signer} + if client.IsRefreshableAuthType() { + return client.RefreshableTokenWrappedCallWithDetails(ctx, request, details) + } + return client.CallWithDetails(ctx, request, details) +} + +// CallWithServiceAndOperationName executes the http request with the given context and known service and operation name +func (client BaseClient) CallWithServiceAndOperationName(ctx context.Context, request *http.Request, serviceName string, operationName string) (response *http.Response, err error) { + details := ClientCallDetails{Signer: client.Signer, ServiceName: serviceName, OperationName: operationName} if client.IsRefreshableAuthType() { - return client.RefreshableTokenWrappedCallWithDetails(ctx, request, ClientCallDetails{Signer: client.Signer}) + return client.RefreshableTokenWrappedCallWithDetails(ctx, request, details) } - return client.CallWithDetails(ctx, request, ClientCallDetails{Signer: client.Signer}) + return client.CallWithDetails(ctx, request, details) } -// RefreshableTokenWrappedCallWithDetails wraps the CallWithDetails with retry on 401 for Refreshable Toekn (Instance Principal, Resource Principal etc.) -// This is to intimitate the race condition on refresh +// RefreshableTokenWrappedCallWithDetails wraps the CallWithDetails with retry on 401 for Refreshable Token (Instance Principal, Resource Principal, etc.) +// This retry reduces transient 401s that can occur due to concurrent token refresh func (client BaseClient) RefreshableTokenWrappedCallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) { - for i := 0; i < maxAttemptsForRefreshableRetry; i++ { + var ( + rsc *OCIReadSeekCloser + isSeekable bool + curPos int64 + initialSize int64 + ) + + // Prepare request body for potential retries + if request != nil && request.Body != nil && request.Body != http.NoBody { + rsc = NewOCIReadSeekCloser(request.Body) + request.Body = rsc + + if rsc.Seekable() { + isSeekable = true + + // Capture current position and total size so we can restore Content-Length on retries + curPos, _ = rsc.Seek(0, io.SeekCurrent) + if end, seekErr := rsc.Seek(0, io.SeekEnd); seekErr == nil { + initialSize = end + _, _ = rsc.Seek(curPos, io.SeekStart) + } + } + } + + for attempt := 0; attempt < maxAttemptsForRefreshableRetry; attempt++ { + // On retries, rewind request body and restore content length/header if seekable + if attempt > 0 && request != nil && request.Body != nil && request.Body != http.NoBody { + if !isSeekable { + return response, NonSeekableRequestRetryFailure{err} + } + + rsc = NewOCIReadSeekCloser(rsc.rc) + _, _ = rsc.Seek(curPos, io.SeekStart) + request.Body = rsc + + if initialSize > 0 { + request.ContentLength = initialSize - curPos + if request.Header == nil { + request.Header = make(http.Header) + } + request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10)) + } + } + response, err = client.CallWithDetails(ctx, request, ClientCallDetails{Signer: client.Signer}) - if response != nil && response.StatusCode != 401 { + if response != nil && response.StatusCode != http.StatusUnauthorized { return response, err } time.Sleep(1 * time.Second) @@ -632,6 +791,16 @@ func (client BaseClient) RefreshableTokenWrappedCallWithDetails(ctx context.Cont func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) { Debugln("Attempting to call downstream service") request = request.WithContext(ctx) + + if client.ociIncludeRequestTelemetryDataEnabled { + if details.ServiceName != "" { + request.Header.Set("x-oci-service-name", details.ServiceName) + } + if details.ServiceName != "" { + request.Header.Set("x-oci-operation-id", details.OperationName) + } + } + err = client.prepareRequest(request) if err != nil { return @@ -710,6 +879,9 @@ func (client BaseClient) httpDo(request *http.Request) (response *http.Response, // CloseBodyIfValid closes the body of an http response if the response and the body are valid func CloseBodyIfValid(httpResponse *http.Response) { if httpResponse != nil && httpResponse.Body != nil { + if httpResponse.Header != nil && strings.ToLower(httpResponse.Header.Get("content-type")) == "text/event-stream" { + return + } httpResponse.Body.Close() } } @@ -722,3 +894,21 @@ func (client BaseClient) IsOciRealmSpecificServiceEndpointTemplateEnabled() bool } return IsEnvVarTrue(OciRealmSpecificServiceEndpointTemplateEnabledEnvVar) } + +func getCustomCertRefreshInterval() int { + if OciGlobalRefreshIntervalForCustomCerts >= 0 { + Debugf("Setting refresh interval as %d for custom certs via OciGlobalRefreshIntervalForCustomCerts", OciGlobalRefreshIntervalForCustomCerts) + return OciGlobalRefreshIntervalForCustomCerts + } + if refreshIntervalValue, ok := os.LookupEnv(ociDefaultRefreshIntervalForCustomCerts); ok { + refreshInterval, err := strconv.Atoi(refreshIntervalValue) + if err != nil || refreshInterval < 0 { + Debugf("The environment variable %s is not a valid int or is a negative value, skipping this configuration", ociDefaultRefreshIntervalForCustomCerts) + } else { + Debugf("Setting refresh interval as %d for custom certs via the env variable %s", refreshInterval, ociDefaultRefreshIntervalForCustomCerts) + return refreshInterval + } + } + Debugf("Setting the default refresh interval %d for custom certs", defaultRefreshIntervalForCustomCerts) + return defaultRefreshIntervalForCustomCerts +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go index 079ee1797..90d5494b2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -12,6 +12,7 @@ import ( "path/filepath" "regexp" "strings" + "sync" "time" ) @@ -53,9 +54,42 @@ var getRegionInfoFromInstanceMetadataService = getRegionInfoFromInstanceMetadata // OciRealmSpecificServiceEndpointTemplateEnabled is the flag to enable the realm specific service endpoint template. This one has higher priority than the environment variable. var OciRealmSpecificServiceEndpointTemplateEnabled *bool = nil +// reNonWord precomiles the regex once at the package scope +var reNonWord = regexp.MustCompile(`[^\w]`) + +// OciSdkEnabledServicesMap is a list of services that are enabled, default is an empty list which means all services are enabled +var OciSdkEnabledServicesMap map[string]bool + +// OciSdkEnabledServicesOnce is a sync.Once variable to ensure the OciSdkEnabledServicesMap is initialized only once +var OciSdkEnabledServicesOnce sync.Once + +// OciSdkEnabledServicesMu is a mutex to protect access to the OciSdkEnabledServicesMap +var OciSdkEnabledServicesMu sync.RWMutex + +// OciDeveloperToolConfigurationFilePathEnvVar is the environment variable name for the OCI Developer Tool Config File Path +const OciDeveloperToolConfigurationFilePathEnvVar = "OCI_DEVELOPER_TOOL_CONFIGURATION_FILE_PATH" + +// OciAllowOnlyDeveloperToolConfigurationRegionsEnvVar is the environment variable name for the OCI Allow only Dev Tool Config Regions +const OciAllowOnlyDeveloperToolConfigurationRegionsEnvVar = "OCI_ALLOW_ONLY_DEVELOPER_TOOL_CONFIGURATION_REGIONS" + +// defaultRealmForUnknownDeveloperToolConfigurationRegion is the default realm for unknown Developer Tool Configuration Regions +const defaultRealmForUnknownDeveloperToolConfigurationRegion = "oraclecloud.com" + +// OciDeveloperToolConfigurationProvider is the provider name for the OCI Developer Tool Configuration file +var OciDeveloperToolConfigurationProvider string + +// ociAllowOnlyDeveloperToolConfigurationRegions is the flag to enable the OCI Allow Only Developer Tool Configuration Regions. This one has lower priority than the environment variable. +var ociAllowOnlyDeveloperToolConfigurationRegions bool + +var ociDeveloperToolConfigurationRegionSchemaList []map[string]string + // Endpoint returns a endpoint for a service func (region Region) Endpoint(service string) string { - return fmt.Sprintf("%s.%s.%s", service, region, region.secondLevelDomain()) + // Endpoint for dotted region + if strings.Contains(string(region), ".") { + return fmt.Sprintf("%s.%s", service, region) + } + return fmt.Sprintf("%s.%s.%s", service, region, region.SecondLevelDomain()) } // EndpointForTemplate returns a endpoint for a service based on template, only unknown region name can fall back to "oc1", but not short code region name. @@ -81,7 +115,7 @@ func (region Region) EndpointForTemplate(service string, serviceEndpointTemplate endpoint = strings.Replace(endpoint, "{region}", string(region), 1) // replace second level domain - endpoint = strings.Replace(endpoint, "{secondLevelDomain}", region.secondLevelDomain(), 1) + endpoint = strings.Replace(endpoint, "{secondLevelDomain}", region.SecondLevelDomain(), 1) return endpoint } @@ -117,14 +151,14 @@ func (region Region) EndpointForTemplateDottedRegion(service string, serviceEndp return endpoint, fmt.Errorf("Endpoint service name not present in endpoint template") } } else { - return endpoint, fmt.Errorf("Invalid serviceEndpointTemplates. ServiceEndpointTemplate should start with https://") + return endpoint, fmt.Errorf("invalid serviceEndpointTemplates. ServiceEndpointTemplate should start with https://") } return endpoint, nil } return "", fmt.Errorf("EndpointForTemplateDottedRegion function requires endpointServiceName or serviceEndpointTemplate, no endpointServiceName or serviceEndpointTemplate provided") } -func (region Region) secondLevelDomain() string { +func (region Region) SecondLevelDomain() string { if realmID, ok := regionRealm[region]; ok { if secondLevelDomain, ok := realm[realmID]; ok { return secondLevelDomain @@ -134,6 +168,9 @@ func (region Region) secondLevelDomain() string { return value } Debugf("cannot find realm for region : %s, return default realm value.", region) + if _, ok := realm["oc1"]; !ok { + return defaultRealmForUnknownDeveloperToolConfigurationRegion + } return realm["oc1"] } @@ -149,6 +186,21 @@ func (region Region) RealmID() (string, error) { // StringToRegion convert a string to Region type func StringToRegion(stringRegion string) (r Region) { regionStr := strings.ToLower(stringRegion) + // check for PLC related regions + if checkAllowOnlyDeveloperToolConfigurationRegions() && (checkDeveloperToolConfigurationFile() || len(ociDeveloperToolConfigurationRegionSchemaList) != 0) { + Debugf("Developer Tool config detected and OCI_ALLOW_ONLY_DEVELOPER_TOOL_CONFIGURATION_REGIONS is set to True, SDK will only use regions defined for Developer Tool Configuration Regions") + setRegionMetadataFromDeveloperToolConfigurationFile(&stringRegion) + if len(ociDeveloperToolConfigurationRegionSchemaList) != 0 { + resetRegionInfo() + bulkAddRegionSchema(ociDeveloperToolConfigurationRegionSchemaList) + } + r = Region(stringRegion) + if _, ok := regionRealm[r]; !ok { + Logf("You're using the %s Developer Tool configuration file, the region you're targeting is not declared in this config file. Please check if this is the correct region you're targeting or contact the %s cloud provider for help. If you want to target both OCI regions and %s regions, please set the OCI_ALLOW_ONLY_DEVELOPER_TOOL_CONFIGURATION_REGIONS env var to False.", OciDeveloperToolConfigurationProvider, OciDeveloperToolConfigurationProvider, regionStr) + } + return r + } + // check if short region name provided if region, ok := shortNameRegion[regionStr]; ok { r = region @@ -169,7 +221,7 @@ func StringToRegion(stringRegion string) (r Region) { // canStringBeRegion test if the string can be a region, if it can, returns the string as is, otherwise it // returns an error -var blankRegex = regexp.MustCompile("\\s") +var blankRegex = regexp.MustCompile(`\s`) func canStringBeRegion(stringRegion string) (region string, err error) { if blankRegex.MatchString(stringRegion) || stringRegion == "" { @@ -202,7 +254,7 @@ func EnableInstanceMetadataServiceLookup() { // Once successfully find the expected region(region name or short code), return true, region name will be stored in // the input pointer. func setRegionMetadataFromEnvVar(region *string) bool { - if readEnvVar == false { + if !readEnvVar { Debugf("metadata region env variable had already been checked, no need to check again.") return false //no need to check it again. } @@ -232,12 +284,22 @@ func setRegionMetadataFromEnvVar(region *string) bool { return false } +func setRegionMetadataFromCfgFile(region *string) bool { + if setRegionMetadataFromDeveloperToolConfigurationFile(region) { + return true + } + if setRegionMetadataFromRegionCfgFile(region) { + return true + } + return false +} + // setRegionMetadataFromCfgFile checks if region metadata config file is provided, once it's there, parse and add all // the valid regions to region map, the configuration file can only be visited once. // Once successfully find the expected region(region name or short code), return true, region name will be stored in // the input pointer. -func setRegionMetadataFromCfgFile(region *string) bool { - if readCfgFile == false { +func setRegionMetadataFromRegionCfgFile(region *string) bool { + if !readCfgFile { Debugf("metadata region config file had already been checked, no need to check again.") return false //no need to check it again. } @@ -262,8 +324,46 @@ func setRegionMetadataFromCfgFile(region *string) bool { return false } -func readAndParseConfigFile(configFileName *string) (fileContent []map[string]string, ok bool) { +// setRegionMetadataFromDeveloperToolConfigurationFile checks if Developer Tool config file is provided, once it's there, parse and add all +// The default location of the Developer Tool config file is ~/.oci/developer-tool-configuration.json. It will also check the environment variable +// the valid regions to region map, the configuration file can only be visited once. +// Once successfully find the expected region(region name or short code), return true, region name will be stored in +// the input pointer. +func setRegionMetadataFromDeveloperToolConfigurationFile(region *string) bool { + if jsonArr, ok := readAndParseDeveloperToolConfigurationFile(); ok { + added := false + if jsonArr["regions"] == nil { + return false + } + var regionJSON []map[string]string + originalJSONContent, err := json.Marshal(jsonArr["regions"]) + if err != nil { + return false + } + err = json.Unmarshal(originalJSONContent, ®ionJSON) + if err != nil { + return false + } + + if IsEnvVarTrue(OciAllowOnlyDeveloperToolConfigurationRegionsEnvVar) { + resetRegionInfo() + } + for _, jsonItem := range regionJSON { + if checkSchemaItems(jsonItem) { + addRegionSchema(jsonItem) + if jsonItem[regionKeyPropertyName] == *region || + jsonItem[regionIdentifierPropertyName] == *region { + *region = jsonItem[regionIdentifierPropertyName] + added = true + } + } + } + return added + } + return false +} +func readAndParseConfigFile(configFileName *string) (fileContent []map[string]string, ok bool) { if content, err := ioutil.ReadFile(*configFileName); err == nil { Debugf("Raw content of region metadata config file content:", string(content[:])) if err := json.Unmarshal(content, &fileContent); err != nil { @@ -275,7 +375,37 @@ func readAndParseConfigFile(configFileName *string) (fileContent []map[string]st } Debugf("No Region Metadata Config File provided.") return +} +func readAndParseDeveloperToolConfigurationFile() (fileContent map[string]interface{}, ok bool) { + homeFolder := getHomeFolder() + configFileName := filepath.Join(homeFolder, regionMetadataCfgDirName, "developer-tool-configuration.json") + if path := os.Getenv(OciDeveloperToolConfigurationFilePathEnvVar); path != "" { + configFileName = path + } + if content, err := ioutil.ReadFile(configFileName); err == nil { + Debugf("Raw content of Developer Tool config file content:", string(content[:])) + if err := json.Unmarshal(content, &fileContent); err != nil { + Debugf("Can't unmarshal env var, the error info is", err) + return + } + ok = true + return + } + Debugf("No Developer Tool Config File provided.") + return +} + +func checkDeveloperToolConfigurationFile() bool { + homeFolder := getHomeFolder() + configFileName := filepath.Join(homeFolder, regionMetadataCfgDirName, "developer-tool-configuration.json") + if path := os.Getenv(OciDeveloperToolConfigurationFilePathEnvVar); path != "" { + configFileName = path + } + if _, err := os.Stat(configFileName); err == nil { + return true + } + return false } // check map regionRealm's region name, if it's already there, no need to add it. @@ -291,6 +421,33 @@ func addRegionSchema(regionSchema map[string]string) { Debugf("Region {} has already been added, no need to add again.", regionSchema[regionIdentifierPropertyName]) } +// AddRegionSchemaForPlc add region schema to region map +func AddRegionSchemaForPlc(regionSchema map[string]string) { + ociDeveloperToolConfigurationRegionSchemaList = append(ociDeveloperToolConfigurationRegionSchemaList, regionSchema) + addRegionSchema(regionSchema) + // if !IsEnvVarTrue(OciPlcRegionExclusiveEnvVar) { + // addRegionSchema(regionSchema) + // return + // } + // Debugf("Plc region coexist is not enabled, remove exisiting OCI region schema and add PLC region schema.") + // resetRegionInfo() + // bulkAddRegionSchema(ociPlcRegionSchemaList) +} + +func resetRegionInfo() { + shortNameRegion = make(map[string]Region) + realm = make(map[string]string) + regionRealm = make(map[Region]string) +} + +func bulkAddRegionSchema(regionSchemaList []map[string]string) { + for _, regionSchema := range regionSchemaList { + if checkSchemaItems(regionSchema) { + addRegionSchema(regionSchema) + } + } +} + // check region schema content if all the required contents are provided func checkSchemaItems(regionSchema map[string]string) bool { if checkSchemaItem(regionSchema, regionIdentifierPropertyName) && @@ -330,7 +487,7 @@ func setRegionFromInstanceMetadataService(region *string) bool { // "regionIdentifier" : "ca-montreal-1" // } // Mark visitIMDS Flag as false since it has already been visited. - if visitIMDS == false { + if !visitIMDS { Debugf("check from IMDS is disabled or IMDS had already been successfully visited, no need to check again.") return false } @@ -366,7 +523,7 @@ func setRegionFromInstanceMetadataService(region *string) bool { // getRegionInfoFromInstanceMetadataServiceProd calls instance metadata service and get the region information func getRegionInfoFromInstanceMetadataServiceProd() ([]byte, error) { - request, err := http.NewRequest(http.MethodGet, instanceMetadataRegionInfoURLV2, nil) + request, _ := http.NewRequest(http.MethodGet, instanceMetadataRegionInfoURLV2, nil) request.Header.Add("Authorization", "Bearer Oracle") client := &http.Client{ @@ -374,7 +531,7 @@ func getRegionInfoFromInstanceMetadataServiceProd() ([]byte, error) { } resp, err := client.Do(request) if err != nil { - return nil, fmt.Errorf("Failed to call instance metadata service. Error: %v", err) + return nil, fmt.Errorf("failed to call instance metadata service. Error: %v", err) } statusCode := resp.StatusCode @@ -383,7 +540,7 @@ func getRegionInfoFromInstanceMetadataServiceProd() ([]byte, error) { content, err := ioutil.ReadAll(resp.Body) if err != nil { - return nil, fmt.Errorf("Failed to get region information from response body. Error: %v", err) + return nil, fmt.Errorf("failed to get region information from response body. Error: %v", err) } if statusCode != http.StatusOK { @@ -409,3 +566,86 @@ func SetMissingTemplateParams(client *BaseClient) { client.Host = strings.Replace(client.Host, template, "", -1) } } + +func getOciSdkEnabledServicesMap() map[string]bool { + var enabledMap = make(map[string]bool) + if jsonArr, ok := readAndParseDeveloperToolConfigurationFile(); ok { + if jsonArr["provider"] != nil { + OciDeveloperToolConfigurationProvider = jsonArr["provider"].(string) + } + if jsonArr["allowOnlyDeveloperToolConfigurationRegions"] != nil && jsonArr["allowOnlyDeveloperToolConfigurationRegions"] == false { + ociAllowOnlyDeveloperToolConfigurationRegions = jsonArr["allowOnlyDeveloperToolConfigurationRegions"].(bool) + } + if jsonArr["services"] == nil { + return enabledMap + } + serviesJSON, ok := jsonArr["services"].([]interface{}) + if !ok { + return enabledMap + } + re, _ := regexp.Compile(`[^\w]`) + for _, jsonItem := range serviesJSON { + serviceName := strings.ToLower(fmt.Sprint(jsonItem)) + serviceName = re.ReplaceAllString(serviceName, "") + enabledMap[serviceName] = true + } + } + return enabledMap +} + +// AddServiceToEnabledServicesMap adds the service to the enabledServiceMap +// The service name will auto transit to lower case and remove all the non-word characters. +// Concurrency (goroutine-safe). The map is initialized with sync.Once, and writes are protected by a RWMutex. +func AddServiceToEnabledServicesMap(serviceName string) { + OciSdkEnabledServicesOnce.Do(func() { + OciSdkEnabledServicesMap = getOciSdkEnabledServicesMap() + if OciSdkEnabledServicesMap == nil { + OciSdkEnabledServicesMap = make(map[string]bool) + } + }) + serviceName = strings.ToLower(serviceName) + serviceName = reNonWord.ReplaceAllString(serviceName, "") + + OciSdkEnabledServicesMu.Lock() + defer OciSdkEnabledServicesMu.Unlock() + OciSdkEnabledServicesMap[serviceName] = true +} + +// CheckForEnabledServices checks if the service is enabled in the enabledServiceMap. +// It will first check if the map is initialized, if not, it will initialize the map. +// If the map is empty, it means all the services are enabled. +// If the map is not empty, it means only the services in the map and value is true are enabled. +// Concurrency (goroutine-safe). Initialization uses sync.Once and reads are protected by a RWMutex. +func CheckForEnabledServices(serviceName string) bool { + OciSdkEnabledServicesOnce.Do(func() { + OciSdkEnabledServicesMap = getOciSdkEnabledServicesMap() + if OciSdkEnabledServicesMap == nil { + OciSdkEnabledServicesMap = make(map[string]bool) + } + }) + serviceName = strings.ToLower(serviceName) + serviceName = reNonWord.ReplaceAllString(serviceName, "") + + OciSdkEnabledServicesMu.RLock() + defer OciSdkEnabledServicesMu.RUnlock() + + if len(OciSdkEnabledServicesMap) == 0 { + return true + } + allowed, ok := OciSdkEnabledServicesMap[serviceName] + if !ok { + return false + } + return allowed +} + +// CheckAllowOnlyDeveloperToolConfigurationRegions checks if only developer tool configuration regions are allowed +// This function will first check if the OCI_ALLOW_ONLY_DEVELOPER_TOOL_CONFIGURATION_REGIONS environment variable is set. +// If it is set, it will return the value. +// If it is not set, it will return the value from the ociAllowOnlyDeveloperToolConfigurationRegions variable. +func checkAllowOnlyDeveloperToolConfigurationRegions() bool { + if val, ok := os.LookupEnv("OCI_ALLOW_ONLY_DEVELOPER_TOOL_CONFIGURATION_REGIONS"); ok { + return val == "true" + } + return ociAllowOnlyDeveloperToolConfigurationRegions +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go index 4cd1d7edd..55a1e59ca 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -21,10 +21,16 @@ type AuthenticationType string const ( // UserPrincipal is default auth type UserPrincipal AuthenticationType = "user_principal" - // InstancePrincipal is used for instance principle auth type + // InstancePrincipal is used for instance principal auth type InstancePrincipal AuthenticationType = "instance_principal" - // InstancePrincipalDelegationToken is used for instance principle delegation token auth type + // InstancePrincipalDelegationToken is used for instance principal delegation token auth type InstancePrincipalDelegationToken AuthenticationType = "instance_principle_delegation_token" + // ResourcePrincipalDelegationToken is used for resource principal delegation token auth type + ResourcePrincipalDelegationToken AuthenticationType = "resource_principle_delegation_token" + // OAuth2DelegationToken is used for oauth delegation token auth type + OAuthDelegationToken AuthenticationType = "oauth_delegation_token" + // WorkloadIdentityFederation is used for token exchange grant auth type + WorkloadIdentityFederation AuthenticationType = "workload_identity_federation" // UnknownAuthenticationType is used for none meaningful auth type UnknownAuthenticationType AuthenticationType = "unknown_auth_type" ) @@ -51,7 +57,9 @@ type ConfigurationProvider interface { var fileMutex = sync.Mutex{} var fileCache = make(map[string][]byte) -func readFile(filename string) ([]byte, error) { +// Reads the file contents from cache if present otherwise reads the file. +// If file to be read is frequently updated/refreshed, please use readFile(filename) as readFileFromCache(filename) might return the old contents from the cache. +func readFileFromCache(filename string) ([]byte, error) { fileMutex.Lock() defer fileMutex.Unlock() val, ok := fileCache[filename] @@ -65,6 +73,14 @@ func readFile(filename string) ([]byte, error) { return val, err } +// Reads the file and returns the contents +func readFile(filename string) ([]byte, error) { + fileMutex.Lock() + defer fileMutex.Unlock() + val, err := os.ReadFile(filename) + return val, err +} + // IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error, this method will // not check AuthType(), since authType() is not required to be there. func IsConfigurationProviderValid(conf ConfigurationProvider) (ok bool, err error) { @@ -179,7 +195,7 @@ func (p environmentConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, } expandedPath := expandPath(value) - pemFileContent, err := readFile(expandedPath) + pemFileContent, err := readFileFromCache(expandedPath) if err != nil { Debugln("Can not read PrivateKey location from environment variable: " + environmentVariable) return @@ -343,7 +359,7 @@ func parseConfigFile(data []byte, profile string) (info *configFileInfo, err err //Look for profile for i, line := range splitContent { - if match := profileRegex.FindStringSubmatch(line); match != nil && len(match) > 1 && match[1] == profile { + if match := profileRegex.FindStringSubmatch(line); len(match) > 1 && match[1] == profile { start := i + 1 return parseConfigAtLine(start, splitContent) } @@ -415,7 +431,7 @@ func expandPath(filename string) (expandedPath string) { func openConfigFile(configFilePath string) (data []byte, err error) { expandedPath := expandPath(configFilePath) - data, err = readFile(expandedPath) + data, err = readFileFromCache(expandedPath) if err != nil { err = fmt.Errorf("can not read config file: %s due to: %s", configFilePath, err.Error()) } @@ -547,7 +563,7 @@ func (p fileConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err err } expandedPath := expandPath(filePath) - pemFileContent, err := readFile(expandedPath) + pemFileContent, err := readFileFromCache(expandedPath) if err != nil { err = fileConfigurationProviderError{err: fmt.Errorf("can not read PrivateKey from configuration file due to: %s", err.Error())} return @@ -589,7 +605,7 @@ func (p fileConfigurationProvider) AuthType() (AuthConfig, error) { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return AuthConfig{UnknownAuthenticationType, true, nil}, err } - val, err := presentOrError(info.AuthenticationType, hasAuthenticationType, info.PresentConfiguration, "authentication_type") + val, _ := presentOrError(info.AuthenticationType, hasAuthenticationType, info.PresentConfiguration, "authentication_type") if val == "instance_principal" { if filePath, err := presentOrError(info.DelegationTokenFilePath, hasDelegationTokenFile, info.PresentConfiguration, "delegationTokenFilePath"); err == nil { @@ -615,7 +631,7 @@ func getTokenContent(filePath string) (string, error) { err = fileConfigurationProviderError{err: fmt.Errorf("can not read token content from configuration file due to: %s", err.Error())} return "", err } - return fmt.Sprintf("%s", tokenFileContent), nil + return string(tokenFileContent), nil } // A configuration provider that look for information in multiple configuration providers @@ -720,6 +736,88 @@ func getRegionFromEnvVar() (string, error) { return "", fmt.Errorf("did not find OCI_REGION env var") } +type sessionTokenConfigurationProvider struct { + fileConfigurationProvider +} + +func (p sessionTokenConfigurationProvider) UserOCID() (value string, err error) { + info, err := p.readAndParseConfigFile() + if err != nil { + err = fileConfigurationProviderError{err: fmt.Errorf("can not read the configuration due to: %s", err.Error())} + return + } + // In case of session token-based authentication, userOCID will not be present + // need to check if session token path is provided in the configuration + if _, stErr := presentOrError(info.SecurityTokenFilePath, hasSecurityTokenFile, info.PresentConfiguration, + "securityTokenPath"); stErr == nil { + err = nil + } + return +} + +func (p sessionTokenConfigurationProvider) KeyID() (keyID string, err error) { + _, err = p.TenancyOCID() + if err != nil { + return + } + + _, err = p.KeyFingerprint() + if err != nil { + return + } + + info, err := p.readAndParseConfigFile() + if err != nil { + err = fileConfigurationProviderError{err: fmt.Errorf("can not read SessionTokenFilePath configuration due to: %s", err.Error())} + return + } + + filePath, pathErr := presentOrError(info.SecurityTokenFilePath, hasSecurityTokenFile, info.PresentConfiguration, "securityTokenFilePath") + if pathErr == nil { + rawString, err := getTokenContent(filePath) + if err != nil { + return "", fileConfigurationProviderError{err: err} + } + return "ST$" + rawString, nil + } + err = fileConfigurationProviderError{err: fmt.Errorf("can not read SessionTokenFilePath from configuration file due to: %s", pathErr.Error())} + return +} + +// ConfigurationProviderForSessionToken creates a session token configuration provider from a configuration file +// by reading the "DEFAULT" profile +func ConfigurationProviderForSessionToken(configFilePath, privateKeyPassword string) (ConfigurationProvider, error) { + if configFilePath == "" { + return nil, fileConfigurationProviderError{err: fmt.Errorf("config file path can not be empty")} + } + + return sessionTokenConfigurationProvider{ + fileConfigurationProvider{ + ConfigPath: configFilePath, + PrivateKeyPassword: privateKeyPassword, + Profile: "DEFAULT", + configMux: sync.Mutex{}}}, nil +} + +// ConfigurationProviderForSessionTokenWithProfile creates a session token configuration provider from a configuration file +// by reading the given profile +func ConfigurationProviderForSessionTokenWithProfile(configFilePath, profile, privateKeyPassword string) (ConfigurationProvider, error) { + if configFilePath == "" { + return nil, fileConfigurationProviderError{err: fmt.Errorf("config file path can not be empty")} + } + + return sessionTokenConfigurationProvider{ + fileConfigurationProvider{ + ConfigPath: configFilePath, + PrivateKeyPassword: privateKeyPassword, + Profile: profile, + configMux: sync.Mutex{}}}, nil +} + +func (p sessionTokenConfigurationProvider) Refreshable() bool { + return true +} + // RefreshableConfigurationProvider the interface to identity if the config provider is refreshable type RefreshableConfigurationProvider interface { Refreshable() bool diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/errors.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/errors.go index 75b59ff3f..007d9ba92 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/errors.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/errors.go @@ -1,15 +1,17 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "encoding/json" + "errors" "fmt" "io/ioutil" "net" "net/http" "strings" + "syscall" "github.com/sony/gobreaker" ) @@ -23,7 +25,7 @@ type ServiceError interface { GetMessage() string // A short error code that defines the error, meant for programmatic parsing. - // See https://docs.cloud.oracle.com/Content/API/References/apierrors.htm + // See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm GetCode() string // Unique Oracle-assigned identifier for the request. @@ -255,7 +257,7 @@ type NonSeekableRequestRetryFailure struct { func (ne NonSeekableRequestRetryFailure) Error() string { if ne.err == nil { - return fmt.Sprintf("Unable to perform Retry on this request body type, which did not implement seek() interface") + return "Unable to perform Retry on this request body type, which did not implement seek() interface" } return fmt.Sprintf("%s. Unable to perform Retry on this request body type, which did not implement seek() interface", ne.err.Error()) } @@ -266,9 +268,14 @@ func IsNetworkError(err error) bool { return false } - if r, ok := err.(net.Error); ok && (r.Temporary() || r.Timeout()) || strings.Contains(err.Error(), "net/http: HTTP/1.x transport connection broken") { + if errors.Is(err, syscall.ECONNRESET) { return true } + + if r, ok := err.(net.Error); ok && (r.Timeout() || strings.Contains(err.Error(), "net/http: HTTP/1.x transport connection broken")) { + return true + } + return false } @@ -287,7 +294,7 @@ func IsCircuitBreakerError(err error) bool { func getCircuitBreakerError(request *http.Request, err error, cbr *OciCircuitBreaker) error { cbErr := fmt.Errorf("%s, so this request was not sent to the %s service.\n\n The circuit breaker was opened because the %s service failed too many times recently. "+ "Because the circuit breaker has been opened, requests within a %.2f second window of when the circuit breaker opened will not be sent to the %s service.\n\n"+ - "URL which circuit breaker prevented request to - %s \n Circuit Breaker Info \n Name - %s \n State - %s \n\n Errors from %s service which opened the circuit breaker:\n\n%s \n", + "URL which circuit breaker prevented request to - %s \n Circuit Breaker Info \n Name - %s \n State - %s \n\n Errors from %s service which opened the circuit breaker:\n\n%s", err, cbr.Cbst.serviceName, cbr.Cbst.serviceName, cbr.Cbst.openStateWindow.Seconds(), cbr.Cbst.serviceName, request.URL.Host+request.URL.Path, cbr.Cbst.name, cbr.Cb.State().String(), cbr.Cbst.serviceName, cbr.GetHistory()) return cbErr } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go index 4e289e30b..282b5f65a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -51,6 +51,7 @@ var ( {400, "RelatedResourceNotAuthorizedOrNotFound"}: true, {404, "NotAuthorizedOrNotFound"}: true, {409, "NotAuthorizedOrResourceAlreadyExists"}: true, + {409, "ResourceAlreadyExists"}: true, {400, "InsufficientServicePermissions"}: true, {400, "ResourceDisabled"}: true, } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/helpers.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/helpers.go index d120065de..db6c1e992 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/helpers.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/helpers.go @@ -1,6 +1,8 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +//lint:file-ignore SA1019 older versions of staticcheck (those compatible with Golang 1.17) falsely flag x509.IsEncryptedPEMBlock and x509.DecryptPEMBlock. + package common import ( @@ -8,14 +10,16 @@ import ( "crypto/rsa" "crypto/x509" "encoding/pem" + "errors" "fmt" - "io/ioutil" "net/textproto" "os" "reflect" "strconv" "strings" "time" + + "github.com/youmark/pkcs8" ) // String returns a pointer to the provided string @@ -149,7 +153,7 @@ func tryParsing(data []byte, layouts ...string) (tm time.Time, err error) { return } } - err = fmt.Errorf("Could not parse time: %s with formats: %s", datestring, layouts[:]) + err = fmt.Errorf("could not parse time: %s with formats: %s", datestring, layouts[:]) return } @@ -221,24 +225,30 @@ func PrivateKeyFromBytes(pemData []byte, password *string) (key *rsa.PrivateKey, // PrivateKeyFromBytesWithPassword is a helper function that will produce a RSA private // key from bytes and a password. func PrivateKeyFromBytesWithPassword(pemData, password []byte) (key *rsa.PrivateKey, e error) { - if pemBlock, _ := pem.Decode(pemData); pemBlock != nil { - decrypted := pemBlock.Bytes - if x509.IsEncryptedPEMBlock(pemBlock) { - if password == nil { - e = fmt.Errorf("private key password is required for encrypted private keys") - return - } - if decrypted, e = x509.DecryptPEMBlock(pemBlock, password); e != nil { - return - } - } - - key, e = parsePKCSPrivateKey(decrypted) - - } else { + pemBlock, _ := pem.Decode(pemData) + if pemBlock == nil { e = fmt.Errorf("PEM data was not found in buffer") return } + + decrypted := pemBlock.Bytes + // Support for encrypted PKCS8 format, this format can not be handled by x509.IsEncryptedPEMBlock func + if key, e = pkcs8.ParsePKCS8PrivateKeyRSA(pemBlock.Bytes, password); key != nil { + return + } + // if pemBlock.Type == "ENCRYPTED PRIVATE KEY" { + // return pkcs8.ParsePKCS8PrivateKeyRSA(pemData, password) + // } + if x509.IsEncryptedPEMBlock(pemBlock) { + if password == nil { + return nil, errors.New("private key password is required for encrypted private keys") + } + + if decrypted, e = x509.DecryptPEMBlock(pemBlock, password); e != nil { + return + } + } + key, e = parsePKCSPrivateKey(decrypted) return } @@ -296,12 +306,3 @@ func IsEnvVarTrue(envVarKey string) bool { val, existed := os.LookupEnv(envVarKey) return existed && strings.ToLower(val) == "true" } - -// Reads the certs from pem file pointed by the R1_CERT_PEM env variable -func readCertPem(path string) []byte { - pem, err := ioutil.ReadFile(path) - if err != nil { - panic("can not read cert " + err.Error()) - } - return pem -} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go index f2d01ac92..171815244 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -22,6 +22,10 @@ import ( const ( //UsingExpectHeaderEnvVar is the key to determine whether expect 100-continue is enabled or not UsingExpectHeaderEnvVar = "OCI_GOSDK_USING_EXPECT_HEADER" + //EncodePathParamsEnvVar determines if special characters in path params such as / and & are URL encoded + EncodePathParamsEnvVar = "OCI_GOSDK_ENCODE_PATH_PARAMS" + // EscapeJSONToASCIIEnvVar determines if non-ASCII characters in JSON strings are escaped + EscapeJSONToASCIIEnvVar = "OCI_GOSDK_ESCAPE_JSON_ASCII" ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -255,6 +259,49 @@ func removeNilFieldsInJSONWithTaggedStruct(rawJSON []byte, value reflect.Value) return json.Marshal(fixedMap) } +// escapeJSONToASCII takes a JSON payload and returns an equivalent JSON where all string values are escaped to ASCII +func escapeJSONToASCII(rawJSON []byte) ([]byte, error) { + var rawInterface interface{} + decoder := json.NewDecoder(bytes.NewReader(rawJSON)) + decoder.UseNumber() + if err := decoder.Decode(&rawInterface); err != nil { + return nil, err + } + + // transform recursively visits the JSON value: + // - For objects (map[string[interface{}]]), recurse on each value + // - For arrays ([]interface{}), recurse on each element + // - For strings, produce a JSON-quoted ASCII-only representation + // - For other types, return as is + var transform func(interface{}) interface{} + transform = func(x interface{}) interface{} { + switch t := x.(type) { + case map[string]interface{}: + m := make(map[string]interface{}, len(t)) + for key, val := range t { + m[key] = transform(val) + } + return m + case []interface{}: + s := make([]interface{}, len(t)) + for i, val := range t { + s[i] = transform(val) + } + return s + case string: + // QuoteToASCII returns a 'quoted' JSON string containing only ASCII characters + // ex: input: "ハッピー" -> "\"\\u30cf\\u30c3\\u30d4\\u30fc\"" + // Returns as json.RawMessage so it gets embedded directly + q := strconv.AppendQuoteToASCII(nil, t) + return json.RawMessage(q) + default: + return x + } + } + + return json.Marshal(transform(rawInterface)) +} + func addToBody(request *http.Request, value reflect.Value, field reflect.StructField, binaryBodySpecified *bool) (e error) { Debugln("Marshaling to body from field:", field.Name) if request.Body != nil { @@ -277,6 +324,13 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF return } + if IsEnvVarTrue(EscapeJSONToASCIIEnvVar) { + marshaled, e = escapeJSONToASCII(marshaled) + if e != nil { + return + } + } + if defaultLogger.LogLevel() == verboseLogging { Debugf("Marshaled body is: %s\n", string(marshaled)) } @@ -296,7 +350,7 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF } func checkBinaryBodyLength(request *http.Request) (contentLen int64, err error) { - if reflect.TypeOf(request.Body) == reflect.TypeOf(ioutil.NopCloser(nil)) { + if isNopCloser(request.Body) { ioReader := reflect.ValueOf(request.Body).Field(0).Interface().(io.Reader) switch t := ioReader.(type) { case *bytes.Reader: @@ -319,10 +373,34 @@ func checkBinaryBodyLength(request *http.Request) (contentLen int64, err error) return getNormalBinaryBodyLength(request) } +// Helper function to judge if this struct is a nopCloser or nopCloserWriterTo +func isNopCloser(readCloser io.ReadCloser) bool { + if reflect.TypeOf(readCloser) == reflect.TypeOf(io.NopCloser(nil)) || reflect.TypeOf(readCloser) == reflect.TypeOf(io.NopCloser(struct { + io.Reader + io.WriterTo + }{})) { + return true + } + return false +} + func getNormalBinaryBodyLength(request *http.Request) (contentLen int64, err error) { - dumpRequestBody := ioutil.NopCloser(bytes.NewBuffer(nil)) + // If binary body is seekable + seeker := getSeeker(request.Body) + if seeker != nil { + // save the current position, calculate the unread body length and seek it back to current position + if curPos, err := seeker.Seek(0, io.SeekCurrent); err == nil { + if endPos, err := seeker.Seek(0, io.SeekEnd); err == nil { + contentLen = endPos - curPos + if _, err = seeker.Seek(curPos, io.SeekStart); err == nil { + return contentLen, nil + } + } + } + } + + var dumpRequestBody io.ReadCloser if dumpRequestBody, request.Body, err = drainBody(request.Body); err != nil { - dumpRequestBody = ioutil.NopCloser(bytes.NewBuffer(nil)) return contentLen, err } contentBody, err := ioutil.ReadAll(dumpRequestBody) @@ -332,6 +410,19 @@ func getNormalBinaryBodyLength(request *http.Request) (contentLen int64, err err return int64(len(contentBody)), nil } +func getSeeker(readCloser io.ReadCloser) (seeker io.Seeker) { + if seeker, ok := readCloser.(io.Seeker); ok { + return seeker + } + // the binary body is wrapped with io.NopCloser + if isNopCloser(readCloser) { + if seeker, ok := reflect.ValueOf(readCloser).Field(0).Interface().(io.Seeker); ok { + return seeker + } + } + return seeker +} + func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to query from field: ", field.Name) if request.URL == nil { @@ -424,6 +515,11 @@ func addToPath(request *http.Request, value reflect.Value, field reflect.StructF return fmt.Errorf("value cannot be empty for field %s in path", field.Name) } + // encode path param if EncodePathParamsEnvVar is set + if IsEnvVarTrue(EncodePathParamsEnvVar) { + additionalURLPathPart = url.PathEscape(additionalURLPathPart) + } + if request.URL == nil { request.URL = &url.URL{} request.URL.Path = "" @@ -489,8 +585,29 @@ func addToHeader(request *http.Request, value reflect.Value, field reflect.Struc } //Otherwise get value and set header - if headerValue, e = toStringValue(value, field); e != nil { - return + encoding := strings.ToLower(field.Tag.Get("collectionFormat")) + var collectionFormatStringValues []string + switch encoding { + case "csv", "multi": + if value.Kind() != reflect.Slice && value.Kind() != reflect.Array { + e = fmt.Errorf("header is tagged as csv or multi yet its type is neither an Array nor a Slice: %s", field.Name) + return + } + + numOfElements := value.Len() + collectionFormatStringValues = make([]string, numOfElements) + for i := 0; i < numOfElements; i++ { + collectionFormatStringValues[i], e = toStringValue(value.Index(i), field) + if e != nil { + Debugf("Header element could not be marshalled to a string: %w", e) + return + } + } + headerValue = strings.Join(collectionFormatStringValues, ",") + default: + if headerValue, e = toStringValue(value, field); e != nil { + return + } } if e = setWellKnownHeaders(request, headerName, headerValue, contentLenSpecified); e != nil { @@ -972,7 +1089,7 @@ func addFromHeaderCollection(response *http.Response, value *reflect.Value, fiel Debugln("Unmarshaling from header-collection to field:", field.Name) var headerPrefix string if headerPrefix = field.Tag.Get("prefix"); headerPrefix == "" { - return fmt.Errorf("Unmarshaling response to a header-collection requires the 'prefix' tag for field: %s", field.Name) + return fmt.Errorf("unmarshaling response to a header-collection requires the 'prefix' tag for field: %s", field.Name) } mapCollection := make(map[string]string) @@ -1031,6 +1148,11 @@ func responseToStruct(response *http.Response, val *reflect.Value, unmarshaler P // Notice the current implementation only supports native types:int, strings, floats, bool as the field types func UnmarshalResponse(httpResponse *http.Response, responseStruct interface{}) (err error) { + // Check for text/event-stream content type, and return without unmarshalling + if httpResponse != nil && httpResponse.Header != nil && strings.ToLower(httpResponse.Header.Get("content-type")) == "text/event-stream" { + return + } + var val *reflect.Value if val, err = checkForValidResponseStruct(responseStruct); err != nil { return diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/http_signer.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/http_signer.go index 225845785..43e0692e5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/http_signer.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/http_signer.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -197,7 +197,7 @@ func GetBodyHash(request *http.Request) (hashString string, err error) { } var data []byte - bReader := request.Body + var bReader io.Reader bReader, request.Body, err = drainBody(request.Body) if err != nil { return "", fmt.Errorf("can not read body of request while calculating body hash: %s", err.Error()) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/log.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/log.go index 27b5dbc1b..dfe628284 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/log.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/log.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/oci_http_transport_wrapper.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/oci_http_transport_wrapper.go new file mode 100644 index 000000000..bbce7df2f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/oci_http_transport_wrapper.go @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "fmt" + "net/http" + "sync" + "time" +) + +// OciHTTPTransportWrapper is a http.RoundTripper that periodically refreshes +// the underlying http.Transport according to its templates. +// Upon the first use (or once the RefreshRate duration is elapsed), +// a new transport will be created from the TransportTemplate (if set). +type OciHTTPTransportWrapper struct { + // RefreshRate specifies the duration at which http.Transport + // (with its tls.Config) must be refreshed. + // Defaults to 5 minutes. + RefreshRate time.Duration + + // TLSConfigProvider creates a new tls.Config. + // If not set, nil tls.Config is returned. + TLSConfigProvider TLSConfigProvider + + // ClientTemplate is responsible for creating a new http.Client with + // a given tls.Config. + // + // If not set, a new http.Client with a cloned http.DefaultTransport is returned. + TransportTemplate TransportTemplateProvider + + // mutable properties + mux sync.RWMutex + lastRefreshedAt time.Time + delegate http.RoundTripper +} + +// RoundTrip implements http.RoundTripper. +func (t *OciHTTPTransportWrapper) RoundTrip(req *http.Request) (*http.Response, error) { + delegate, err := t.refreshDelegate(false /* force */) + if err != nil { + return nil, err + } + + return delegate.RoundTrip(req) +} + +// Refresh forces refresh of the underlying delegate. +func (t *OciHTTPTransportWrapper) Refresh(force bool) error { + _, err := t.refreshDelegate(force) + return err +} + +// Delegate returns the currently active http.RoundTripper. +// Might be nil. +func (t *OciHTTPTransportWrapper) Delegate() http.RoundTripper { + t.mux.RLock() + defer t.mux.RUnlock() + + return t.delegate +} + +// refreshDelegate refreshes the delegate (and its TLS config) if: +// - force is true +// - it's been more than RefreshRate since the last time the client was refreshed. +func (t *OciHTTPTransportWrapper) refreshDelegate(force bool) (http.RoundTripper, error) { + // read-lock first, since it's cheaper than write lock + t.mux.RLock() + if !t.shouldRefreshLocked(force) { + delegate := t.delegate + t.mux.RUnlock() + + return delegate, nil + } + + // upgrade to write-lock, and we'll need to check again for the same condition as above + // to avoid multiple initializations by multiple "refresher" goroutines + t.mux.RUnlock() + t.mux.Lock() + defer t.mux.Unlock() + if !t.shouldRefreshLocked(force) { + return t.delegate, nil + } + + // For this check we need the delegate to be set once before we check for change in cert files + if t.delegate != nil && !t.TLSConfigProvider.WatchedFilesModified() { + Debug("No modification in custom certs or ca bundle skipping refresh") + // Updating the last refresh time to make sure the next check is only done after the refresh interval has passed + t.lastRefreshedAt = time.Now() + return t.delegate, nil + } + + Logf("Loading tls config from TLSConfigProvider") + tlsConfig, err := t.TLSConfigProvider.NewOrDefault() + if err != nil { + return nil, fmt.Errorf("refreshing tls.Config from template: %w", err) + } + + t.delegate, err = t.TransportTemplate.NewOrDefault(tlsConfig) + if err != nil { + return nil, fmt.Errorf("refreshing http.RoundTripper from template: %w", err) + } + + t.lastRefreshedAt = time.Now() + return t.delegate, nil +} + +// shouldRefreshLocked returns whether the client (and its TLS config) +// needs to be refreshed. +func (t *OciHTTPTransportWrapper) shouldRefreshLocked(force bool) bool { + if force || t.delegate == nil { + return true + } + return t.refreshRate() > 0 && time.Since(t.lastRefreshedAt) > t.refreshRate() +} + +func (t *OciHTTPTransportWrapper) refreshRate() time.Duration { + return t.RefreshRate +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go index 49ab7ee9b..ea08988af 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -72,6 +72,30 @@ const ( RegionEUMadrid1 Region = "eu-madrid-1" //RegionUSChicago1 region Chicago RegionUSChicago1 Region = "us-chicago-1" + //RegionMXMonterrey1 region Monterrey + RegionMXMonterrey1 Region = "mx-monterrey-1" + //RegionUSSaltlake2 region Saltlake + RegionUSSaltlake2 Region = "us-saltlake-2" + //RegionSABogota1 region Bogota + RegionSABogota1 Region = "sa-bogota-1" + //RegionSAValparaiso1 region Valparaiso + RegionSAValparaiso1 Region = "sa-valparaiso-1" + //RegionAPSingapore2 region Singapore + RegionAPSingapore2 Region = "ap-singapore-2" + //RegionMERiyadh1 region Riyadh + RegionMERiyadh1 Region = "me-riyadh-1" + //RegionAPDelhi1 region Delhi + RegionAPDelhi1 Region = "ap-delhi-1" + //RegionAPBatam1 region Batam + RegionAPBatam1 Region = "ap-batam-1" + //RegionEUMadrid3 region Madrid + RegionEUMadrid3 Region = "eu-madrid-3" + //RegionEUTurin1 region Turin + RegionEUTurin1 Region = "eu-turin-1" + //RegionAPKulai2 region Kulai + RegionAPKulai2 Region = "ap-kulai-2" + //RegionAFCasablanca1 region Casablanca + RegionAFCasablanca1 Region = "af-casablanca-1" //RegionUSLangley1 region Langley RegionUSLangley1 Region = "us-langley-1" //RegionUSLuke1 region Luke @@ -92,6 +116,8 @@ const ( RegionAPIbaraki1 Region = "ap-ibaraki-1" //RegionMEDccMuscat1 region Muscat RegionMEDccMuscat1 Region = "me-dcc-muscat-1" + //RegionMEIbri1 region Ibri + RegionMEIbri1 Region = "me-ibri-1" //RegionAPDccCanberra1 region Canberra RegionAPDccCanberra1 Region = "ap-dcc-canberra-1" //RegionEUDccMilan1 region Milan @@ -106,10 +132,46 @@ const ( RegionEUDccRating1 Region = "eu-dcc-rating-1" //RegionEUDccDublin1 region Dublin RegionEUDccDublin1 Region = "eu-dcc-dublin-1" + //RegionAPDccGazipur1 region Gazipur + RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" //RegionEUMadrid2 region Madrid RegionEUMadrid2 Region = "eu-madrid-2" + //RegionEUFrankfurt2 region Frankfurt + RegionEUFrankfurt2 Region = "eu-frankfurt-2" //RegionEUJovanovac1 region Jovanovac RegionEUJovanovac1 Region = "eu-jovanovac-1" + //RegionMEDccDoha1 region Doha + RegionMEDccDoha1 Region = "me-dcc-doha-1" + //RegionUSSomerset1 region Somerset + RegionUSSomerset1 Region = "us-somerset-1" + //RegionUSThames1 region Thames + RegionUSThames1 Region = "us-thames-1" + //RegionEUDccZurich1 region Zurich + RegionEUDccZurich1 Region = "eu-dcc-zurich-1" + //RegionEUCrissier1 region Crissier + RegionEUCrissier1 Region = "eu-crissier-1" + //RegionMEAbudhabi3 region Abudhabi + RegionMEAbudhabi3 Region = "me-abudhabi-3" + //RegionMEAlain1 region Alain + RegionMEAlain1 Region = "me-alain-1" + //RegionMEAbudhabi2 region Abudhabi + RegionMEAbudhabi2 Region = "me-abudhabi-2" + //RegionMEAbudhabi4 region Abudhabi + RegionMEAbudhabi4 Region = "me-abudhabi-4" + //RegionAPSeoul2 region Seoul + RegionAPSeoul2 Region = "ap-seoul-2" + //RegionAPSuwon1 region Suwon + RegionAPSuwon1 Region = "ap-suwon-1" + //RegionAPChuncheon2 region Chuncheon + RegionAPChuncheon2 Region = "ap-chuncheon-2" + //RegionUSAshburn2 region Ashburn + RegionUSAshburn2 Region = "us-ashburn-2" + //RegionUSNewark1 region Newark + RegionUSNewark1 Region = "us-newark-1" + //RegionEUBudapest1 region Budapest + RegionEUBudapest1 Region = "eu-budapest-1" + //RegionSARiodejaneiro1 region Riodejaneiro + RegionSARiodejaneiro1 Region = "sa-riodejaneiro-1" ) var shortNameRegion = map[string]Region{ @@ -147,6 +209,18 @@ var shortNameRegion = map[string]Region{ "qro": RegionMXQueretaro1, "mad": RegionEUMadrid1, "ord": RegionUSChicago1, + "mty": RegionMXMonterrey1, + "aga": RegionUSSaltlake2, + "bog": RegionSABogota1, + "vap": RegionSAValparaiso1, + "xsp": RegionAPSingapore2, + "ruh": RegionMERiyadh1, + "onm": RegionAPDelhi1, + "hsg": RegionAPBatam1, + "orf": RegionEUMadrid3, + "nrq": RegionEUTurin1, + "jbp": RegionAPKulai2, + "lej": RegionAFCasablanca1, "lfi": RegionUSLangley1, "luf": RegionUSLuke1, "ric": RegionUSGovAshburn1, @@ -157,6 +231,7 @@ var shortNameRegion = map[string]Region{ "nja": RegionAPChiyoda1, "ukb": RegionAPIbaraki1, "mct": RegionMEDccMuscat1, + "ibr": RegionMEIbri1, "wga": RegionAPDccCanberra1, "bgy": RegionEUDccMilan1, "mxp": RegionEUDccMilan2, @@ -164,8 +239,26 @@ var shortNameRegion = map[string]Region{ "dtm": RegionEUDccRating2, "dus": RegionEUDccRating1, "ork": RegionEUDccDublin1, + "dac": RegionAPDccGazipur1, "vll": RegionEUMadrid2, + "str": RegionEUFrankfurt2, "beg": RegionEUJovanovac1, + "doh": RegionMEDccDoha1, + "ebb": RegionUSSomerset1, + "ebl": RegionUSThames1, + "avz": RegionEUDccZurich1, + "avf": RegionEUCrissier1, + "ahu": RegionMEAbudhabi3, + "rba": RegionMEAlain1, + "rkt": RegionMEAbudhabi2, + "shj": RegionMEAbudhabi4, + "dtz": RegionAPSeoul2, + "dln": RegionAPSuwon1, + "bno": RegionAPChuncheon2, + "yxj": RegionUSAshburn2, + "pgc": RegionUSNewark1, + "jsk": RegionEUBudapest1, + "hnw": RegionSARiodejaneiro1, } var realm = map[string]string{ @@ -177,8 +270,18 @@ var realm = map[string]string{ "oc9": "oraclecloud9.com", "oc10": "oraclecloud10.com", "oc14": "oraclecloud14.com", + "oc15": "oraclecloud15.com", "oc19": "oraclecloud.eu", "oc20": "oraclecloud20.com", + "oc21": "oraclecloud21.com", + "oc23": "oraclecloud23.com", + "oc24": "oraclecloud24.com", + "oc26": "oraclecloud26.com", + "oc29": "oraclecloud29.com", + "oc35": "oraclecloud35.com", + "oc42": "oraclecloud42.com", + "oc51": "oraclecloud51.com", + "oc52": "oraclecloud52.com", } var regionRealm = map[Region]string{ @@ -216,6 +319,18 @@ var regionRealm = map[Region]string{ RegionMXQueretaro1: "oc1", RegionEUMadrid1: "oc1", RegionUSChicago1: "oc1", + RegionMXMonterrey1: "oc1", + RegionUSSaltlake2: "oc1", + RegionSABogota1: "oc1", + RegionSAValparaiso1: "oc1", + RegionAPSingapore2: "oc1", + RegionMERiyadh1: "oc1", + RegionAPDelhi1: "oc1", + RegionAPBatam1: "oc1", + RegionEUMadrid3: "oc1", + RegionEUTurin1: "oc1", + RegionAPKulai2: "oc1", + RegionAFCasablanca1: "oc1", RegionUSLangley1: "oc2", RegionUSLuke1: "oc2", @@ -231,6 +346,7 @@ var regionRealm = map[Region]string{ RegionAPIbaraki1: "oc8", RegionMEDccMuscat1: "oc9", + RegionMEIbri1: "oc9", RegionAPDccCanberra1: "oc10", @@ -241,7 +357,35 @@ var regionRealm = map[Region]string{ RegionEUDccRating1: "oc14", RegionEUDccDublin1: "oc14", - RegionEUMadrid2: "oc19", + RegionAPDccGazipur1: "oc15", + + RegionEUMadrid2: "oc19", + RegionEUFrankfurt2: "oc19", RegionEUJovanovac1: "oc20", + + RegionMEDccDoha1: "oc21", + + RegionUSSomerset1: "oc23", + RegionUSThames1: "oc23", + + RegionEUDccZurich1: "oc24", + RegionEUCrissier1: "oc24", + + RegionMEAbudhabi3: "oc26", + RegionMEAlain1: "oc26", + + RegionMEAbudhabi2: "oc29", + RegionMEAbudhabi4: "oc29", + + RegionAPSeoul2: "oc35", + RegionAPSuwon1: "oc35", + RegionAPChuncheon2: "oc35", + + RegionUSAshburn2: "oc42", + RegionUSNewark1: "oc42", + + RegionEUBudapest1: "oc51", + + RegionSARiodejaneiro1: "oc52", } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json index c9549a097..4c5c77181 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json @@ -316,5 +316,191 @@ "realmKey": "oc19", "regionIdentifier": "eu-madrid-2", "realmDomainComponent": "oraclecloud.eu" + }, + { + "regionKey": "str", + "realmKey": "oc19", + "regionIdentifier": "eu-frankfurt-2", + "realmDomainComponent": "oraclecloud.eu" + }, + { + "regionKey": "mty", + "realmKey": "oc1", + "regionIdentifier": "mx-monterrey-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "aga", + "realmKey": "oc1", + "regionIdentifier": "us-saltlake-2", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "avz", + "realmKey": "oc24", + "regionIdentifier": "eu-dcc-zurich-1", + "realmDomainComponent": "oraclecloud24.com" + }, + { + "regionKey": "bog", + "realmKey": "oc1", + "regionIdentifier": "sa-bogota-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "vap", + "realmKey": "oc1", + "regionIdentifier": "sa-valparaiso-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "doh", + "realmKey": "oc21", + "regionIdentifier": "me-dcc-doha-1", + "realmDomainComponent": "oraclecloud21.com" + }, + { + "regionKey": "ahu", + "realmKey": "oc26", + "regionIdentifier": "me-abudhabi-3", + "realmDomainComponent": "oraclecloud26.com" + }, + { + "regionKey": "dac", + "realmKey": "oc15", + "regionIdentifier": "ap-dcc-gazipur-1", + "realmDomainComponent": "oraclecloud15.com" + }, + { + "regionKey": "xsp", + "realmKey": "oc1", + "regionIdentifier": "ap-singapore-2", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "rkt", + "realmKey": "oc29", + "regionIdentifier": "me-abudhabi-2", + "realmDomainComponent": "oraclecloud29.com" + }, + { + "regionKey": "ruh", + "realmKey": "oc1", + "regionIdentifier": "me-riyadh-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "shj", + "realmKey": "oc29", + "regionIdentifier": "me-abudhabi-4", + "realmDomainComponent": "oraclecloud29.com" + }, + { + "regionKey": "avf", + "realmKey": "oc24", + "regionIdentifier": "eu-crissier-1", + "realmDomainComponent": "oraclecloud24.com" + }, + { + "regionKey": "ebb", + "realmKey": "oc23", + "regionIdentifier": "us-somerset-1", + "realmDomainComponent": "oraclecloud23.com" + }, + { + "regionKey": "ebl", + "realmKey": "oc23", + "regionIdentifier": "us-thames-1", + "realmDomainComponent": "oraclecloud23.com" + }, + { + "regionKey": "dtz", + "realmKey": "oc35", + "regionIdentifier": "ap-seoul-2", + "realmDomainComponent": "oraclecloud35.com" + }, + { + "regionKey": "dln", + "realmKey": "oc35", + "regionIdentifier": "ap-suwon-1", + "realmDomainComponent": "oraclecloud35.com" + }, + { + "regionKey": "bno", + "realmKey": "oc35", + "regionIdentifier": "ap-chuncheon-2", + "realmDomainComponent": "oraclecloud35.com" + }, + { + "regionKey": "rba", + "realmKey": "oc26", + "regionIdentifier": "me-alain-1", + "realmDomainComponent": "oraclecloud26.com" + }, + { + "regionKey": "yxj", + "realmKey": "oc42", + "regionIdentifier": "us-ashburn-2", + "realmDomainComponent": "oraclecloud42.com" + }, + { + "regionKey": "onm", + "realmKey": "oc1", + "regionIdentifier": "ap-delhi-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "hsg", + "realmKey": "oc1", + "regionIdentifier": "ap-batam-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "pgc", + "realmKey": "oc42", + "regionIdentifier": "us-newark-1", + "realmDomainComponent": "oraclecloud42.com" + }, + { + "regionKey": "jsk", + "realmKey": "oc51", + "regionIdentifier": "eu-budapest-1", + "realmDomainComponent": "oraclecloud51.com" + }, + { + "regionKey": "ibr", + "realmKey": "oc9", + "regionIdentifier": "me-ibri-1", + "realmDomainComponent": "oraclecloud9.com" + }, + { + "regionKey": "orf", + "realmKey": "oc1", + "regionIdentifier": "eu-madrid-3", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "nrq", + "realmKey": "oc1", + "regionIdentifier": "eu-turin-1", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "hnw", + "realmKey": "oc52", + "regionIdentifier": "sa-riodejaneiro-1", + "realmDomainComponent": "oraclecloud52.com" + }, + { + "regionKey": "jbp", + "realmKey": "oc1", + "regionIdentifier": "ap-kulai-2", + "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "lej", + "realmKey": "oc1", + "regionIdentifier": "af-casablanca-1", + "realmDomainComponent": "oraclecloud.com" } ] \ No newline at end of file diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/retry.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/retry.go index 782b12ef9..18c473e0a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/retry.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/retry.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common @@ -74,6 +74,7 @@ const ( var ( defaultRetryStatusCodeMap = map[StatErrCode]bool{ {409, "IncorrectState"}: true, + {409, "LockConflict"}: true, {429, "TooManyRequests"}: true, {501, "MethodNotImplemented"}: false, @@ -184,10 +185,20 @@ var GlobalRetry *RetryPolicy = nil // RetryPolicyOption is the type of the options for NewRetryPolicy. type RetryPolicyOption func(rp *RetryPolicy) -// Convert retry policy to human-readable string representation -func (rp RetryPolicy) String() string { +// String converts retry policy to human-readable string representation +// Safe to call on a nil *RetryPolicy +func (rp *RetryPolicy) String() string { + if rp == nil { + return "" + } + + nonECPolicy := "" + if rp.NonEventuallyConsistentPolicy != nil { + nonECPolicy = rp.NonEventuallyConsistentPolicy.String() + } + return fmt.Sprintf("{MaximumNumberAttempts=%v, MinSleepBetween=%v, MaxSleepBetween=%v, ExponentialBackoffBase=%v, NonEventuallyConsistentPolicy=%v}", - rp.MaximumNumberAttempts, rp.MinSleepBetween, rp.MaxSleepBetween, rp.ExponentialBackoffBase, rp.NonEventuallyConsistentPolicy) + rp.MaximumNumberAttempts, rp.MinSleepBetween, rp.MaxSleepBetween, rp.ExponentialBackoffBase, nonECPolicy) } // Validate returns true if the RetryPolicy is valid; if not, it also returns an error. @@ -369,7 +380,7 @@ func DefaultShouldRetryOperation(r OCIOperationResponse) bool { } // DefaultRetryPolicy is a helper method that assembles and returns a return policy that is defined to be a default one -// The default retry policy will retry on (409, IncorrectState), (429, TooManyRequests) and any 5XX errors except (501, MethodNotImplemented) +// The default retry policy will retry on (409, IncorrectState), (409, LockConflict), (429, TooManyRequests) and any 5XX errors except (501, MethodNotImplemented) // The default retry behavior is using exponential backoff with jitter, the maximum wait time is 30s plus 1s jitter // The maximum cumulative backoff after all 8 attempts have been made is about 1.5 minutes. // It will also retry on errors affected by eventual consistency. @@ -382,7 +393,7 @@ func DefaultRetryPolicy() RetryPolicy { } // DefaultRetryPolicyWithoutEventualConsistency is a helper method that assembles and returns a return policy that is defined to be a default one -// The default retry policy will retry on (409, IncorrectState), (429, TooManyRequests) and any 5XX errors except (501, MethodNotImplemented) +// The default retry policy will retry on (409, IncorrectState), (409, LockConflict), (429, TooManyRequests) and any 5XX errors except (501, MethodNotImplemented) // It will not retry on errors affected by eventual consistency. // The default retry behavior is using exponential backoff with jitter, the maximum wait time is 30s plus 1s jitter func DefaultRetryPolicyWithoutEventualConsistency() RetryPolicy { @@ -753,7 +764,7 @@ func determinePolicyToUse(policy RetryPolicy) (RetryPolicy, *time.Time, float64) var useDefaultTimingInstead = true var endOfWindowTime = (*time.Time)(nil) var backoffScalingFactor = 1.0 - var policyToUse RetryPolicy = policy + var policyToUse = policy eowt := EcContext.GetEndOfWindow() if eowt != nil { @@ -774,17 +785,17 @@ func determinePolicyToUse(policy RetryPolicy) (RetryPolicy, *time.Time, float64) Debugln(fmt.Sprintf("Use eventually consistent timing, durationToEndOfWindow = %v, maximumCumulativeBackoffWithoutJitter = %v, backoffScalingFactor = %.2f", durationToEndOfWindow, maximumCumulativeBackoffWithoutJitter, backoffScalingFactor)) } else { - Debugln(fmt.Sprintf("Use default timing, end of EC window is sooner than default retries")) + Debugln("Use default timing, end of EC window is sooner than default retries") } } else { useDefaultTimingInstead = false policyToUse = *policy.NonEventuallyConsistentPolicy - Debugln(fmt.Sprintf("Use default timing and strategy, end of EC window is in the past")) + Debugln("Use default timing and strategy, end of EC window is in the past") } } else { useDefaultTimingInstead = false policyToUse = *policy.NonEventuallyConsistentPolicy - Debugln(fmt.Sprintf("Use default timing and strategy, no EC window set")) + Debugln("Use default timing and strategy, no EC window set") } if useDefaultTimingInstead { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/sseReader.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/sseReader.go new file mode 100644 index 000000000..850cd3563 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/sseReader.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "bufio" + "bytes" + "context" + "io" + "net/http" +) + +type SseReader struct { + HttpBody io.ReadCloser + eventScanner bufio.Scanner + OnClose func(r *SseReader) +} + +// InvalidSSEResponseError returned in the case that a nil response body was given +// to NewSSEReader() +type InvalidSSEResponseError struct { +} + +const InvalidResponseErrorMessage = "invalid response struct given to NewSSEReader" + +func (e InvalidSSEResponseError) Error() string { + return InvalidResponseErrorMessage +} + +// NewSSEReader returns an SSE Reader given an sse response +func NewSSEReader(response *http.Response) (*SseReader, error) { + + if response == nil || response.Body == nil { + return nil, InvalidSSEResponseError{} + } + + reader := &SseReader{ + HttpBody: response.Body, + eventScanner: *bufio.NewScanner(response.Body), + OnClose: func(r *SseReader) { r.HttpBody.Close() }, // Default on close function, ensures body is closed after use + } + return reader, nil +} + +// Take the response in bytes and trim it if necessary +func processEvent(e []byte) []byte { + e = bytes.TrimPrefix(e, []byte("data: ")) // Text/event-stream always prefixed with 'data: ' + return e +} + +// ReadNextEvent reads the next event in the stream, return it unmarshalled +func (r *SseReader) ReadNextEvent() (event []byte, err error) { + if r.eventScanner.Scan() { + eventBytes := r.eventScanner.Bytes() + return processEvent(eventBytes), nil + } else { + + // Close out the stream since we are finished reading from it + if r.OnClose != nil { + r.OnClose(r) + } + + err := r.eventScanner.Err() + if err == context.Canceled || err == nil { + err = io.EOF + } + return nil, err + } + +} + +// ReadAllEvents reads all events from the response stream, and processes each with given event handler +func (r *SseReader) ReadAllEvents(eventHandler func(e []byte)) error { + for { + + event, err := r.ReadNextEvent() + + if err != nil { + + if err == io.EOF { + err = nil + } + return err + } + + // Ignore empty events + if len(event) > 0 { + eventHandler(event) + } + } +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/tls_config_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/tls_config_provider.go new file mode 100644 index 000000000..d01ec07d7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/tls_config_provider.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "os" + "sync" +) + +// GetTLSConfigTemplateForTransport returns the TLSConfigTemplate to used depending on whether any additional +// CA Bundle or client side certs have been configured +func GetTLSConfigTemplateForTransport() TLSConfigProvider { + certPath := os.Getenv(ociDefaultClientCertsPath) + keyPath := os.Getenv(ociDefaultClientCertsPrivateKeyPath) + caBundlePath := os.Getenv(ociDefaultCertsPath) + if certPath != "" && keyPath != "" { + return &DefaultMTLSConfigProvider{ + caBundlePath: caBundlePath, + clientCertPath: certPath, + clientKeyPath: keyPath, + watchedFilesStatsMap: make(map[string]os.FileInfo), + } + } + return &DefaultTLSConfigProvider{ + caBundlePath: caBundlePath, + } +} + +// TLSConfigProvider is an interface the defines a function that creates a new *tls.Config. +type TLSConfigProvider interface { + NewOrDefault() (*tls.Config, error) + WatchedFilesModified() bool +} + +// DefaultTLSConfigProvider is a provider that provides a TLS tls.config for the HTTPTransport +type DefaultTLSConfigProvider struct { + caBundlePath string + mux sync.Mutex + currentStat os.FileInfo +} + +// NewOrDefault returns a default tls.Config which +// sets its RootCAs to be a *x509.CertPool from caBundlePath. +func (t *DefaultTLSConfigProvider) NewOrDefault() (*tls.Config, error) { + if t.caBundlePath == "" { + return &tls.Config{}, nil + } + + // Keep the current Stat info from the ca bundle in a map + Debugf("Getting Initial Stats for file: %s", t.caBundlePath) + caBundleStat, err := os.Stat(t.caBundlePath) + if err != nil { + return nil, err + } + t.mux.Lock() + defer t.mux.Unlock() + t.currentStat = caBundleStat + + rootCAs, err := CertPoolFrom(t.caBundlePath) + if err != nil { + return nil, err + } + return &tls.Config{ + RootCAs: rootCAs, + }, nil +} + +// WatchedFilesModified returns true if any files in the watchedFilesStatsMap has been modified else returns false +func (t *DefaultTLSConfigProvider) WatchedFilesModified() bool { + modified := false + if t.caBundlePath != "" { + newStat, err := os.Stat(t.caBundlePath) + if err == nil && (t.currentStat.Size() != newStat.Size() || t.currentStat.ModTime() != newStat.ModTime()) { + Logf("Modification detected in cert/ca-bundle file: %s", t.caBundlePath) + modified = true + t.mux.Lock() + defer t.mux.Unlock() + t.currentStat = newStat + } + } + return modified +} + +// DefaultMTLSConfigProvider is a provider that provides a MTLS tls.config for the HTTPTransport +type DefaultMTLSConfigProvider struct { + caBundlePath string + clientCertPath string + clientKeyPath string + mux sync.Mutex + watchedFilesStatsMap map[string]os.FileInfo +} + +// NewOrDefault returns a default tls.Config which sets its RootCAs +// to be a *x509.CertPool from caBundlePath and calls +// tls.LoadX509KeyPair(clientCertPath, clientKeyPath) to set mtls client certs. +func (t *DefaultMTLSConfigProvider) NewOrDefault() (*tls.Config, error) { + rootCAs, err := CertPoolFrom(t.caBundlePath) + if err != nil { + return nil, err + } + cert, err := tls.LoadX509KeyPair(t.clientCertPath, t.clientKeyPath) + if err != nil { + return nil, err + } + + // Configure the initial certs file stats, error skipped because we error out before this if the files don't exist + t.mux.Lock() + defer t.mux.Unlock() + t.watchedFilesStatsMap[t.caBundlePath], _ = os.Stat(t.caBundlePath) + t.watchedFilesStatsMap[t.clientCertPath], _ = os.Stat(t.clientCertPath) + t.watchedFilesStatsMap[t.clientKeyPath], _ = os.Stat(t.clientKeyPath) + + return &tls.Config{ + RootCAs: rootCAs, + Certificates: []tls.Certificate{cert}, + }, nil +} + +// WatchedFilesModified returns true if any files in the watchedFilesStatsMap has been modified else returns false +func (t *DefaultMTLSConfigProvider) WatchedFilesModified() bool { + modified := false + + t.mux.Lock() + defer t.mux.Unlock() + for k, v := range t.watchedFilesStatsMap { + if k != "" { + currentStat, err := os.Stat(k) + if err == nil && (v.Size() != currentStat.Size() || v.ModTime() != currentStat.ModTime()) { + modified = true + Logf("Modification detected in cert/ca-bundle file: %s", k) + t.watchedFilesStatsMap[k] = currentStat + } + } + } + + return modified +} + +// CertPoolFrom creates a new x509.CertPool from a given file. +func CertPoolFrom(caBundleFile string) (*x509.CertPool, error) { + pemCerts, err := os.ReadFile(caBundleFile) + if err != nil { + return nil, err + } + + trust := x509.NewCertPool() + if !trust.AppendCertsFromPEM(pemCerts) { + return nil, fmt.Errorf("creating a new x509.CertPool from %s: no certs added", caBundleFile) + } + + return trust, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/transport_template_provider.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/transport_template_provider.go new file mode 100644 index 000000000..f37ab0f0d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/transport_template_provider.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +package common + +import ( + "crypto/tls" + "net" + "net/http" + "time" +) + +// TransportTemplateProvider defines a function that creates a new http transport +// from a given TLS client config. +type TransportTemplateProvider func(tlsClientConfig *tls.Config) (http.RoundTripper, error) + +// NewOrDefault creates a new TransportTemplate +// If t is nil, then DefaultTransport is returned +func (t TransportTemplateProvider) NewOrDefault(tlsClientConfig *tls.Config) (http.RoundTripper, error) { + if t == nil { + return DefaultTransport(tlsClientConfig) + } + return t(tlsClientConfig) +} + +// DefaultTransport creates a clone of http.DefaultTransport +// and applies the tlsClientConfig on top of it. +// The result is never nil, to prevent panics in client code. +// Never returns any errors, but needs to return an error +// to adhere to TransportTemplate interface. +func DefaultTransport(tlsClientConfig *tls.Config) (*http.Transport, error) { + transport := CloneHTTPDefaultTransport() + if isExpectHeaderDisabled := IsEnvVarFalse(UsingExpectHeaderEnvVar); !isExpectHeaderDisabled { + transport.Proxy = http.ProxyFromEnvironment + transport.DialContext = (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext + transport.ForceAttemptHTTP2 = true + transport.MaxIdleConns = 100 + transport.IdleConnTimeout = 90 * time.Second + transport.TLSHandshakeTimeout = 10 * time.Second + transport.ExpectContinueTimeout = 3 * time.Second + } + transport.TLSClientConfig = tlsClientConfig + return transport, nil +} + +// CloneHTTPDefaultTransport returns a clone of http.DefaultTransport. +func CloneHTTPDefaultTransport() *http.Transport { + return http.DefaultTransport.(*http.Transport).Clone() +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/utils/opc_request_id.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/utils/opc_request_id.go index 55615503a..db3293383 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/utils/opc_request_id.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/utils/opc_request_id.go @@ -6,8 +6,7 @@ import ( "fmt" ) -// GenerateOpcRequestId -// Reference: https://confluence.oci.oraclecorp.com/display/DEX/Request+IDs +// GenerateOpcRequestID - // Maximum segment length: 32 characters // Allowed segment contents: regular expression pattern /^[a-zA-Z0-9]{0,32}$/ func GenerateOpcRequestID() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go index f03d28578..99cd2f9c4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "41" - patch = "1" + minor = "113" + patch = "0" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application.go index d81e42744..e51ab2bc6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // Application An application contains functions and defined attributes shared between those functions, such as network configuration and configuration. Avoid entering confidential information. type Application struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application. Id *string `mandatory:"true" json:"id"` // The OCID of the compartment that contains the application. @@ -36,7 +36,7 @@ type Application struct { // The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. Config map[string]string `mandatory:"false" json:"config"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. SubnetIds []string `mandatory:"false" json:"subnetIds"` // Valid values are `GENERIC_X86`, `GENERIC_ARM` and `GENERIC_X86_ARM`. Default is `GENERIC_X86`. Setting this to `GENERIC_X86`, will run the functions in the application on X86 processor architecture. @@ -46,7 +46,7 @@ type Application struct { // `GENERIC_X86`, `GENERIC_ARM`, `GENERIC_X86_ARM` Shape ApplicationShapeEnum `mandatory:"false" json:"shape,omitempty"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` // A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. @@ -57,12 +57,14 @@ type Application struct { TraceConfig *ApplicationTraceConfig `mandatory:"false" json:"traceConfig"` + Logging *ApplicationLoggingConfig `mandatory:"false" json:"logging"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -77,6 +79,11 @@ type Application struct { TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` ImagePolicyConfig *ImagePolicyConfig `mandatory:"false" json:"imagePolicyConfig"` + + // Security attributes for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "enforce"}}}` + SecurityAttributes map[string]map[string]interface{} `mandatory:"false" json:"securityAttributes"` } func (m Application) String() string { @@ -96,7 +103,7 @@ func (m Application) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetApplicationShapeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_logging_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_logging_config.go new file mode 100644 index 000000000..352ca5428 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_logging_config.go @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApplicationLoggingConfig Set logging configuration for an application. This is only used if Service Logs for the application are enabled in the OCI Logging service. +type ApplicationLoggingConfig struct { + + // Specify the format of log lines emitted by functions in this application. + LineFormat ApplicationLoggingConfigLineFormatEnum `mandatory:"false" json:"lineFormat,omitempty"` +} + +func (m ApplicationLoggingConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ApplicationLoggingConfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingApplicationLoggingConfigLineFormatEnum(string(m.LineFormat)); !ok && m.LineFormat != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LineFormat: %s. Supported values are: %s.", m.LineFormat, strings.Join(GetApplicationLoggingConfigLineFormatEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ApplicationLoggingConfigLineFormatEnum Enum with underlying type: string +type ApplicationLoggingConfigLineFormatEnum string + +// Set of constants representing the allowable values for ApplicationLoggingConfigLineFormatEnum +const ( + ApplicationLoggingConfigLineFormatJson ApplicationLoggingConfigLineFormatEnum = "JSON" + ApplicationLoggingConfigLineFormatPlainText ApplicationLoggingConfigLineFormatEnum = "PLAIN_TEXT" +) + +var mappingApplicationLoggingConfigLineFormatEnum = map[string]ApplicationLoggingConfigLineFormatEnum{ + "JSON": ApplicationLoggingConfigLineFormatJson, + "PLAIN_TEXT": ApplicationLoggingConfigLineFormatPlainText, +} + +var mappingApplicationLoggingConfigLineFormatEnumLowerCase = map[string]ApplicationLoggingConfigLineFormatEnum{ + "json": ApplicationLoggingConfigLineFormatJson, + "plain_text": ApplicationLoggingConfigLineFormatPlainText, +} + +// GetApplicationLoggingConfigLineFormatEnumValues Enumerates the set of values for ApplicationLoggingConfigLineFormatEnum +func GetApplicationLoggingConfigLineFormatEnumValues() []ApplicationLoggingConfigLineFormatEnum { + values := make([]ApplicationLoggingConfigLineFormatEnum, 0) + for _, v := range mappingApplicationLoggingConfigLineFormatEnum { + values = append(values, v) + } + return values +} + +// GetApplicationLoggingConfigLineFormatEnumStringValues Enumerates the set of values in String for ApplicationLoggingConfigLineFormatEnum +func GetApplicationLoggingConfigLineFormatEnumStringValues() []string { + return []string{ + "JSON", + "PLAIN_TEXT", + } +} + +// GetMappingApplicationLoggingConfigLineFormatEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingApplicationLoggingConfigLineFormatEnum(val string) (ApplicationLoggingConfigLineFormatEnum, bool) { + enum, ok := mappingApplicationLoggingConfigLineFormatEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_summary.go index 858eab37f..26fb96348 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_summary.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // ApplicationSummary Summary of an application. type ApplicationSummary struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application. Id *string `mandatory:"true" json:"id"` // The OCID of the compartment that contains the application. @@ -30,7 +30,7 @@ type ApplicationSummary struct { // The current state of the application. LifecycleState ApplicationLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. SubnetIds []string `mandatory:"false" json:"subnetIds"` // Valid values are `GENERIC_X86`, `GENERIC_ARM` and `GENERIC_X86_ARM`. Default is `GENERIC_X86`. Setting this to `GENERIC_X86`, will run the functions in the application on X86 processor architecture. @@ -40,17 +40,19 @@ type ApplicationSummary struct { // `GENERIC_X86`, `GENERIC_ARM`, `GENERIC_X86_ARM` Shape ApplicationSummaryShapeEnum `mandatory:"false" json:"shape,omitempty"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` TraceConfig *ApplicationTraceConfig `mandatory:"false" json:"traceConfig"` + Logging *ApplicationLoggingConfig `mandatory:"false" json:"logging"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -65,6 +67,11 @@ type ApplicationSummary struct { TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` ImagePolicyConfig *ImagePolicyConfig `mandatory:"false" json:"imagePolicyConfig"` + + // Security attributes for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "enforce"}}}` + SecurityAttributes map[string]map[string]interface{} `mandatory:"false" json:"securityAttributes"` } func (m ApplicationSummary) String() string { @@ -84,7 +91,7 @@ func (m ApplicationSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetApplicationSummaryShapeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_trace_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_trace_config.go index c0bbe6883..128b2f4f8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_trace_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/application_trace_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -36,7 +36,7 @@ func (m ApplicationTraceConfig) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_details.go index 506df292d..f86c8fa7f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // ChangeApplicationCompartmentDetails Properties to change the compartment of an application. type ChangeApplicationCompartmentDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // into which the resource should be moved. CompartmentId *string `mandatory:"true" json:"compartmentId"` } @@ -34,7 +34,7 @@ func (m ChangeApplicationCompartmentDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_request_response.go index 180b9794f..af4e761c3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/change_application_compartment_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ChangeApplicationCompartment.go.html to see an example of how to use ChangeApplicationCompartmentRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ChangeApplicationCompartment.go.html to see an example of how to use ChangeApplicationCompartmentRequest. type ChangeApplicationCompartmentRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. ApplicationId *string `mandatory:"true" contributesTo:"path" name:"applicationId"` // Properties to change the compartment of an application. @@ -70,7 +70,7 @@ func (request ChangeApplicationCompartmentRequest) RetryPolicy() *common.RetryPo func (request ChangeApplicationCompartmentRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/config_details.go index 03dbab992..b5f2014f0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/config_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -39,7 +39,7 @@ func (m ConfigDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/constant_provisioned_concurrency_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/constant_provisioned_concurrency_config.go index fc4107975..d72aa0d18 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/constant_provisioned_concurrency_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/constant_provisioned_concurrency_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -34,7 +34,7 @@ func (m ConstantProvisionedConcurrencyConfig) ValidateEnumValue() (bool, error) errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_details.go index 729230797..e4e8ff10b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -24,7 +24,7 @@ type CreateApplicationDetails struct { // The display name of the application. The display name must be unique within the compartment containing the application. Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the subnets in which to run functions in the application. SubnetIds []string `mandatory:"true" json:"subnetIds"` // Application configuration. These values are passed on to the function as environment variables, functions may override application configuration. @@ -40,7 +40,7 @@ type CreateApplicationDetails struct { // `GENERIC_X86`, `GENERIC_ARM`, `GENERIC_X86_ARM` Shape CreateApplicationDetailsShapeEnum `mandatory:"false" json:"shape,omitempty"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` // A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. @@ -51,16 +51,23 @@ type CreateApplicationDetails struct { TraceConfig *ApplicationTraceConfig `mandatory:"false" json:"traceConfig"` + Logging *ApplicationLoggingConfig `mandatory:"false" json:"logging"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` ImagePolicyConfig *ImagePolicyConfig `mandatory:"false" json:"imagePolicyConfig"` + + // Security attributes for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "enforce"}}}` + SecurityAttributes map[string]map[string]interface{} `mandatory:"false" json:"securityAttributes"` } func (m CreateApplicationDetails) String() string { @@ -77,7 +84,7 @@ func (m CreateApplicationDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetCreateApplicationDetailsShapeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_request_response.go index 33ea148a3..7592e692d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_application_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateApplication.go.html to see an example of how to use CreateApplicationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateApplication.go.html to see an example of how to use CreateApplicationRequest. type CreateApplicationRequest struct { // Specification of the application to create @@ -62,7 +62,7 @@ func (request CreateApplicationRequest) RetryPolicy() *common.RetryPolicy { func (request CreateApplicationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go index 325b8507c..250eba584 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -51,14 +51,21 @@ type CreateFunctionDetails struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -74,7 +81,7 @@ func (m CreateFunctionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -88,6 +95,9 @@ func (m *CreateFunctionDetails) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -129,6 +139,28 @@ func (m *CreateFunctionDetails) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_request_response.go index a1234b008..02a49557c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateFunction.go.html to see an example of how to use CreateFunctionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateFunction.go.html to see an example of how to use CreateFunctionRequest. type CreateFunctionRequest struct { // Specification of the function to create @@ -62,7 +62,7 @@ func (request CreateFunctionRequest) RetryPolicy() *common.RetryPolicy { func (request CreateFunctionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_application_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_application_request_response.go index 3319ca5b2..376e7846c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_application_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_application_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteApplication.go.html to see an example of how to use DeleteApplicationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteApplication.go.html to see an example of how to use DeleteApplicationRequest. type DeleteApplicationRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. ApplicationId *string `mandatory:"true" contributesTo:"path" name:"applicationId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` @@ -67,7 +67,7 @@ func (request DeleteApplicationRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteApplicationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_function_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_function_request_response.go index 6706d7209..9a3f72f2a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_function_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/delete_function_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteFunction.go.html to see an example of how to use DeleteFunctionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteFunction.go.html to see an example of how to use DeleteFunctionRequest. type DeleteFunctionRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. FunctionId *string `mandatory:"true" contributesTo:"path" name:"functionId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` @@ -67,7 +67,7 @@ func (request DeleteFunctionRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteFunctionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go new file mode 100644 index 000000000..9db7069e4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FailureDestinationDetails An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. +// A notification is an example of a failure destination. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type FailureDestinationDetails interface { +} + +type failuredestinationdetails struct { + JsonData []byte + Kind string `json:"kind"` +} + +// UnmarshalJSON unmarshals json +func (m *failuredestinationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerfailuredestinationdetails failuredestinationdetails + s := struct { + Model Unmarshalerfailuredestinationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Kind = s.Model.Kind + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *failuredestinationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Kind { + case "STREAM": + mm := StreamFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "QUEUE": + mm := QueueFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NOTIFICATION": + mm := NotificationFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NONE": + mm := NoneFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for FailureDestinationDetails: %s.", m.Kind) + return *m, nil + } +} + +func (m failuredestinationdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m failuredestinationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FailureDestinationDetailsKindEnum Enum with underlying type: string +type FailureDestinationDetailsKindEnum string + +// Set of constants representing the allowable values for FailureDestinationDetailsKindEnum +const ( + FailureDestinationDetailsKindNotification FailureDestinationDetailsKindEnum = "NOTIFICATION" + FailureDestinationDetailsKindQueue FailureDestinationDetailsKindEnum = "QUEUE" + FailureDestinationDetailsKindStream FailureDestinationDetailsKindEnum = "STREAM" + FailureDestinationDetailsKindNone FailureDestinationDetailsKindEnum = "NONE" +) + +var mappingFailureDestinationDetailsKindEnum = map[string]FailureDestinationDetailsKindEnum{ + "NOTIFICATION": FailureDestinationDetailsKindNotification, + "QUEUE": FailureDestinationDetailsKindQueue, + "STREAM": FailureDestinationDetailsKindStream, + "NONE": FailureDestinationDetailsKindNone, +} + +var mappingFailureDestinationDetailsKindEnumLowerCase = map[string]FailureDestinationDetailsKindEnum{ + "notification": FailureDestinationDetailsKindNotification, + "queue": FailureDestinationDetailsKindQueue, + "stream": FailureDestinationDetailsKindStream, + "none": FailureDestinationDetailsKindNone, +} + +// GetFailureDestinationDetailsKindEnumValues Enumerates the set of values for FailureDestinationDetailsKindEnum +func GetFailureDestinationDetailsKindEnumValues() []FailureDestinationDetailsKindEnum { + values := make([]FailureDestinationDetailsKindEnum, 0) + for _, v := range mappingFailureDestinationDetailsKindEnum { + values = append(values, v) + } + return values +} + +// GetFailureDestinationDetailsKindEnumStringValues Enumerates the set of values in String for FailureDestinationDetailsKindEnum +func GetFailureDestinationDetailsKindEnumStringValues() []string { + return []string{ + "NOTIFICATION", + "QUEUE", + "STREAM", + "NONE", + } +} + +// GetMappingFailureDestinationDetailsKindEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFailureDestinationDetailsKindEnum(val string) (FailureDestinationDetailsKindEnum, bool) { + enum, ok := mappingFailureDestinationDetailsKindEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go index dc7c54597..32665f6c0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -19,7 +19,7 @@ import ( // Function A function resource defines the code (Docker image) and configuration for a specific function. Functions are defined in applications. Avoid entering confidential information. type Function struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the function. Id *string `mandatory:"true" json:"id"` // The display name of the function. The display name is unique within the application containing the function. @@ -63,17 +63,25 @@ type Function struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + // Example: `{"detachedModeTimeoutInSeconds": 900}` + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The base https invoke URL to set on a client in order to invoke a function. This URL will never change over the lifetime of the function and can be cached. InvokeEndpoint *string `mandatory:"false" json:"invokeEndpoint"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -105,7 +113,7 @@ func (m Function) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetFunctionShapeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -125,6 +133,9 @@ func (m *Function) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` InvokeEndpoint *string `json:"invokeEndpoint"` @@ -179,6 +190,28 @@ func (m *Function) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_provisioned_concurrency_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_provisioned_concurrency_config.go index a52888bcc..7e3873400 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_provisioned_concurrency_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_provisioned_concurrency_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -59,7 +59,7 @@ func (m *functionprovisionedconcurrencyconfig) UnmarshalPolymorphicJSON(data []b err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for FunctionProvisionedConcurrencyConfig: %s.", m.Strategy) + common.Logf("Received unsupported enum value for FunctionProvisionedConcurrencyConfig: %s.", m.Strategy) return *m, nil } } @@ -75,7 +75,7 @@ func (m functionprovisionedconcurrencyconfig) ValidateEnumValue() (bool, error) errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_source_details.go index 466deadcc..1da5d486c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_source_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_source_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -55,7 +55,7 @@ func (m *functionsourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for FunctionSourceDetails: %s.", m.SourceType) + common.Logf("Received unsupported enum value for FunctionSourceDetails: %s.", m.SourceType) return *m, nil } } @@ -71,7 +71,7 @@ func (m functionsourcedetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go index 0535f88cb..cb22f98ee 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -19,7 +19,7 @@ import ( // FunctionSummary Summary of a function. type FunctionSummary struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the function. Id *string `mandatory:"true" json:"id"` // The display name of the function. The display name is unique within the application containing the function. @@ -57,17 +57,24 @@ type FunctionSummary struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The base https invoke URL to set on a client in order to invoke a function. This URL will never change over the lifetime of the function and can be cached. InvokeEndpoint *string `mandatory:"false" json:"invokeEndpoint"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -99,7 +106,7 @@ func (m FunctionSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetFunctionSummaryShapeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -118,6 +125,9 @@ func (m *FunctionSummary) UnmarshalJSON(data []byte) (e error) { MemoryInMBs *int64 `json:"memoryInMBs"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` InvokeEndpoint *string `json:"invokeEndpoint"` @@ -170,6 +180,28 @@ func (m *FunctionSummary) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_trace_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_trace_config.go index 8fdb00eb2..1b7ad2dd5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_trace_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_trace_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m FunctionTraceConfig) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsinvoke_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsinvoke_client.go index 37c3f25d7..0f88c1c56 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsinvoke_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsinvoke_client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -26,6 +26,9 @@ type FunctionsInvokeClient struct { // NewFunctionsInvokeClientWithConfigurationProvider Creates a new default FunctionsInvoke client with the given configuration provider. // the configuration provider will be used for the default signer func NewFunctionsInvokeClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client FunctionsInvokeClient, err error) { + if enabled := common.CheckForEnabledServices("functions"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -78,9 +81,9 @@ func (client *FunctionsInvokeClient) ConfigurationProvider() *common.Configurati // InvokeFunction Invokes a function // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/InvokeFunction.go.html to see an example of how to use InvokeFunction API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/InvokeFunction.go.html to see an example of how to use InvokeFunction API. func (client FunctionsInvokeClient) InvokeFunction(ctx context.Context, request InvokeFunctionRequest) (response InvokeFunctionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -120,7 +123,7 @@ func (client FunctionsInvokeClient) invokeFunction(ctx context.Context, request var response InvokeFunctionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsInvoke", "InvokeFunction") response.RawResponse = httpResponse if err != nil { apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/functions/20181201/Function/InvokeFunction" diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsmanagement_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsmanagement_client.go index ed905b897..f8b69e795 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsmanagement_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/functions_functionsmanagement_client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -26,6 +26,9 @@ type FunctionsManagementClient struct { // NewFunctionsManagementClientWithConfigurationProvider Creates a new default FunctionsManagement client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewFunctionsManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client FunctionsManagementClient, err error) { + if enabled := common.CheckForEnabledServices("functions"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -77,7 +80,7 @@ func (client *FunctionsManagementClient) setConfigurationProvider(configProvider region, _ := configProvider.Region() client.SetRegion(region) if client.Host == "" { - return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") } client.config = &configProvider return nil @@ -89,11 +92,11 @@ func (client *FunctionsManagementClient) ConfigurationProvider() *common.Configu } // ChangeApplicationCompartment Moves an application into a different compartment within the same tenancy. -// For information about moving resources between compartments, see Moving Resources Between Compartments (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// For information about moving resources between compartments, see Moving Resources Between Compartments (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ChangeApplicationCompartment.go.html to see an example of how to use ChangeApplicationCompartment API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ChangeApplicationCompartment.go.html to see an example of how to use ChangeApplicationCompartment API. // A default retry strategy applies to this operation ChangeApplicationCompartment() func (client FunctionsManagementClient) ChangeApplicationCompartment(ctx context.Context, request ChangeApplicationCompartmentRequest) (response ChangeApplicationCompartmentResponse, err error) { var ociResponse common.OCIResponse @@ -134,7 +137,7 @@ func (client FunctionsManagementClient) changeApplicationCompartment(ctx context var response ChangeApplicationCompartmentResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ChangeApplicationCompartment") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -149,9 +152,9 @@ func (client FunctionsManagementClient) changeApplicationCompartment(ctx context // CreateApplication Creates a new application. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateApplication.go.html to see an example of how to use CreateApplication API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateApplication.go.html to see an example of how to use CreateApplication API. // A default retry strategy applies to this operation CreateApplication() func (client FunctionsManagementClient) CreateApplication(ctx context.Context, request CreateApplicationRequest) (response CreateApplicationResponse, err error) { var ociResponse common.OCIResponse @@ -192,7 +195,7 @@ func (client FunctionsManagementClient) createApplication(ctx context.Context, r var response CreateApplicationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "CreateApplication") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -207,9 +210,9 @@ func (client FunctionsManagementClient) createApplication(ctx context.Context, r // CreateFunction Creates a new function. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateFunction.go.html to see an example of how to use CreateFunction API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/CreateFunction.go.html to see an example of how to use CreateFunction API. // A default retry strategy applies to this operation CreateFunction() func (client FunctionsManagementClient) CreateFunction(ctx context.Context, request CreateFunctionRequest) (response CreateFunctionResponse, err error) { var ociResponse common.OCIResponse @@ -250,7 +253,7 @@ func (client FunctionsManagementClient) createFunction(ctx context.Context, requ var response CreateFunctionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "CreateFunction") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -265,9 +268,9 @@ func (client FunctionsManagementClient) createFunction(ctx context.Context, requ // DeleteApplication Deletes an application. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteApplication.go.html to see an example of how to use DeleteApplication API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteApplication.go.html to see an example of how to use DeleteApplication API. // A default retry strategy applies to this operation DeleteApplication() func (client FunctionsManagementClient) DeleteApplication(ctx context.Context, request DeleteApplicationRequest) (response DeleteApplicationResponse, err error) { var ociResponse common.OCIResponse @@ -308,7 +311,7 @@ func (client FunctionsManagementClient) deleteApplication(ctx context.Context, r var response DeleteApplicationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "DeleteApplication") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -323,9 +326,9 @@ func (client FunctionsManagementClient) deleteApplication(ctx context.Context, r // DeleteFunction Deletes a function. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteFunction.go.html to see an example of how to use DeleteFunction API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/DeleteFunction.go.html to see an example of how to use DeleteFunction API. // A default retry strategy applies to this operation DeleteFunction() func (client FunctionsManagementClient) DeleteFunction(ctx context.Context, request DeleteFunctionRequest) (response DeleteFunctionResponse, err error) { var ociResponse common.OCIResponse @@ -366,7 +369,7 @@ func (client FunctionsManagementClient) deleteFunction(ctx context.Context, requ var response DeleteFunctionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "DeleteFunction") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -381,9 +384,9 @@ func (client FunctionsManagementClient) deleteFunction(ctx context.Context, requ // GetApplication Retrieves an application. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetApplication.go.html to see an example of how to use GetApplication API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetApplication.go.html to see an example of how to use GetApplication API. // A default retry strategy applies to this operation GetApplication() func (client FunctionsManagementClient) GetApplication(ctx context.Context, request GetApplicationRequest) (response GetApplicationResponse, err error) { var ociResponse common.OCIResponse @@ -424,7 +427,7 @@ func (client FunctionsManagementClient) getApplication(ctx context.Context, requ var response GetApplicationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "GetApplication") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -439,9 +442,9 @@ func (client FunctionsManagementClient) getApplication(ctx context.Context, requ // GetFunction Retrieves a function. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetFunction.go.html to see an example of how to use GetFunction API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetFunction.go.html to see an example of how to use GetFunction API. // A default retry strategy applies to this operation GetFunction() func (client FunctionsManagementClient) GetFunction(ctx context.Context, request GetFunctionRequest) (response GetFunctionResponse, err error) { var ociResponse common.OCIResponse @@ -482,7 +485,7 @@ func (client FunctionsManagementClient) getFunction(ctx context.Context, request var response GetFunctionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "GetFunction") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -497,9 +500,9 @@ func (client FunctionsManagementClient) getFunction(ctx context.Context, request // GetPbfListing Fetches a Pre-built Function(PBF) Listing. Returns a PbfListing response model. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListing.go.html to see an example of how to use GetPbfListing API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListing.go.html to see an example of how to use GetPbfListing API. // A default retry strategy applies to this operation GetPbfListing() func (client FunctionsManagementClient) GetPbfListing(ctx context.Context, request GetPbfListingRequest) (response GetPbfListingResponse, err error) { var ociResponse common.OCIResponse @@ -540,7 +543,7 @@ func (client FunctionsManagementClient) getPbfListing(ctx context.Context, reque var response GetPbfListingResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "GetPbfListing") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -555,9 +558,9 @@ func (client FunctionsManagementClient) getPbfListing(ctx context.Context, reque // GetPbfListingVersion Gets a PbfListingVersion by identifier for a PbfListing. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListingVersion.go.html to see an example of how to use GetPbfListingVersion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListingVersion.go.html to see an example of how to use GetPbfListingVersion API. // A default retry strategy applies to this operation GetPbfListingVersion() func (client FunctionsManagementClient) GetPbfListingVersion(ctx context.Context, request GetPbfListingVersionRequest) (response GetPbfListingVersionResponse, err error) { var ociResponse common.OCIResponse @@ -598,7 +601,7 @@ func (client FunctionsManagementClient) getPbfListingVersion(ctx context.Context var response GetPbfListingVersionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "GetPbfListingVersion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -613,9 +616,9 @@ func (client FunctionsManagementClient) getPbfListingVersion(ctx context.Context // ListApplications Lists applications for a compartment. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListApplications.go.html to see an example of how to use ListApplications API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListApplications.go.html to see an example of how to use ListApplications API. // A default retry strategy applies to this operation ListApplications() func (client FunctionsManagementClient) ListApplications(ctx context.Context, request ListApplicationsRequest) (response ListApplicationsResponse, err error) { var ociResponse common.OCIResponse @@ -656,7 +659,7 @@ func (client FunctionsManagementClient) listApplications(ctx context.Context, re var response ListApplicationsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ListApplications") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -671,9 +674,9 @@ func (client FunctionsManagementClient) listApplications(ctx context.Context, re // ListFunctions Lists functions for an application. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListFunctions.go.html to see an example of how to use ListFunctions API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListFunctions.go.html to see an example of how to use ListFunctions API. // A default retry strategy applies to this operation ListFunctions() func (client FunctionsManagementClient) ListFunctions(ctx context.Context, request ListFunctionsRequest) (response ListFunctionsResponse, err error) { var ociResponse common.OCIResponse @@ -714,7 +717,7 @@ func (client FunctionsManagementClient) listFunctions(ctx context.Context, reque var response ListFunctionsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ListFunctions") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -732,9 +735,9 @@ func (client FunctionsManagementClient) listFunctions(ctx context.Context, reque // Note that the PbfListingIdentifier must be provided as a query parameter, otherwise an exception shall // be thrown. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListingVersions.go.html to see an example of how to use ListPbfListingVersions API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListingVersions.go.html to see an example of how to use ListPbfListingVersions API. // A default retry strategy applies to this operation ListPbfListingVersions() func (client FunctionsManagementClient) ListPbfListingVersions(ctx context.Context, request ListPbfListingVersionsRequest) (response ListPbfListingVersionsResponse, err error) { var ociResponse common.OCIResponse @@ -775,7 +778,7 @@ func (client FunctionsManagementClient) listPbfListingVersions(ctx context.Conte var response ListPbfListingVersionsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ListPbfListingVersions") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -791,9 +794,9 @@ func (client FunctionsManagementClient) listPbfListingVersions(ctx context.Conte // ListPbfListings Fetches a wrapped list of all Pre-built Function(PBF) Listings. Returns a PbfListingCollection containing // an array of PbfListingSummary response models. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListings.go.html to see an example of how to use ListPbfListings API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListings.go.html to see an example of how to use ListPbfListings API. // A default retry strategy applies to this operation ListPbfListings() func (client FunctionsManagementClient) ListPbfListings(ctx context.Context, request ListPbfListingsRequest) (response ListPbfListingsResponse, err error) { var ociResponse common.OCIResponse @@ -834,7 +837,7 @@ func (client FunctionsManagementClient) listPbfListings(ctx context.Context, req var response ListPbfListingsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ListPbfListings") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -849,9 +852,9 @@ func (client FunctionsManagementClient) listPbfListings(ctx context.Context, req // ListTriggers Returns a list of Triggers. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListTriggers.go.html to see an example of how to use ListTriggers API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListTriggers.go.html to see an example of how to use ListTriggers API. // A default retry strategy applies to this operation ListTriggers() func (client FunctionsManagementClient) ListTriggers(ctx context.Context, request ListTriggersRequest) (response ListTriggersResponse, err error) { var ociResponse common.OCIResponse @@ -892,7 +895,7 @@ func (client FunctionsManagementClient) listTriggers(ctx context.Context, reques var response ListTriggersResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "ListTriggers") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -907,9 +910,9 @@ func (client FunctionsManagementClient) listTriggers(ctx context.Context, reques // UpdateApplication Modifies an application // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateApplication.go.html to see an example of how to use UpdateApplication API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateApplication.go.html to see an example of how to use UpdateApplication API. // A default retry strategy applies to this operation UpdateApplication() func (client FunctionsManagementClient) UpdateApplication(ctx context.Context, request UpdateApplicationRequest) (response UpdateApplicationResponse, err error) { var ociResponse common.OCIResponse @@ -950,7 +953,7 @@ func (client FunctionsManagementClient) updateApplication(ctx context.Context, r var response UpdateApplicationResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "UpdateApplication") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { @@ -965,9 +968,9 @@ func (client FunctionsManagementClient) updateApplication(ctx context.Context, r // UpdateFunction Modifies a function // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateFunction.go.html to see an example of how to use UpdateFunction API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateFunction.go.html to see an example of how to use UpdateFunction API. // A default retry strategy applies to this operation UpdateFunction() func (client FunctionsManagementClient) UpdateFunction(ctx context.Context, request UpdateFunctionRequest) (response UpdateFunctionResponse, err error) { var ociResponse common.OCIResponse @@ -1008,7 +1011,7 @@ func (client FunctionsManagementClient) updateFunction(ctx context.Context, requ var response UpdateFunctionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "functionsManagement", "UpdateFunction") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_application_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_application_request_response.go index e6ede21b1..66f72997e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_application_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_application_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetApplication.go.html to see an example of how to use GetApplicationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetApplication.go.html to see an example of how to use GetApplicationRequest. type GetApplicationRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. ApplicationId *string `mandatory:"true" contributesTo:"path" name:"applicationId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -62,7 +62,7 @@ func (request GetApplicationRequest) RetryPolicy() *common.RetryPolicy { func (request GetApplicationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_function_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_function_request_response.go index 61cce4456..056662804 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_function_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_function_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetFunction.go.html to see an example of how to use GetFunctionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetFunction.go.html to see an example of how to use GetFunctionRequest. type GetFunctionRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. FunctionId *string `mandatory:"true" contributesTo:"path" name:"functionId"` // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -62,7 +62,7 @@ func (request GetFunctionRequest) RetryPolicy() *common.RetryPolicy { func (request GetFunctionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_request_response.go index a0debb7d0..542054df7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListing.go.html to see an example of how to use GetPbfListingRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListing.go.html to see an example of how to use GetPbfListingRequest. type GetPbfListingRequest struct { // unique PbfListing identifier @@ -62,7 +62,7 @@ func (request GetPbfListingRequest) RetryPolicy() *common.RetryPolicy { func (request GetPbfListingRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_version_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_version_request_response.go index 22d359946..f5676c9f7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_version_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/get_pbf_listing_version_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListingVersion.go.html to see an example of how to use GetPbfListingVersionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/GetPbfListingVersion.go.html to see an example of how to use GetPbfListingVersionRequest. type GetPbfListingVersionRequest struct { // unique PbfListingVersion identifier @@ -62,7 +62,7 @@ func (request GetPbfListingVersionRequest) RetryPolicy() *common.RetryPolicy { func (request GetPbfListingVersionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/image_policy_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/image_policy_config.go index 498207374..1018b4231 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/image_policy_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/image_policy_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -36,7 +36,7 @@ func (m ImagePolicyConfig) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/invoke_function_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/invoke_function_request_response.go index e85b70f18..883b1abdf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/invoke_function_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/invoke_function_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -16,10 +16,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/InvokeFunction.go.html to see an example of how to use InvokeFunctionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/InvokeFunction.go.html to see an example of how to use InvokeFunctionRequest. type InvokeFunctionRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. FunctionId *string `mandatory:"true" contributesTo:"path" name:"functionId"` // The body of the function invocation. @@ -37,6 +37,9 @@ type InvokeFunctionRequest struct { // particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Indicates that the request is a dry run, if set to "true". A dry run request does not execute the function. + IsDryRun *bool `mandatory:"false" contributesTo:"header" name:"is-dry-run"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata @@ -82,7 +85,7 @@ func (request InvokeFunctionRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FnInvokeType: %s. Supported values are: %s.", request.FnInvokeType, strings.Join(GetInvokeFunctionFnInvokeTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/key_details.go index 7f9c9dc08..d04d4d909 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/key_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -18,7 +18,7 @@ import ( // KeyDetails The properties that define the kms keys used by Functions for Image Signature verification. type KeyDetails struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the KMS key that will be used to verify the image signature. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the KMS key that will be used to verify the image signature. KmsKeyId *string `mandatory:"true" json:"kmsKeyId"` } @@ -33,7 +33,7 @@ func (m KeyDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_applications_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_applications_request_response.go index 7cc1482d3..a2668e327 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_applications_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_applications_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListApplications.go.html to see an example of how to use ListApplicationsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListApplications.go.html to see an example of how to use ListApplicationsRequest. type ListApplicationsRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this resource belongs. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this resource belongs. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The maximum number of items to return. 1 is the minimum, 50 is the maximum. @@ -100,7 +100,7 @@ func (request ListApplicationsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListApplicationsSortByEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -116,7 +116,7 @@ type ListApplicationsResponse struct { // For list pagination. When this header appears in the response, additional pages of // results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_functions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_functions_request_response.go index 5779aad01..764d88119 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_functions_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_functions_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListFunctions.go.html to see an example of how to use ListFunctionsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListFunctions.go.html to see an example of how to use ListFunctionsRequest. type ListFunctionsRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application to which this function belongs. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application to which this function belongs. ApplicationId *string `mandatory:"true" contributesTo:"query" name:"applicationId"` // The maximum number of items to return. 1 is the minimum, 50 is the maximum. @@ -100,7 +100,7 @@ func (request ListFunctionsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListFunctionsSortByEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -116,7 +116,7 @@ type ListFunctionsResponse struct { // For list pagination. When this header appears in the response, additional pages of // results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listing_versions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listing_versions_request_response.go index 546e00f9f..4d81b9ab4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listing_versions_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listing_versions_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListingVersions.go.html to see an example of how to use ListPbfListingVersionsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListingVersions.go.html to see an example of how to use ListPbfListingVersionsRequest. type ListPbfListingVersionsRequest struct { // unique PbfListing identifier @@ -100,7 +100,7 @@ func (request ListPbfListingVersionsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListPbfListingVersionsSortByEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listings_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listings_request_response.go index 2ee4d2b4d..caeb5c115 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listings_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_pbf_listings_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListings.go.html to see an example of how to use ListPbfListingsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListPbfListings.go.html to see an example of how to use ListPbfListingsRequest. type ListPbfListingsRequest struct { // unique PbfListing identifier @@ -101,7 +101,7 @@ func (request ListPbfListingsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListPbfListingsSortByEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_triggers_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_triggers_request_response.go index 47c4321d1..a3132000f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_triggers_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/list_triggers_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListTriggers.go.html to see an example of how to use ListTriggersRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/ListTriggers.go.html to see an example of how to use ListTriggersRequest. type ListTriggersRequest struct { // A filter to return only resources that match the service trigger source of a PBF. @@ -77,7 +77,7 @@ func (request ListTriggersRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListTriggersSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go new file mode 100644 index 000000000..1d8ca1ef8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NoneFailureDestinationDetails Specifies no failure destination +// Example: `{"kind": "NONE"}` +type NoneFailureDestinationDetails struct { +} + +func (m NoneFailureDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NoneFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NoneFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNoneFailureDestinationDetails NoneFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNoneFailureDestinationDetails + }{ + "NONE", + (MarshalTypeNoneFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_provisioned_concurrency_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_provisioned_concurrency_config.go index 5f0b75e26..232898d0c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_provisioned_concurrency_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_provisioned_concurrency_config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -31,7 +31,7 @@ func (m NoneProvisionedConcurrencyConfig) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go new file mode 100644 index 000000000..d99d50337 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NoneSuccessDestinationDetails Specifies no success destination +// Example: `{"kind": "NONE"}` +type NoneSuccessDestinationDetails struct { +} + +func (m NoneSuccessDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NoneSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NoneSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNoneSuccessDestinationDetails NoneSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNoneSuccessDestinationDetails + }{ + "NONE", + (MarshalTypeNoneSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go new file mode 100644 index 000000000..247c461d2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NotificationFailureDestinationDetails The destination topic in the Notifications service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type NotificationFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` +} + +func (m NotificationFailureDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NotificationFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NotificationFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNotificationFailureDestinationDetails NotificationFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNotificationFailureDestinationDetails + }{ + "NOTIFICATION", + (MarshalTypeNotificationFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go new file mode 100644 index 000000000..9bede25e3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NotificationSuccessDestinationDetails The destination topic in the Notifications service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type NotificationSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` +} + +func (m NotificationSuccessDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NotificationSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NotificationSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNotificationSuccessDestinationDetails NotificationSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNotificationSuccessDestinationDetails + }{ + "NOTIFICATION", + (MarshalTypeNotificationSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing.go index e34139fcd..6b88b257a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -71,7 +71,7 @@ func (m PbfListing) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_summary.go index 568fbbe26..bfbf1eece 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_summary.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -69,7 +69,7 @@ func (m PbfListingSummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version.go index 4c0173e19..64fcf3085 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -75,7 +75,7 @@ func (m PbfListingVersion) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version_summary.go index 3a7edf97b..216708baf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_version_summary.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -74,7 +74,7 @@ func (m PbfListingVersionSummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_versions_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_versions_collection.go index 1f7b3b327..c12408bb5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_versions_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listing_versions_collection.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -34,7 +34,7 @@ func (m PbfListingVersionsCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listings_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listings_collection.go index 80c076000..a6123f278 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listings_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pbf_listings_collection.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m PbfListingsCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/policy_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/policy_details.go index d13f0c2bc..fc652fb90 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/policy_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/policy_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -36,7 +36,7 @@ func (m PolicyDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pre_built_function_source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pre_built_function_source_details.go index e2fa4958a..820058492 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/pre_built_function_source_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/pre_built_function_source_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -19,7 +19,7 @@ import ( // PreBuiltFunctionSourceDetails The source of the Function which is based on a Pre-Built Function Listing (PbfListing). type PreBuiltFunctionSourceDetails struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this // function is sourced from. PbfListingId *string `mandatory:"true" json:"pbfListingId"` } @@ -35,7 +35,7 @@ func (m PreBuiltFunctionSourceDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/publisher_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/publisher_details.go index fd3ac01e1..b727cad2e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/publisher_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/publisher_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m PublisherDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go new file mode 100644 index 000000000..d3a2c1921 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueueFailureDestinationDetails The destination queue or channel in the Queue service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "QUEUE", "queueId": "queue_OCID", "channelId": "channel_Id"}` +type QueueFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + QueueId *string `mandatory:"true" json:"queueId"` + + // The ID of the channel in the queue. + ChannelId *string `mandatory:"false" json:"channelId"` +} + +func (m QueueFailureDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueueFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m QueueFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeQueueFailureDestinationDetails QueueFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeQueueFailureDestinationDetails + }{ + "QUEUE", + (MarshalTypeQueueFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go new file mode 100644 index 000000000..7b9022ed2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueueSuccessDestinationDetails The destination queue or channel in the Queue service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "QUEUE", "queueId": "queue_OCID", "channelId": "channel_Id"}` +type QueueSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + QueueId *string `mandatory:"true" json:"queueId"` + + // The ID of the channel in the queue. + ChannelId *string `mandatory:"false" json:"channelId"` +} + +func (m QueueSuccessDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueueSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m QueueSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeQueueSuccessDestinationDetails QueueSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeQueueSuccessDestinationDetails + }{ + "QUEUE", + (MarshalTypeQueueSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/requirement_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/requirement_details.go index 41b31b121..4bfabf41d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/requirement_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/requirement_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -38,7 +38,7 @@ func (m RequirementDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go new file mode 100644 index 000000000..3731a2284 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StreamFailureDestinationDetails The destination stream in the Streaming service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type StreamFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + StreamId *string `mandatory:"true" json:"streamId"` +} + +func (m StreamFailureDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m StreamFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m StreamFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStreamFailureDestinationDetails StreamFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeStreamFailureDestinationDetails + }{ + "STREAM", + (MarshalTypeStreamFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go new file mode 100644 index 000000000..6faacbeb3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StreamSuccessDestinationDetails The destination stream in the Streaming service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type StreamSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + StreamId *string `mandatory:"true" json:"streamId"` +} + +func (m StreamSuccessDestinationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m StreamSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m StreamSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStreamSuccessDestinationDetails StreamSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeStreamSuccessDestinationDetails + }{ + "STREAM", + (MarshalTypeStreamSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go new file mode 100644 index 000000000..75ee71a6e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SuccessDestinationDetails An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. +// A stream is an example of a success destination. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type SuccessDestinationDetails interface { +} + +type successdestinationdetails struct { + JsonData []byte + Kind string `json:"kind"` +} + +// UnmarshalJSON unmarshals json +func (m *successdestinationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersuccessdestinationdetails successdestinationdetails + s := struct { + Model Unmarshalersuccessdestinationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Kind = s.Model.Kind + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *successdestinationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Kind { + case "STREAM": + mm := StreamSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NOTIFICATION": + mm := NotificationSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "QUEUE": + mm := QueueSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NONE": + mm := NoneSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for SuccessDestinationDetails: %s.", m.Kind) + return *m, nil + } +} + +func (m successdestinationdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m successdestinationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SuccessDestinationDetailsKindEnum Enum with underlying type: string +type SuccessDestinationDetailsKindEnum string + +// Set of constants representing the allowable values for SuccessDestinationDetailsKindEnum +const ( + SuccessDestinationDetailsKindNotification SuccessDestinationDetailsKindEnum = "NOTIFICATION" + SuccessDestinationDetailsKindQueue SuccessDestinationDetailsKindEnum = "QUEUE" + SuccessDestinationDetailsKindStream SuccessDestinationDetailsKindEnum = "STREAM" + SuccessDestinationDetailsKindNone SuccessDestinationDetailsKindEnum = "NONE" +) + +var mappingSuccessDestinationDetailsKindEnum = map[string]SuccessDestinationDetailsKindEnum{ + "NOTIFICATION": SuccessDestinationDetailsKindNotification, + "QUEUE": SuccessDestinationDetailsKindQueue, + "STREAM": SuccessDestinationDetailsKindStream, + "NONE": SuccessDestinationDetailsKindNone, +} + +var mappingSuccessDestinationDetailsKindEnumLowerCase = map[string]SuccessDestinationDetailsKindEnum{ + "notification": SuccessDestinationDetailsKindNotification, + "queue": SuccessDestinationDetailsKindQueue, + "stream": SuccessDestinationDetailsKindStream, + "none": SuccessDestinationDetailsKindNone, +} + +// GetSuccessDestinationDetailsKindEnumValues Enumerates the set of values for SuccessDestinationDetailsKindEnum +func GetSuccessDestinationDetailsKindEnumValues() []SuccessDestinationDetailsKindEnum { + values := make([]SuccessDestinationDetailsKindEnum, 0) + for _, v := range mappingSuccessDestinationDetailsKindEnum { + values = append(values, v) + } + return values +} + +// GetSuccessDestinationDetailsKindEnumStringValues Enumerates the set of values in String for SuccessDestinationDetailsKindEnum +func GetSuccessDestinationDetailsKindEnumStringValues() []string { + return []string{ + "NOTIFICATION", + "QUEUE", + "STREAM", + "NONE", + } +} + +// GetMappingSuccessDestinationDetailsKindEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSuccessDestinationDetailsKindEnum(val string) (SuccessDestinationDetailsKindEnum, bool) { + enum, ok := mappingSuccessDestinationDetailsKindEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger.go index dc5e24a01..c906a46a1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m Trigger) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger_summary.go index 2e2722d2c..2d099de43 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/trigger_summary.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m TriggerSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/triggers_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/triggers_collection.go index 3c6e1119e..62fdd8ace 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/triggers_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/triggers_collection.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -33,7 +33,7 @@ func (m TriggersCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_details.go index 695ed9f05..930df165f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -24,7 +24,7 @@ type UpdateApplicationDetails struct { // The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. Config map[string]string `mandatory:"false" json:"config"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Network Security Groups to add the application to. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` // A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. @@ -35,16 +35,23 @@ type UpdateApplicationDetails struct { TraceConfig *ApplicationTraceConfig `mandatory:"false" json:"traceConfig"` + Logging *ApplicationLoggingConfig `mandatory:"false" json:"logging"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` ImagePolicyConfig *ImagePolicyConfig `mandatory:"false" json:"imagePolicyConfig"` + + // Security attributes for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "enforce"}}}` + SecurityAttributes map[string]map[string]interface{} `mandatory:"false" json:"securityAttributes"` } func (m UpdateApplicationDetails) String() string { @@ -58,7 +65,7 @@ func (m UpdateApplicationDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_request_response.go index e8f8ef223..56ad3590f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_application_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateApplication.go.html to see an example of how to use UpdateApplicationRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateApplication.go.html to see an example of how to use UpdateApplicationRequest. type UpdateApplicationRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application. ApplicationId *string `mandatory:"true" contributesTo:"path" name:"applicationId"` // The new application spec to apply @@ -70,7 +70,7 @@ func (request UpdateApplicationRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateApplicationRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go index dea8e5d63..182c97af2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -43,14 +43,21 @@ type UpdateFunctionDetails struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } @@ -66,7 +73,7 @@ func (m UpdateFunctionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -80,6 +87,9 @@ func (m *UpdateFunctionDetails) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -110,6 +120,28 @@ func (m *UpdateFunctionDetails) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_request_response.go index 36602167a..35d1c3cce 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,10 +15,10 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateFunction.go.html to see an example of how to use UpdateFunctionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/functions/UpdateFunction.go.html to see an example of how to use UpdateFunctionRequest. type UpdateFunctionRequest struct { - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function. FunctionId *string `mandatory:"true" contributesTo:"path" name:"functionId"` // The new function spec to apply @@ -70,7 +70,7 @@ func (request UpdateFunctionRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateFunctionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/auto_key_rotation_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/auto_key_rotation_details.go new file mode 100644 index 000000000..44cfcb5c1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/auto_key_rotation_details.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutoKeyRotationDetails The details of auto rotation schedule for the Key being create updated or imported. +type AutoKeyRotationDetails struct { + + // The interval of auto key rotation. For auto key rotation the interval should between 60 day and 365 days (1 year). Note: User must specify this parameter when creating a new schedule. + RotationIntervalInDays *int `mandatory:"false" json:"rotationIntervalInDays"` + + // A property indicating scheduled start date expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z. The time has no significance when scheduling an auto key rotation as this can be done anytime approximately the scheduled day, KMS ignores the time and replaces it with 00:00, for example 2023-04-04T15:14:13Z will be used as 2023-04-04T00:00:00Z . Note : Today’s date will be used if not specified by customer. + TimeOfScheduleStart *common.SDKTime `mandatory:"false" json:"timeOfScheduleStart"` + + // A property indicating Next estimated scheduled Time, as per the interval, expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z`. The time has no significance when scheduling an auto key rotation as this can be done anytime approximately the scheduled day, KMS ignores the time and replaces it with 00:00, for example 2023-04-04T15:14:13Z will be used as 2023-04-04T00:00:00Z. + TimeOfNextRotation *common.SDKTime `mandatory:"false" json:"timeOfNextRotation"` + + // A property indicating Last rotation Date. Example: `2023-04-04T00:00:00Z`. + TimeOfLastRotation *common.SDKTime `mandatory:"false" json:"timeOfLastRotation"` + + // The status of last execution of auto key rotation. + LastRotationStatus AutoKeyRotationDetailsLastRotationStatusEnum `mandatory:"false" json:"lastRotationStatus,omitempty"` + + // The last execution status message of auto key rotation. + LastRotationMessage *string `mandatory:"false" json:"lastRotationMessage"` +} + +func (m AutoKeyRotationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AutoKeyRotationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAutoKeyRotationDetailsLastRotationStatusEnum(string(m.LastRotationStatus)); !ok && m.LastRotationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LastRotationStatus: %s. Supported values are: %s.", m.LastRotationStatus, strings.Join(GetAutoKeyRotationDetailsLastRotationStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AutoKeyRotationDetailsLastRotationStatusEnum Enum with underlying type: string +type AutoKeyRotationDetailsLastRotationStatusEnum string + +// Set of constants representing the allowable values for AutoKeyRotationDetailsLastRotationStatusEnum +const ( + AutoKeyRotationDetailsLastRotationStatusSuccess AutoKeyRotationDetailsLastRotationStatusEnum = "SUCCESS" + AutoKeyRotationDetailsLastRotationStatusFailed AutoKeyRotationDetailsLastRotationStatusEnum = "FAILED" + AutoKeyRotationDetailsLastRotationStatusInProgress AutoKeyRotationDetailsLastRotationStatusEnum = "IN_PROGRESS" +) + +var mappingAutoKeyRotationDetailsLastRotationStatusEnum = map[string]AutoKeyRotationDetailsLastRotationStatusEnum{ + "SUCCESS": AutoKeyRotationDetailsLastRotationStatusSuccess, + "FAILED": AutoKeyRotationDetailsLastRotationStatusFailed, + "IN_PROGRESS": AutoKeyRotationDetailsLastRotationStatusInProgress, +} + +var mappingAutoKeyRotationDetailsLastRotationStatusEnumLowerCase = map[string]AutoKeyRotationDetailsLastRotationStatusEnum{ + "success": AutoKeyRotationDetailsLastRotationStatusSuccess, + "failed": AutoKeyRotationDetailsLastRotationStatusFailed, + "in_progress": AutoKeyRotationDetailsLastRotationStatusInProgress, +} + +// GetAutoKeyRotationDetailsLastRotationStatusEnumValues Enumerates the set of values for AutoKeyRotationDetailsLastRotationStatusEnum +func GetAutoKeyRotationDetailsLastRotationStatusEnumValues() []AutoKeyRotationDetailsLastRotationStatusEnum { + values := make([]AutoKeyRotationDetailsLastRotationStatusEnum, 0) + for _, v := range mappingAutoKeyRotationDetailsLastRotationStatusEnum { + values = append(values, v) + } + return values +} + +// GetAutoKeyRotationDetailsLastRotationStatusEnumStringValues Enumerates the set of values in String for AutoKeyRotationDetailsLastRotationStatusEnum +func GetAutoKeyRotationDetailsLastRotationStatusEnumStringValues() []string { + return []string{ + "SUCCESS", + "FAILED", + "IN_PROGRESS", + } +} + +// GetMappingAutoKeyRotationDetailsLastRotationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAutoKeyRotationDetailsLastRotationStatusEnum(val string) (AutoKeyRotationDetailsLastRotationStatusEnum, bool) { + enum, ok := mappingAutoKeyRotationDetailsLastRotationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_details.go index 9a7d2cb90..3ff3d50d2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -17,7 +16,7 @@ import ( "strings" ) -// BackupKeyDetails The representation of BackupKeyDetails +// BackupKeyDetails The details of the Key that you wish to backup. type BackupKeyDetails struct { BackupLocation BackupLocation `mandatory:"false" json:"backupLocation"` } @@ -33,7 +32,7 @@ func (m BackupKeyDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_request_response.go index fd2b9949d..1894e7ed7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupKey.go.html to see an example of how to use BackupKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupKey.go.html to see an example of how to use BackupKeyRequest. type BackupKeyRequest struct { // The OCID of the key. @@ -81,7 +81,7 @@ func (request BackupKeyRequest) RetryPolicy() *common.RetryPolicy { func (request BackupKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location.go index 7988090e2..5543ce0ff 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -60,7 +59,7 @@ func (m *backuplocation) UnmarshalPolymorphicJSON(data []byte) (interface{}, err err = json.Unmarshal(data, &mm) return mm, err default: - common.Logf("Recieved unsupported enum value for BackupLocation: %s.", m.Destination) + common.Logf("Received unsupported enum value for BackupLocation: %s.", m.Destination) return *m, nil } } @@ -76,7 +75,7 @@ func (m backuplocation) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_bucket.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_bucket.go index f3b17d1d8..f37710195 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_bucket.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_bucket.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -37,7 +36,7 @@ func (m BackupLocationBucket) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_uri.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_uri.go index 30ce754e3..8137519d0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_uri.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_location_uri.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -33,7 +32,7 @@ func (m BackupLocationUri) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_details.go index 889d83ed1..5260d5e51 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -17,10 +16,11 @@ import ( "strings" ) -// BackupVaultDetails The representation of BackupVaultDetails +// BackupVaultDetails The details of the Vault that you wish to backup. type BackupVaultDetails struct { BackupLocation BackupLocation `mandatory:"false" json:"backupLocation"` + // A Boolean value that indicates whether the Keys should be included during backing up the Vault. IsIncludeKeys *bool `mandatory:"false" json:"isIncludeKeys"` } @@ -35,7 +35,7 @@ func (m BackupVaultDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_request_response.go index e4dd36a84..7ec0663eb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/backup_vault_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupVault.go.html to see an example of how to use BackupVaultRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupVault.go.html to see an example of how to use BackupVaultRequest. type BackupVaultRequest struct { // The OCID of the vault. @@ -81,7 +81,7 @@ func (request BackupVaultRequest) RetryPolicy() *common.RetryPolicy { func (request BackupVaultRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_hsm_cluster_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_hsm_cluster_deletion_request_response.go new file mode 100644 index 000000000..34d2f5ad2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_hsm_cluster_deletion_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelHsmClusterDeletionRequest wrapper for the CancelHsmClusterDeletion operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelHsmClusterDeletion.go.html to see an example of how to use CancelHsmClusterDeletionRequest. +type CancelHsmClusterDeletionRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelHsmClusterDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelHsmClusterDeletionRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CancelHsmClusterDeletionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelHsmClusterDeletionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CancelHsmClusterDeletionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelHsmClusterDeletionResponse wrapper for the CancelHsmClusterDeletion operation +type CancelHsmClusterDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CancelHsmClusterDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelHsmClusterDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_deletion_request_response.go index 6a15acbaf..80af32b8e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyDeletion.go.html to see an example of how to use CancelKeyDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyDeletion.go.html to see an example of how to use CancelKeyDeletionRequest. type CancelKeyDeletionRequest struct { // The OCID of the key. @@ -78,7 +78,7 @@ func (request CancelKeyDeletionRequest) RetryPolicy() *common.RetryPolicy { func (request CancelKeyDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_version_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_version_deletion_request_response.go index 8f368d251..17ca884b7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_version_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_key_version_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyVersionDeletion.go.html to see an example of how to use CancelKeyVersionDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyVersionDeletion.go.html to see an example of how to use CancelKeyVersionDeletionRequest. type CancelKeyVersionDeletionRequest struct { // The OCID of the key. @@ -81,7 +81,7 @@ func (request CancelKeyVersionDeletionRequest) RetryPolicy() *common.RetryPolicy func (request CancelKeyVersionDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_vault_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_vault_deletion_request_response.go index 0667ed565..910620b77 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_vault_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/cancel_vault_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelVaultDeletion.go.html to see an example of how to use CancelVaultDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelVaultDeletion.go.html to see an example of how to use CancelVaultDeletionRequest. type CancelVaultDeletionRequest struct { // The OCID of the vault. @@ -78,7 +78,7 @@ func (request CancelVaultDeletionRequest) RetryPolicy() *common.RetryPolicy { func (request CancelVaultDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_details.go new file mode 100644 index 000000000..8823fad80 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeHsmClusterCompartmentDetails The details of the compartment you wish to move the hsm cluster to. +type ChangeHsmClusterCompartmentDetails struct { + + // The [OCID] of the compartment to move the hsm cluster to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeHsmClusterCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeHsmClusterCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_request_response.go new file mode 100644 index 000000000..a32bbb2af --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_hsm_cluster_compartment_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeHsmClusterCompartmentRequest wrapper for the ChangeHsmClusterCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeHsmClusterCompartment.go.html to see an example of how to use ChangeHsmClusterCompartmentRequest. +type ChangeHsmClusterCompartmentRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of change HSM Cluster compartment. + ChangeHsmClusterCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeHsmClusterCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeHsmClusterCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeHsmClusterCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeHsmClusterCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeHsmClusterCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeHsmClusterCompartmentResponse wrapper for the ChangeHsmClusterCompartment operation +type ChangeHsmClusterCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeHsmClusterCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeHsmClusterCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_details.go index 1440df56d..6b8f48a00 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,10 +15,10 @@ import ( "strings" ) -// ChangeKeyCompartmentDetails The representation of ChangeKeyCompartmentDetails +// ChangeKeyCompartmentDetails The deatils of the compartment that you wish to move the Key. type ChangeKeyCompartmentDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that you want to move the key to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that you want to move the key to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } @@ -34,7 +33,7 @@ func (m ChangeKeyCompartmentDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_request_response.go index dfa8d96bb..09677ee02 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_key_compartment_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,12 +15,13 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeKeyCompartment.go.html to see an example of how to use ChangeKeyCompartmentRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeKeyCompartment.go.html to see an example of how to use ChangeKeyCompartmentRequest. type ChangeKeyCompartmentRequest struct { // The OCID of the key. KeyId *string `mandatory:"true" contributesTo:"path" name:"keyId"` + // Details of change key compartment. ChangeKeyCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a @@ -80,7 +81,7 @@ func (request ChangeKeyCompartmentRequest) RetryPolicy() *common.RetryPolicy { func (request ChangeKeyCompartmentRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_details.go index 780ea2c61..0d94e7769 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,10 +15,10 @@ import ( "strings" ) -// ChangeVaultCompartmentDetails The representation of ChangeVaultCompartmentDetails +// ChangeVaultCompartmentDetails The details of the compartment you wish to move the Vault. type ChangeVaultCompartmentDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the vault to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the vault to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } @@ -34,7 +33,7 @@ func (m ChangeVaultCompartmentDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_request_response.go index 4092911ed..8efff6730 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/change_vault_compartment_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,12 +15,13 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeVaultCompartment.go.html to see an example of how to use ChangeVaultCompartmentRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeVaultCompartment.go.html to see an example of how to use ChangeVaultCompartmentRequest. type ChangeVaultCompartmentRequest struct { // The OCID of the vault. VaultId *string `mandatory:"true" contributesTo:"path" name:"vaultId"` + // ChangeVaultCompartmentDetails ChangeVaultCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a @@ -80,7 +81,7 @@ func (request ChangeVaultCompartmentRequest) RetryPolicy() *common.RetryPolicy { func (request ChangeVaultCompartmentRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_details.go new file mode 100644 index 000000000..2b19fa586 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateEkmsPrivateEndpointDetails Information needed to create EKMS private endpoint resource +type CreateEkmsPrivateEndpointDetails struct { + + // The OCID of subnet in which the EKMS private endpoint is to be created + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Compartment identifier. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Display name of the EKMS private endpoint resource being created. + DisplayName *string `mandatory:"true" json:"displayName"` + + // External private IP to connect to from this EKMS private endpoint + ExternalKeyManagerIp *string `mandatory:"true" json:"externalKeyManagerIp"` + + // CABundle to validate TLS certificate of the external key manager system in PEM format + CaBundle *string `mandatory:"true" json:"caBundle"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The port of the external key manager system + Port *int `mandatory:"false" json:"port"` +} + +func (m CreateEkmsPrivateEndpointDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateEkmsPrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_request_response.go new file mode 100644 index 000000000..fcc26e2cd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_ekms_private_endpoint_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateEkmsPrivateEndpointRequest wrapper for the CreateEkmsPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateEkmsPrivateEndpoint.go.html to see an example of how to use CreateEkmsPrivateEndpointRequest. +type CreateEkmsPrivateEndpointRequest struct { + + // The information used to create EKMS private endpoint. + CreateEkmsPrivateEndpointDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateEkmsPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateEkmsPrivateEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateEkmsPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateEkmsPrivateEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateEkmsPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateEkmsPrivateEndpointResponse wrapper for the CreateEkmsPrivateEndpoint operation +type CreateEkmsPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The EkmsPrivateEndpoint instance + EkmsPrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Work request id to track progress of the create operation + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateEkmsPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateEkmsPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_details.go new file mode 100644 index 000000000..679abaa01 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateHsmClusterDetails The details of the HSM cluster resource that you want to create. +type CreateHsmClusterDetails struct { + + // The OCID of the compartment where you want to create this HSM cluster resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly display name for the HSM cluster resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m CreateHsmClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateHsmClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_request_response.go new file mode 100644 index 000000000..8c6681ef5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_hsm_cluster_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateHsmClusterRequest wrapper for the CreateHsmCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateHsmCluster.go.html to see an example of how to use CreateHsmClusterRequest. +type CreateHsmClusterRequest struct { + + // Details for the new HsmCluster resource + CreateHsmClusterDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateHsmClusterRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateHsmClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateHsmClusterResponse wrapper for the CreateHsmCluster operation +type CreateHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_details.go index 9d5c39177..15626dfd7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// CreateKeyDetails The representation of CreateKeyDetails +// CreateKeyDetails The details of the key that you want to create. type CreateKeyDetails struct { // The OCID of the compartment where you want to create the master encryption key. @@ -29,21 +28,31 @@ type CreateKeyDetails struct { KeyShape *KeyShape `mandatory:"true" json:"keyShape"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // A parameter specifying whether the auto key rotation is enabled or not. + IsAutoRotationEnabled *bool `mandatory:"false" json:"isAutoRotationEnabled"` + + AutoKeyRotationDetails *AutoKeyRotationDetails `mandatory:"false" json:"autoKeyRotationDetails"` + // The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. // A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside // the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists // on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, // a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. + // A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. + // Oracle only hold a reference to that key. + // All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. ProtectionMode CreateKeyDetailsProtectionModeEnum `mandatory:"false" json:"protectionMode,omitempty"` + + ExternalKeyReference *ExternalKeyReference `mandatory:"false" json:"externalKeyReference"` } func (m CreateKeyDetails) String() string { @@ -60,7 +69,7 @@ func (m CreateKeyDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProtectionMode: %s. Supported values are: %s.", m.ProtectionMode, strings.Join(GetCreateKeyDetailsProtectionModeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -72,16 +81,19 @@ type CreateKeyDetailsProtectionModeEnum string const ( CreateKeyDetailsProtectionModeHsm CreateKeyDetailsProtectionModeEnum = "HSM" CreateKeyDetailsProtectionModeSoftware CreateKeyDetailsProtectionModeEnum = "SOFTWARE" + CreateKeyDetailsProtectionModeExternal CreateKeyDetailsProtectionModeEnum = "EXTERNAL" ) var mappingCreateKeyDetailsProtectionModeEnum = map[string]CreateKeyDetailsProtectionModeEnum{ "HSM": CreateKeyDetailsProtectionModeHsm, "SOFTWARE": CreateKeyDetailsProtectionModeSoftware, + "EXTERNAL": CreateKeyDetailsProtectionModeExternal, } var mappingCreateKeyDetailsProtectionModeEnumLowerCase = map[string]CreateKeyDetailsProtectionModeEnum{ "hsm": CreateKeyDetailsProtectionModeHsm, "software": CreateKeyDetailsProtectionModeSoftware, + "external": CreateKeyDetailsProtectionModeExternal, } // GetCreateKeyDetailsProtectionModeEnumValues Enumerates the set of values for CreateKeyDetailsProtectionModeEnum @@ -98,6 +110,7 @@ func GetCreateKeyDetailsProtectionModeEnumStringValues() []string { return []string{ "HSM", "SOFTWARE", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_request_response.go index b775e795a..2c1688ab6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKey.go.html to see an example of how to use CreateKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKey.go.html to see an example of how to use CreateKeyRequest. type CreateKeyRequest struct { // CreateKeyDetails @@ -71,7 +71,7 @@ func (request CreateKeyRequest) RetryPolicy() *common.RetryPolicy { func (request CreateKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_version_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_version_request_response.go index cda52edec..5aad7516c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_version_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_key_version_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKeyVersion.go.html to see an example of how to use CreateKeyVersionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKeyVersion.go.html to see an example of how to use CreateKeyVersionRequest. type CreateKeyVersionRequest struct { // The OCID of the key. @@ -34,6 +34,9 @@ type CreateKeyVersionRequest struct { // creation request may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + // CreateKeyMetadataDetails + CreateKeyMetadataDetails ExternalKeyVersionReference `contributesTo:"body"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata @@ -71,7 +74,7 @@ func (request CreateKeyVersionRequest) RetryPolicy() *common.RetryPolicy { func (request CreateKeyVersionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_details.go index 0ceed953d..b86da04d2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// CreateVaultDetails The representation of CreateVaultDetails +// CreateVaultDetails The details of the vault that you want to create. type CreateVaultDetails struct { // The OCID of the compartment where you want to create this vault. @@ -30,14 +29,16 @@ type CreateVaultDetails struct { VaultType CreateVaultDetailsVaultTypeEnum `mandatory:"true" json:"vaultType"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + ExternalKeyManagerMetadata *ExternalKeyManagerMetadata `mandatory:"false" json:"externalKeyManagerMetadata"` } func (m CreateVaultDetails) String() string { @@ -54,7 +55,7 @@ func (m CreateVaultDetails) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -66,16 +67,19 @@ type CreateVaultDetailsVaultTypeEnum string const ( CreateVaultDetailsVaultTypeVirtualPrivate CreateVaultDetailsVaultTypeEnum = "VIRTUAL_PRIVATE" CreateVaultDetailsVaultTypeDefault CreateVaultDetailsVaultTypeEnum = "DEFAULT" + CreateVaultDetailsVaultTypeExternal CreateVaultDetailsVaultTypeEnum = "EXTERNAL" ) var mappingCreateVaultDetailsVaultTypeEnum = map[string]CreateVaultDetailsVaultTypeEnum{ "VIRTUAL_PRIVATE": CreateVaultDetailsVaultTypeVirtualPrivate, "DEFAULT": CreateVaultDetailsVaultTypeDefault, + "EXTERNAL": CreateVaultDetailsVaultTypeExternal, } var mappingCreateVaultDetailsVaultTypeEnumLowerCase = map[string]CreateVaultDetailsVaultTypeEnum{ "virtual_private": CreateVaultDetailsVaultTypeVirtualPrivate, "default": CreateVaultDetailsVaultTypeDefault, + "external": CreateVaultDetailsVaultTypeExternal, } // GetCreateVaultDetailsVaultTypeEnumValues Enumerates the set of values for CreateVaultDetailsVaultTypeEnum @@ -92,6 +96,7 @@ func GetCreateVaultDetailsVaultTypeEnumStringValues() []string { return []string{ "VIRTUAL_PRIVATE", "DEFAULT", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_details.go index 008af3f38..956db3d63 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_details.go @@ -1,16 +1,16 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -21,6 +21,8 @@ type CreateVaultReplicaDetails struct { // The region in the realm to which the vault need to be replicated to ReplicaRegion *string `mandatory:"true" json:"replicaRegion"` + + ReplicaVaultMetadata ReplicaVaultMetadata `mandatory:"false" json:"replicaVaultMetadata"` } func (m CreateVaultReplicaDetails) String() string { @@ -34,7 +36,34 @@ func (m CreateVaultReplicaDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *CreateVaultReplicaDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ReplicaVaultMetadata replicavaultmetadata `json:"replicaVaultMetadata"` + ReplicaRegion *string `json:"replicaRegion"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.ReplicaVaultMetadata.UnmarshalPolymorphicJSON(model.ReplicaVaultMetadata.JsonData) + if e != nil { + return + } + if nn != nil { + m.ReplicaVaultMetadata = nn.(ReplicaVaultMetadata) + } else { + m.ReplicaVaultMetadata = nil + } + + m.ReplicaRegion = model.ReplicaRegion + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_request_response.go index dbaea3b79..d9dd6c20a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_replica_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVaultReplica.go.html to see an example of how to use CreateVaultReplicaRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVaultReplica.go.html to see an example of how to use CreateVaultReplicaRequest. type CreateVaultReplicaRequest struct { // The OCID of the vault. @@ -81,7 +81,7 @@ func (request CreateVaultReplicaRequest) RetryPolicy() *common.RetryPolicy { func (request CreateVaultReplicaRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_request_response.go index e80ddb4db..6e57155f3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/create_vault_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVault.go.html to see an example of how to use CreateVaultRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVault.go.html to see an example of how to use CreateVaultRequest. type CreateVaultRequest struct { // CreateVaultDetails @@ -71,7 +71,7 @@ func (request CreateVaultRequest) RetryPolicy() *common.RetryPolicy { func (request CreateVaultRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_data_details.go index 77a79a7a0..18fbf7f4f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_data_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// DecryptDataDetails The representation of DecryptDataDetails +// DecryptDataDetails The details of the encrypted data that you want to decrypt. type DecryptDataDetails struct { // The encrypted data to decrypt. @@ -59,7 +58,7 @@ func (m DecryptDataDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EncryptionAlgorithm: %s. Supported values are: %s.", m.EncryptionAlgorithm, strings.Join(GetDecryptDataDetailsEncryptionAlgorithmEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_request_response.go index 8ff8defeb..698b94dd3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypt_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Decrypt.go.html to see an example of how to use DecryptRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Decrypt.go.html to see an example of how to use DecryptRequest. type DecryptRequest struct { // DecryptDataDetails @@ -63,7 +63,7 @@ func (request DecryptRequest) RetryPolicy() *common.RetryPolicy { func (request DecryptRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypted_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypted_data.go index 741b6aeac..81d38b75d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypted_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/decrypted_data.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// DecryptedData The representation of DecryptedData +// DecryptedData The response to a request to decrypt the encrypted data. type DecryptedData struct { // The decrypted data, expressed as a base64-encoded value. @@ -54,7 +53,7 @@ func (m DecryptedData) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EncryptionAlgorithm: %s. Supported values are: %s.", m.EncryptionAlgorithm, strings.Join(GetDecryptedDataEncryptionAlgorithmEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_ekms_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_ekms_private_endpoint_request_response.go new file mode 100644 index 000000000..d72ae7ef6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_ekms_private_endpoint_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteEkmsPrivateEndpointRequest wrapper for the DeleteEkmsPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteEkmsPrivateEndpoint.go.html to see an example of how to use DeleteEkmsPrivateEndpointRequest. +type DeleteEkmsPrivateEndpointRequest struct { + + // Unique EKMS private endpoint identifier. + EkmsPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"ekmsPrivateEndpointId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteEkmsPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteEkmsPrivateEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteEkmsPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteEkmsPrivateEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteEkmsPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteEkmsPrivateEndpointResponse wrapper for the DeleteEkmsPrivateEndpoint operation +type DeleteEkmsPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the work request, used to track the progress of the + // operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteEkmsPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteEkmsPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_details.go index 37e3e628b..e17e00770 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -34,7 +33,7 @@ func (m DeleteVaultReplicaDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_request_response.go index 4e1165dbd..e5eca89b0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/delete_vault_replica_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteVaultReplica.go.html to see an example of how to use DeleteVaultReplicaRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteVaultReplica.go.html to see an example of how to use DeleteVaultReplicaRequest. type DeleteVaultReplicaRequest struct { // The OCID of the vault. @@ -81,7 +81,7 @@ func (request DeleteVaultReplicaRequest) RetryPolicy() *common.RetryPolicy { func (request DeleteVaultReplicaRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/disable_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/disable_key_request_response.go index 0f0acf4fe..727cba48c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/disable_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/disable_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DisableKey.go.html to see an example of how to use DisableKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DisableKey.go.html to see an example of how to use DisableKeyRequest. type DisableKeyRequest struct { // The OCID of the key. @@ -78,7 +78,7 @@ func (request DisableKeyRequest) RetryPolicy() *common.RetryPolicy { func (request DisableKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/download_certificate_signing_request_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/download_certificate_signing_request_request_response.go new file mode 100644 index 000000000..a45f15cb0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/download_certificate_signing_request_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DownloadCertificateSigningRequestRequest wrapper for the DownloadCertificateSigningRequest operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DownloadCertificateSigningRequest.go.html to see an example of how to use DownloadCertificateSigningRequestRequest. +type DownloadCertificateSigningRequestRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DownloadCertificateSigningRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DownloadCertificateSigningRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DownloadCertificateSigningRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DownloadCertificateSigningRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DownloadCertificateSigningRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DownloadCertificateSigningRequestResponse wrapper for the DownloadCertificateSigningRequest operation +type DownloadCertificateSigningRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The string instance + Value *string `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DownloadCertificateSigningRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DownloadCertificateSigningRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint.go new file mode 100644 index 000000000..69e1ed13e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint.go @@ -0,0 +1,137 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EkmsPrivateEndpoint EKMS private endpoint created in customer subnet used to connect to external key manager system +type EkmsPrivateEndpoint struct { + + // Unique identifier that is immutable + Id *string `mandatory:"true" json:"id"` + + // Compartment Identifier. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Subnet Identifier + SubnetId *string `mandatory:"true" json:"subnetId"` + + // EKMS Private Endpoint display name + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the EKMS private endpoint was created. An RFC3339 (https://tools.ietf.org/html/rfc3339) formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the EKMS private endpoint resource. + LifecycleState EkmsPrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Private IP of the external key manager system to connect to from the EKMS private endpoint + ExternalKeyManagerIp *string `mandatory:"true" json:"externalKeyManagerIp"` + + // The time the EKMS private endpoint was updated. An RFC3339 (https://tools.ietf.org/html/rfc3339) formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in 'Failed' state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The port of the external key manager system + Port *int `mandatory:"false" json:"port"` + + // CABundle to validate TLS certificate of the external key manager system in PEM format + CaBundle *string `mandatory:"false" json:"caBundle"` + + // The IP address in the customer's VCN for the EKMS private endpoint. This is taken from subnet + PrivateEndpointIp *string `mandatory:"false" json:"privateEndpointIp"` +} + +func (m EkmsPrivateEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EkmsPrivateEndpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingEkmsPrivateEndpointLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetEkmsPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EkmsPrivateEndpointLifecycleStateEnum Enum with underlying type: string +type EkmsPrivateEndpointLifecycleStateEnum string + +// Set of constants representing the allowable values for EkmsPrivateEndpointLifecycleStateEnum +const ( + EkmsPrivateEndpointLifecycleStateCreating EkmsPrivateEndpointLifecycleStateEnum = "CREATING" + EkmsPrivateEndpointLifecycleStateActive EkmsPrivateEndpointLifecycleStateEnum = "ACTIVE" + EkmsPrivateEndpointLifecycleStateDeleting EkmsPrivateEndpointLifecycleStateEnum = "DELETING" + EkmsPrivateEndpointLifecycleStateDeleted EkmsPrivateEndpointLifecycleStateEnum = "DELETED" + EkmsPrivateEndpointLifecycleStateFailed EkmsPrivateEndpointLifecycleStateEnum = "FAILED" +) + +var mappingEkmsPrivateEndpointLifecycleStateEnum = map[string]EkmsPrivateEndpointLifecycleStateEnum{ + "CREATING": EkmsPrivateEndpointLifecycleStateCreating, + "ACTIVE": EkmsPrivateEndpointLifecycleStateActive, + "DELETING": EkmsPrivateEndpointLifecycleStateDeleting, + "DELETED": EkmsPrivateEndpointLifecycleStateDeleted, + "FAILED": EkmsPrivateEndpointLifecycleStateFailed, +} + +var mappingEkmsPrivateEndpointLifecycleStateEnumLowerCase = map[string]EkmsPrivateEndpointLifecycleStateEnum{ + "creating": EkmsPrivateEndpointLifecycleStateCreating, + "active": EkmsPrivateEndpointLifecycleStateActive, + "deleting": EkmsPrivateEndpointLifecycleStateDeleting, + "deleted": EkmsPrivateEndpointLifecycleStateDeleted, + "failed": EkmsPrivateEndpointLifecycleStateFailed, +} + +// GetEkmsPrivateEndpointLifecycleStateEnumValues Enumerates the set of values for EkmsPrivateEndpointLifecycleStateEnum +func GetEkmsPrivateEndpointLifecycleStateEnumValues() []EkmsPrivateEndpointLifecycleStateEnum { + values := make([]EkmsPrivateEndpointLifecycleStateEnum, 0) + for _, v := range mappingEkmsPrivateEndpointLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetEkmsPrivateEndpointLifecycleStateEnumStringValues Enumerates the set of values in String for EkmsPrivateEndpointLifecycleStateEnum +func GetEkmsPrivateEndpointLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingEkmsPrivateEndpointLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingEkmsPrivateEndpointLifecycleStateEnum(val string) (EkmsPrivateEndpointLifecycleStateEnum, bool) { + enum, ok := mappingEkmsPrivateEndpointLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint_summary.go new file mode 100644 index 000000000..dce527c57 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/ekms_private_endpoint_summary.go @@ -0,0 +1,122 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EkmsPrivateEndpointSummary EKMS private endpoints summary +type EkmsPrivateEndpointSummary struct { + + // Unique identifier that is immutable + Id *string `mandatory:"true" json:"id"` + + // Subnet Identifier + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Identifier of the compartment this EKMS private endpoint belongs to + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the EKMS private endpoint was created. An RFC3339 (https://tools.ietf.org/html/rfc3339) formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Mutable name of the EKMS private endpoint + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the EKMS private endpoint resource. + LifecycleState EkmsPrivateEndpointSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the EKMS private endpoint was updated. An RFC3339 (https://tools.ietf.org/html/rfc3339) formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m EkmsPrivateEndpointSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EkmsPrivateEndpointSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingEkmsPrivateEndpointSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetEkmsPrivateEndpointSummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EkmsPrivateEndpointSummaryLifecycleStateEnum Enum with underlying type: string +type EkmsPrivateEndpointSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for EkmsPrivateEndpointSummaryLifecycleStateEnum +const ( + EkmsPrivateEndpointSummaryLifecycleStateCreating EkmsPrivateEndpointSummaryLifecycleStateEnum = "CREATING" + EkmsPrivateEndpointSummaryLifecycleStateActive EkmsPrivateEndpointSummaryLifecycleStateEnum = "ACTIVE" + EkmsPrivateEndpointSummaryLifecycleStateDeleting EkmsPrivateEndpointSummaryLifecycleStateEnum = "DELETING" + EkmsPrivateEndpointSummaryLifecycleStateDeleted EkmsPrivateEndpointSummaryLifecycleStateEnum = "DELETED" + EkmsPrivateEndpointSummaryLifecycleStateFailed EkmsPrivateEndpointSummaryLifecycleStateEnum = "FAILED" +) + +var mappingEkmsPrivateEndpointSummaryLifecycleStateEnum = map[string]EkmsPrivateEndpointSummaryLifecycleStateEnum{ + "CREATING": EkmsPrivateEndpointSummaryLifecycleStateCreating, + "ACTIVE": EkmsPrivateEndpointSummaryLifecycleStateActive, + "DELETING": EkmsPrivateEndpointSummaryLifecycleStateDeleting, + "DELETED": EkmsPrivateEndpointSummaryLifecycleStateDeleted, + "FAILED": EkmsPrivateEndpointSummaryLifecycleStateFailed, +} + +var mappingEkmsPrivateEndpointSummaryLifecycleStateEnumLowerCase = map[string]EkmsPrivateEndpointSummaryLifecycleStateEnum{ + "creating": EkmsPrivateEndpointSummaryLifecycleStateCreating, + "active": EkmsPrivateEndpointSummaryLifecycleStateActive, + "deleting": EkmsPrivateEndpointSummaryLifecycleStateDeleting, + "deleted": EkmsPrivateEndpointSummaryLifecycleStateDeleted, + "failed": EkmsPrivateEndpointSummaryLifecycleStateFailed, +} + +// GetEkmsPrivateEndpointSummaryLifecycleStateEnumValues Enumerates the set of values for EkmsPrivateEndpointSummaryLifecycleStateEnum +func GetEkmsPrivateEndpointSummaryLifecycleStateEnumValues() []EkmsPrivateEndpointSummaryLifecycleStateEnum { + values := make([]EkmsPrivateEndpointSummaryLifecycleStateEnum, 0) + for _, v := range mappingEkmsPrivateEndpointSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetEkmsPrivateEndpointSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for EkmsPrivateEndpointSummaryLifecycleStateEnum +func GetEkmsPrivateEndpointSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingEkmsPrivateEndpointSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingEkmsPrivateEndpointSummaryLifecycleStateEnum(val string) (EkmsPrivateEndpointSummaryLifecycleStateEnum, bool) { + enum, ok := mappingEkmsPrivateEndpointSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/enable_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/enable_key_request_response.go index 12a7fe7e1..7506e1f00 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/enable_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/enable_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/EnableKey.go.html to see an example of how to use EnableKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/EnableKey.go.html to see an example of how to use EnableKeyRequest. type EnableKeyRequest struct { // The OCID of the key. @@ -78,7 +78,7 @@ func (request EnableKeyRequest) RetryPolicy() *common.RetryPolicy { func (request EnableKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_data_details.go index 37bb15975..62a843b1d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_data_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// EncryptDataDetails The representation of EncryptDataDetails +// EncryptDataDetails The details of the plaintext data that you want to encrypt. type EncryptDataDetails struct { // The OCID of the key to encrypt with. @@ -60,7 +59,7 @@ func (m EncryptDataDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EncryptionAlgorithm: %s. Supported values are: %s.", m.EncryptionAlgorithm, strings.Join(GetEncryptDataDetailsEncryptionAlgorithmEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_request_response.go index dcdf5812c..a2a54b981 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypt_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Encrypt.go.html to see an example of how to use EncryptRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Encrypt.go.html to see an example of how to use EncryptRequest. type EncryptRequest struct { // EncryptDataDetails @@ -63,7 +63,7 @@ func (request EncryptRequest) RetryPolicy() *common.RetryPolicy { func (request EncryptRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypted_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypted_data.go index 27e2aac1b..9af66210b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypted_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/encrypted_data.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// EncryptedData The representation of EncryptedData +// EncryptedData The response to a request to encrypt the plaintext data. type EncryptedData struct { // The encrypted data. @@ -51,7 +50,7 @@ func (m EncryptedData) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EncryptionAlgorithm: %s. Supported values are: %s.", m.EncryptionAlgorithm, strings.Join(GetEncryptedDataEncryptionAlgorithmEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_details.go index 954e3151e..39414f3ab 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -55,7 +54,7 @@ func (m ExportKeyDetails) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_request_response.go index d1b4245c4..ef826c967 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/export_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ExportKey.go.html to see an example of how to use ExportKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ExportKey.go.html to see an example of how to use ExportKeyRequest. type ExportKeyRequest struct { // ExportKeyDetails @@ -62,7 +62,7 @@ func (request ExportKeyRequest) RetryPolicy() *common.RetryPolicy { func (request ExportKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/exported_key_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/exported_key_data.go index 080fb3bb3..78fd0d11d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/exported_key_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/exported_key_data.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -58,7 +57,7 @@ func (m ExportedKeyData) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata.go new file mode 100644 index 000000000..d852de14c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalKeyManagerMetadata Metadata required for accessing External Key manager +type ExternalKeyManagerMetadata struct { + OauthMetadata *OauthMetadata `mandatory:"true" json:"oauthMetadata"` + + // URI of the vault on external key manager. + ExternalVaultEndpointUrl *string `mandatory:"true" json:"externalVaultEndpointUrl"` + + // OCID of private endpoint created by customer. + PrivateEndpointId *string `mandatory:"true" json:"privateEndpointId"` +} + +func (m ExternalKeyManagerMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalKeyManagerMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata_summary.go new file mode 100644 index 000000000..caa22e46a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_manager_metadata_summary.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalKeyManagerMetadataSummary Summary about metadata of external key manager to be returned to the customer as a response. +type ExternalKeyManagerMetadataSummary struct { + + // URL of the vault on external key manager. + ExternalVaultEndpointUrl *string `mandatory:"true" json:"externalVaultEndpointUrl"` + + // OCID of the private endpoint. + PrivateEndpointId *string `mandatory:"true" json:"privateEndpointId"` + + // Vendor of the external key manager. + Vendor *string `mandatory:"false" json:"vendor"` + + OauthMetadataSummary *OauthMetadataSummary `mandatory:"false" json:"oauthMetadataSummary"` +} + +func (m ExternalKeyManagerMetadataSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalKeyManagerMetadataSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference.go new file mode 100644 index 000000000..05b0503b3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalKeyReference A reference to the key on external key manager. +type ExternalKeyReference struct { + + // ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM + ExternalKeyId *string `mandatory:"true" json:"externalKeyId"` +} + +func (m ExternalKeyReference) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalKeyReference) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference_details.go new file mode 100644 index 000000000..5bedf4b6f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_reference_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalKeyReferenceDetails Key reference data to be returned to the customer as a response. +type ExternalKeyReferenceDetails struct { + + // ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + ExternalKeyId *string `mandatory:"true" json:"externalKeyId"` + + // Key version ID associated with the external key. + ExternalKeyVersionId *string `mandatory:"true" json:"externalKeyVersionId"` +} + +func (m ExternalKeyReferenceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalKeyReferenceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_version_reference.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_version_reference.go new file mode 100644 index 000000000..33a2edc0c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/external_key_version_reference.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalKeyVersionReference A reference to key version on external key manager. +type ExternalKeyVersionReference struct { + + // Key version ID associated with the external key. + ExternalKeyVersionId *string `mandatory:"false" json:"externalKeyVersionId"` +} + +func (m ExternalKeyVersionReference) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalKeyVersionReference) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_data_encryption_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_data_encryption_key_request_response.go index e8ba2e069..277af654e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_data_encryption_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_data_encryption_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GenerateDataEncryptionKey.go.html to see an example of how to use GenerateDataEncryptionKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GenerateDataEncryptionKey.go.html to see an example of how to use GenerateDataEncryptionKeyRequest. type GenerateDataEncryptionKeyRequest struct { // GenerateKeyDetails @@ -63,7 +63,7 @@ func (request GenerateDataEncryptionKeyRequest) RetryPolicy() *common.RetryPolic func (request GenerateDataEncryptionKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_key_details.go index 388a6b0e1..8f01cd561 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generate_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// GenerateKeyDetails The representation of GenerateKeyDetails +// GenerateKeyDetails The details of the key that you want to encrypt or decrypt data. type GenerateKeyDetails struct { // If true, the generated key is also returned unencrypted. @@ -48,7 +47,7 @@ func (m GenerateKeyDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generated_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generated_key.go index 8eb8094a9..03547f0da 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generated_key.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/generated_key.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,19 +15,19 @@ import ( "strings" ) -// GeneratedKey The representation of GeneratedKey +// GeneratedKey The reponse to the regeuest to generate the key to encrypt or decrypt the data. type GeneratedKey struct { // The encrypted data encryption key generated from a master encryption key. Ciphertext *string `mandatory:"true" json:"ciphertext"` // The plaintext data encryption key, a base64-encoded sequence of random bytes, which is - // included if the GenerateDataEncryptionKey (https://docs.cloud.oracle.com/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) + // included if the GenerateDataEncryptionKey (https://docs.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) // request includes the `includePlaintextKey` parameter and sets its value to "true". Plaintext *string `mandatory:"false" json:"plaintext"` // The checksum of the plaintext data encryption key, which is included if the - // GenerateDataEncryptionKey (https://docs.cloud.oracle.com/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) + // GenerateDataEncryptionKey (https://docs.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) // request includes the `includePlaintextKey` parameter and sets its value to "true". PlaintextChecksum *string `mandatory:"false" json:"plaintextChecksum"` } @@ -44,7 +43,7 @@ func (m GeneratedKey) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_ekms_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_ekms_private_endpoint_request_response.go new file mode 100644 index 000000000..d85733580 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_ekms_private_endpoint_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetEkmsPrivateEndpointRequest wrapper for the GetEkmsPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetEkmsPrivateEndpoint.go.html to see an example of how to use GetEkmsPrivateEndpointRequest. +type GetEkmsPrivateEndpointRequest struct { + + // Unique EKMS private endpoint identifier. + EkmsPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"ekmsPrivateEndpointId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetEkmsPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetEkmsPrivateEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetEkmsPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetEkmsPrivateEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetEkmsPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetEkmsPrivateEndpointResponse wrapper for the GetEkmsPrivateEndpoint operation +type GetEkmsPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The EkmsPrivateEndpoint instance + EkmsPrivateEndpoint `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetEkmsPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetEkmsPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_cluster_request_response.go new file mode 100644 index 000000000..41446d6da --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_cluster_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetHsmClusterRequest wrapper for the GetHsmCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmCluster.go.html to see an example of how to use GetHsmClusterRequest. +type GetHsmClusterRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHsmClusterRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHsmClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetHsmClusterResponse wrapper for the GetHsmCluster operation +type GetHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_partition_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_partition_request_response.go new file mode 100644 index 000000000..f8a7e84a5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_hsm_partition_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetHsmPartitionRequest wrapper for the GetHsmPartition operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmPartition.go.html to see an example of how to use GetHsmPartitionRequest. +type GetHsmPartitionRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // The OCID of the HSM Partition. This is a unique identifier which each hsmPartition will have. + HsmPartitionId *string `mandatory:"true" contributesTo:"path" name:"hsmPartitionId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetHsmPartitionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHsmPartitionRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetHsmPartitionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHsmPartitionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetHsmPartitionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetHsmPartitionResponse wrapper for the GetHsmPartition operation +type GetHsmPartitionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmPartition instance + HsmPartition `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetHsmPartitionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHsmPartitionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_request_response.go index d863ac355..3b9cc0bb2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKey.go.html to see an example of how to use GetKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKey.go.html to see an example of how to use GetKeyRequest. type GetKeyRequest struct { // The OCID of the key. @@ -63,7 +63,7 @@ func (request GetKeyRequest) RetryPolicy() *common.RetryPolicy { func (request GetKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_version_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_version_request_response.go index 49090e86d..a6df9d859 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_version_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_key_version_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKeyVersion.go.html to see an example of how to use GetKeyVersionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKeyVersion.go.html to see an example of how to use GetKeyVersionRequest. type GetKeyVersionRequest struct { // The OCID of the key. @@ -66,7 +66,7 @@ func (request GetKeyVersionRequest) RetryPolicy() *common.RetryPolicy { func (request GetKeyVersionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_pre_co_user_credentials_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_pre_co_user_credentials_request_response.go new file mode 100644 index 000000000..8029222ed --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_pre_co_user_credentials_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPreCoUserCredentialsRequest wrapper for the GetPreCoUserCredentials operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetPreCoUserCredentials.go.html to see an example of how to use GetPreCoUserCredentialsRequest. +type GetPreCoUserCredentialsRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPreCoUserCredentialsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPreCoUserCredentialsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetPreCoUserCredentialsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPreCoUserCredentialsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetPreCoUserCredentialsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPreCoUserCredentialsResponse wrapper for the GetPreCoUserCredentials operation +type GetPreCoUserCredentialsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PreCoUserCredentials instance + PreCoUserCredentials `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetPreCoUserCredentialsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPreCoUserCredentialsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_replication_status_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_replication_status_request_response.go index be5427ee8..e627189d2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_replication_status_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_replication_status_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetReplicationStatus.go.html to see an example of how to use GetReplicationStatusRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetReplicationStatus.go.html to see an example of how to use GetReplicationStatusRequest. type GetReplicationStatusRequest struct { // replicationId associated with an operation on a resource @@ -63,7 +63,7 @@ func (request GetReplicationStatusRequest) RetryPolicy() *common.RetryPolicy { func (request GetReplicationStatusRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_request_response.go index e8ee676a2..c6035f045 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVault.go.html to see an example of how to use GetVaultRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVault.go.html to see an example of how to use GetVaultRequest. type GetVaultRequest struct { // The OCID of the vault. @@ -63,7 +63,7 @@ func (request GetVaultRequest) RetryPolicy() *common.RetryPolicy { func (request GetVaultRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_usage_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_usage_request_response.go index d16fc5c59..596f529de 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_usage_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_vault_usage_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVaultUsage.go.html to see an example of how to use GetVaultUsageRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVaultUsage.go.html to see an example of how to use GetVaultUsageRequest. type GetVaultUsageRequest struct { // The OCID of the vault. @@ -63,7 +63,7 @@ func (request GetVaultUsageRequest) RetryPolicy() *common.RetryPolicy { func (request GetVaultUsageRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_wrapping_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_wrapping_key_request_response.go index e1f7874d9..6a268eeb8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_wrapping_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/get_wrapping_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetWrappingKey.go.html to see an example of how to use GetWrappingKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetWrappingKey.go.html to see an example of how to use GetWrappingKeyRequest. type GetWrappingKeyRequest struct { // Unique identifier for the request. If provided, the returned request ID @@ -60,7 +60,7 @@ func (request GetWrappingKeyRequest) RetryPolicy() *common.RetryPolicy { func (request GetWrappingKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster.go new file mode 100644 index 000000000..b15a8c296 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmCluster Dedicated KMS-HSM Cluster Management +type HsmCluster struct { + + // The OCID of the HSMCluster resource. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains this HSMCluster resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly display name for the HSMCluster resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time this HSM resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time this HSM resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The HSMCluster's current state. + // Example: `ACTIVE` + LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // DNS name for the HSM Cluster -- this will contain information about the region as well. + DnsName *string `mandatory:"true" json:"dnsName"` + + // An optional property indicating when to delete the key, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m HsmCluster) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmCluster) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmClusterLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetHsmClusterLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HsmClusterLifecycleStateEnum Enum with underlying type: string +type HsmClusterLifecycleStateEnum string + +// Set of constants representing the allowable values for HsmClusterLifecycleStateEnum +const ( + HsmClusterLifecycleStateCreating HsmClusterLifecycleStateEnum = "CREATING" + HsmClusterLifecycleStateInitializationRequired HsmClusterLifecycleStateEnum = "INITIALIZATION_REQUIRED" + HsmClusterLifecycleStateInitializing HsmClusterLifecycleStateEnum = "INITIALIZING" + HsmClusterLifecycleStateActivationRequired HsmClusterLifecycleStateEnum = "ACTIVATION_REQUIRED" + HsmClusterLifecycleStateActivating HsmClusterLifecycleStateEnum = "ACTIVATING" + HsmClusterLifecycleStateActive HsmClusterLifecycleStateEnum = "ACTIVE" + HsmClusterLifecycleStateDeleting HsmClusterLifecycleStateEnum = "DELETING" + HsmClusterLifecycleStateDeleted HsmClusterLifecycleStateEnum = "DELETED" + HsmClusterLifecycleStatePendingDeletion HsmClusterLifecycleStateEnum = "PENDING_DELETION" + HsmClusterLifecycleStateSchedulingDeletion HsmClusterLifecycleStateEnum = "SCHEDULING_DELETION" + HsmClusterLifecycleStateCancellingDeletion HsmClusterLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingHsmClusterLifecycleStateEnum = map[string]HsmClusterLifecycleStateEnum{ + "CREATING": HsmClusterLifecycleStateCreating, + "INITIALIZATION_REQUIRED": HsmClusterLifecycleStateInitializationRequired, + "INITIALIZING": HsmClusterLifecycleStateInitializing, + "ACTIVATION_REQUIRED": HsmClusterLifecycleStateActivationRequired, + "ACTIVATING": HsmClusterLifecycleStateActivating, + "ACTIVE": HsmClusterLifecycleStateActive, + "DELETING": HsmClusterLifecycleStateDeleting, + "DELETED": HsmClusterLifecycleStateDeleted, + "PENDING_DELETION": HsmClusterLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": HsmClusterLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": HsmClusterLifecycleStateCancellingDeletion, +} + +var mappingHsmClusterLifecycleStateEnumLowerCase = map[string]HsmClusterLifecycleStateEnum{ + "creating": HsmClusterLifecycleStateCreating, + "initialization_required": HsmClusterLifecycleStateInitializationRequired, + "initializing": HsmClusterLifecycleStateInitializing, + "activation_required": HsmClusterLifecycleStateActivationRequired, + "activating": HsmClusterLifecycleStateActivating, + "active": HsmClusterLifecycleStateActive, + "deleting": HsmClusterLifecycleStateDeleting, + "deleted": HsmClusterLifecycleStateDeleted, + "pending_deletion": HsmClusterLifecycleStatePendingDeletion, + "scheduling_deletion": HsmClusterLifecycleStateSchedulingDeletion, + "cancelling_deletion": HsmClusterLifecycleStateCancellingDeletion, +} + +// GetHsmClusterLifecycleStateEnumValues Enumerates the set of values for HsmClusterLifecycleStateEnum +func GetHsmClusterLifecycleStateEnumValues() []HsmClusterLifecycleStateEnum { + values := make([]HsmClusterLifecycleStateEnum, 0) + for _, v := range mappingHsmClusterLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetHsmClusterLifecycleStateEnumStringValues Enumerates the set of values in String for HsmClusterLifecycleStateEnum +func GetHsmClusterLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "INITIALIZATION_REQUIRED", + "INITIALIZING", + "ACTIVATION_REQUIRED", + "ACTIVATING", + "ACTIVE", + "DELETING", + "DELETED", + "PENDING_DELETION", + "SCHEDULING_DELETION", + "CANCELLING_DELETION", + } +} + +// GetMappingHsmClusterLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHsmClusterLifecycleStateEnum(val string) (HsmClusterLifecycleStateEnum, bool) { + enum, ok := mappingHsmClusterLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_collection.go new file mode 100644 index 000000000..e00003769 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmClusterCollection HsmClusterCollection object with page of HsmClusterSummary objects. +type HsmClusterCollection struct { + + // List of HSM Cluster Summary Objects. + Items []HsmClusterSummary `mandatory:"true" json:"items"` +} + +func (m HsmClusterCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmClusterCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_summary.go new file mode 100644 index 000000000..52e0ccdd1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_cluster_summary.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmClusterSummary An object which encapsulates the details of a given HSM Cluster. +type HsmClusterSummary struct { + + // The OCID of a HSMCluster resource. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name for a HSMCluster resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the compartment that contains a particular HSMCluster resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` + LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // DNS name for the HSMCluster -- this will contain information about the region as well. + DnsName *string `mandatory:"true" json:"dnsName"` + + // The date and time a dedicated KMS resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time a dedicated KMS resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // An optional property indicating when to delete the resource, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m HsmClusterSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmClusterLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetHsmClusterLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition.go new file mode 100644 index 000000000..7a7ed0966 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition.go @@ -0,0 +1,126 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartition Dedicated KMS-HSM Partition Management +type HsmPartition struct { + + // The OCID of the HSM resource. Each HSM resource has a unique OCID as an identifier. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains a particular HSM resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (refers to either an enum value of Managementutility,Clientutility, or null) + PortInformation []PortInformation `mandatory:"true" json:"portInformation"` + + // The date and time a HSMPartition was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time a HSMPartition was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` + LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +func (m HsmPartition) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartition) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HsmPartitionLifecycleStateEnum Enum with underlying type: string +type HsmPartitionLifecycleStateEnum string + +// Set of constants representing the allowable values for HsmPartitionLifecycleStateEnum +const ( + HsmPartitionLifecycleStateActive HsmPartitionLifecycleStateEnum = "ACTIVE" + HsmPartitionLifecycleStateInactive HsmPartitionLifecycleStateEnum = "INACTIVE" + HsmPartitionLifecycleStateActivating HsmPartitionLifecycleStateEnum = "ACTIVATING" + HsmPartitionLifecycleStateActivationRequired HsmPartitionLifecycleStateEnum = "ACTIVATION_REQUIRED" + HsmPartitionLifecycleStateSchedulingDeletion HsmPartitionLifecycleStateEnum = "SCHEDULING_DELETION" + HsmPartitionLifecycleStatePendingDeletion HsmPartitionLifecycleStateEnum = "PENDING_DELETION" + HsmPartitionLifecycleStateDeleting HsmPartitionLifecycleStateEnum = "DELETING" + HsmPartitionLifecycleStateDeleted HsmPartitionLifecycleStateEnum = "DELETED" +) + +var mappingHsmPartitionLifecycleStateEnum = map[string]HsmPartitionLifecycleStateEnum{ + "ACTIVE": HsmPartitionLifecycleStateActive, + "INACTIVE": HsmPartitionLifecycleStateInactive, + "ACTIVATING": HsmPartitionLifecycleStateActivating, + "ACTIVATION_REQUIRED": HsmPartitionLifecycleStateActivationRequired, + "SCHEDULING_DELETION": HsmPartitionLifecycleStateSchedulingDeletion, + "PENDING_DELETION": HsmPartitionLifecycleStatePendingDeletion, + "DELETING": HsmPartitionLifecycleStateDeleting, + "DELETED": HsmPartitionLifecycleStateDeleted, +} + +var mappingHsmPartitionLifecycleStateEnumLowerCase = map[string]HsmPartitionLifecycleStateEnum{ + "active": HsmPartitionLifecycleStateActive, + "inactive": HsmPartitionLifecycleStateInactive, + "activating": HsmPartitionLifecycleStateActivating, + "activation_required": HsmPartitionLifecycleStateActivationRequired, + "scheduling_deletion": HsmPartitionLifecycleStateSchedulingDeletion, + "pending_deletion": HsmPartitionLifecycleStatePendingDeletion, + "deleting": HsmPartitionLifecycleStateDeleting, + "deleted": HsmPartitionLifecycleStateDeleted, +} + +// GetHsmPartitionLifecycleStateEnumValues Enumerates the set of values for HsmPartitionLifecycleStateEnum +func GetHsmPartitionLifecycleStateEnumValues() []HsmPartitionLifecycleStateEnum { + values := make([]HsmPartitionLifecycleStateEnum, 0) + for _, v := range mappingHsmPartitionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetHsmPartitionLifecycleStateEnumStringValues Enumerates the set of values in String for HsmPartitionLifecycleStateEnum +func GetHsmPartitionLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + "ACTIVATING", + "ACTIVATION_REQUIRED", + "SCHEDULING_DELETION", + "PENDING_DELETION", + "DELETING", + "DELETED", + } +} + +// GetMappingHsmPartitionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHsmPartitionLifecycleStateEnum(val string) (HsmPartitionLifecycleStateEnum, bool) { + enum, ok := mappingHsmPartitionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_collection.go new file mode 100644 index 000000000..6abece0a9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartitionCollection HsmPartitionCollection object with page of HsmPartitionSummary objects. A HsmPartitionSummary object contains details about the corresponding HSM. +type HsmPartitionCollection struct { + + // List of HsmPartitionSummaries. + Items []HsmPartitionSummary `mandatory:"true" json:"items"` +} + +func (m HsmPartitionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartitionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_summary.go new file mode 100644 index 000000000..eeade9286 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/hsm_partition_summary.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartitionSummary An object which encapsulates the details of a given HSM. +type HsmPartitionSummary struct { + + // The OCID of the HSM resource. Each HSM resource will have a unique OCID identifier. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the HSMCluster that contains a particular HSM resource. + HsmClusterId *string `mandatory:"true" json:"hsmClusterId"` + + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` + LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The OCID of the compartment that contains a particular HSM resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (refers to either an enum value of Managementutility,Clientutility, or null) + PortInformation []PortInformation `mandatory:"true" json:"portInformation"` + + // The date and time an HSM was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time an HSM was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m HsmPartitionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartitionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_details.go index 70c9976d5..ab0a2be0b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// ImportKeyDetails The representation of ImportKeyDetails +// ImportKeyDetails The details of the Key that you wish to import. type ImportKeyDetails struct { // The OCID of the compartment that contains this key. @@ -30,6 +29,11 @@ type ImportKeyDetails struct { WrappedImportKey *WrappedImportKey `mandatory:"true" json:"wrappedImportKey"` + // A parameter specifying whether the auto key rotation is enabled or not. + IsAutoRotationEnabled *bool `mandatory:"false" json:"isAutoRotationEnabled"` + + AutoKeyRotationDetails *AutoKeyRotationDetails `mandatory:"false" json:"autoKeyRotationDetails"` + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. // Example: `{"foo-namespace": {"bar-key": "foo-value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -61,7 +65,7 @@ func (m ImportKeyDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProtectionMode: %s. Supported values are: %s.", m.ProtectionMode, strings.Join(GetImportKeyDetailsProtectionModeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_request_response.go index 59d8ae75f..eadd2c666 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKey.go.html to see an example of how to use ImportKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKey.go.html to see an example of how to use ImportKeyRequest. type ImportKeyRequest struct { // ImportKeyDetails @@ -71,7 +71,7 @@ func (request ImportKeyRequest) RetryPolicy() *common.RetryPolicy { func (request ImportKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_details.go index 5f1533921..7380f4929 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,17 +15,17 @@ import ( "strings" ) -// ImportKeyVersionDetails The representation of ImportKeyVersionDetails +// ImportKeyVersionDetails The details of the KeyVersion that you wish to import. type ImportKeyVersionDetails struct { WrappedImportKey *WrappedImportKey `mandatory:"true" json:"wrappedImportKey"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -42,7 +41,7 @@ func (m ImportKeyVersionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_request_response.go index 95741f804..63878b5b0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/import_key_version_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKeyVersion.go.html to see an example of how to use ImportKeyVersionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKeyVersion.go.html to see an example of how to use ImportKeyVersionRequest. type ImportKeyVersionRequest struct { // The OCID of the key. @@ -74,7 +74,7 @@ func (request ImportKeyVersionRequest) RetryPolicy() *common.RetryPolicy { func (request ImportKeyVersionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key.go index 465db81a1..5d1afbec7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// Key The representation of Key +// Key The logical entities that represent one or more key versions, each of which contains cryptographic material. type Key struct { // The OCID of the compartment that contains this master encryption key. @@ -48,12 +47,12 @@ type Key struct { VaultId *string `mandatory:"true" json:"vaultId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -62,6 +61,9 @@ type Key struct { // the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists // on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, // a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. + // A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. + // Oracle only hold a reference to that key. + // All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. ProtectionMode KeyProtectionModeEnum `mandatory:"false" json:"protectionMode,omitempty"` // An optional property indicating when to delete the key, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. @@ -73,7 +75,15 @@ type Key struct { ReplicaDetails *KeyReplicaDetails `mandatory:"false" json:"replicaDetails"` + // A Boolean value that indicates whether the Key belongs to primary Vault or replica vault. IsPrimary *bool `mandatory:"false" json:"isPrimary"` + + // A parameter specifying whether the auto key rotation is enabled or not. + IsAutoRotationEnabled *bool `mandatory:"false" json:"isAutoRotationEnabled"` + + AutoKeyRotationDetails *AutoKeyRotationDetails `mandatory:"false" json:"autoKeyRotationDetails"` + + ExternalKeyReferenceDetails *ExternalKeyReferenceDetails `mandatory:"false" json:"externalKeyReferenceDetails"` } func (m Key) String() string { @@ -93,7 +103,7 @@ func (m Key) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProtectionMode: %s. Supported values are: %s.", m.ProtectionMode, strings.Join(GetKeyProtectionModeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -105,16 +115,19 @@ type KeyProtectionModeEnum string const ( KeyProtectionModeHsm KeyProtectionModeEnum = "HSM" KeyProtectionModeSoftware KeyProtectionModeEnum = "SOFTWARE" + KeyProtectionModeExternal KeyProtectionModeEnum = "EXTERNAL" ) var mappingKeyProtectionModeEnum = map[string]KeyProtectionModeEnum{ "HSM": KeyProtectionModeHsm, "SOFTWARE": KeyProtectionModeSoftware, + "EXTERNAL": KeyProtectionModeExternal, } var mappingKeyProtectionModeEnumLowerCase = map[string]KeyProtectionModeEnum{ "hsm": KeyProtectionModeHsm, "software": KeyProtectionModeSoftware, + "external": KeyProtectionModeExternal, } // GetKeyProtectionModeEnumValues Enumerates the set of values for KeyProtectionModeEnum @@ -131,6 +144,7 @@ func GetKeyProtectionModeEnumStringValues() []string { return []string{ "HSM", "SOFTWARE", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_replica_details.go index f4c599e73..3fc76f28d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_replica_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -34,7 +33,7 @@ func (m KeyReplicaDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_shape.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_shape.go index c06e9fef2..5296d4cbe 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_shape.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_shape.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -19,7 +18,7 @@ import ( // KeyShape The cryptographic properties of a key. type KeyShape struct { - // The algorithm used by a key's key versions to encrypt or decrypt. + // The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. Algorithm KeyShapeAlgorithmEnum `mandatory:"true" json:"algorithm"` // The length of the key in bytes, expressed as an integer. Supported values include the following: @@ -49,7 +48,7 @@ func (m KeyShape) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurveId: %s. Supported values are: %s.", m.CurveId, strings.Join(GetKeyShapeCurveIdEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_summary.go index 48df8be7d..22e253c5d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_summary.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// KeySummary The representation of KeySummary +// KeySummary The details of the Key. type KeySummary struct { // The OCID of the compartment that contains the key. @@ -41,12 +40,12 @@ type KeySummary struct { VaultId *string `mandatory:"true" json:"vaultId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -55,10 +54,18 @@ type KeySummary struct { // the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists // on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, // a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. + // A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. + // Oracle only hold a reference to that key. + // All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. ProtectionMode KeySummaryProtectionModeEnum `mandatory:"false" json:"protectionMode,omitempty"` // The algorithm used by a key's key versions to encrypt or decrypt data. Algorithm KeySummaryAlgorithmEnum `mandatory:"false" json:"algorithm,omitempty"` + + ExternalKeyReferenceDetails *ExternalKeyReferenceDetails `mandatory:"false" json:"externalKeyReferenceDetails"` + + // A parameter specifying whether the auto key rotation is enabled or not. + IsAutoRotationEnabled *bool `mandatory:"false" json:"isAutoRotationEnabled"` } func (m KeySummary) String() string { @@ -81,7 +88,7 @@ func (m KeySummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Algorithm: %s. Supported values are: %s.", m.Algorithm, strings.Join(GetKeySummaryAlgorithmEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -179,16 +186,19 @@ type KeySummaryProtectionModeEnum string const ( KeySummaryProtectionModeHsm KeySummaryProtectionModeEnum = "HSM" KeySummaryProtectionModeSoftware KeySummaryProtectionModeEnum = "SOFTWARE" + KeySummaryProtectionModeExternal KeySummaryProtectionModeEnum = "EXTERNAL" ) var mappingKeySummaryProtectionModeEnum = map[string]KeySummaryProtectionModeEnum{ "HSM": KeySummaryProtectionModeHsm, "SOFTWARE": KeySummaryProtectionModeSoftware, + "EXTERNAL": KeySummaryProtectionModeExternal, } var mappingKeySummaryProtectionModeEnumLowerCase = map[string]KeySummaryProtectionModeEnum{ "hsm": KeySummaryProtectionModeHsm, "software": KeySummaryProtectionModeSoftware, + "external": KeySummaryProtectionModeExternal, } // GetKeySummaryProtectionModeEnumValues Enumerates the set of values for KeySummaryProtectionModeEnum @@ -205,6 +215,7 @@ func GetKeySummaryProtectionModeEnumStringValues() []string { return []string{ "HSM", "SOFTWARE", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version.go index 302bb4145..b4e624553 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// KeyVersion The representation of KeyVersion +// KeyVersion The details of the KeyVersion associated with the Key. type KeyVersion struct { // The OCID of the compartment that contains this key version. @@ -56,7 +55,13 @@ type KeyVersion struct { ReplicaDetails *KeyVersionReplicaDetails `mandatory:"false" json:"replicaDetails"` + // A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault. IsPrimary *bool `mandatory:"false" json:"isPrimary"` + + ExternalKeyReferenceDetails *ExternalKeyReferenceDetails `mandatory:"false" json:"externalKeyReferenceDetails"` + + // A Boolean Value indicating whether this keyversion is generated from auto rotation of key + IsAutoRotated *bool `mandatory:"false" json:"isAutoRotated"` } func (m KeyVersion) String() string { @@ -76,7 +81,7 @@ func (m KeyVersion) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Origin: %s. Supported values are: %s.", m.Origin, strings.Join(GetKeyVersionOriginEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_replica_details.go index 9c637a8dc..da26e01fb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_replica_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -34,7 +33,7 @@ func (m KeyVersionReplicaDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_summary.go index 2b3fd7cc4..c03d543eb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/key_version_summary.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// KeyVersionSummary The representation of KeyVersionSummary +// KeyVersionSummary The details of the KeyVersion. type KeyVersionSummary struct { // The OCID of the compartment that contains this key version. @@ -45,6 +44,11 @@ type KeyVersionSummary struct { // An optional property to indicate when to delete the key version, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. // Example: `2019-04-03T21:10:29.600Z` TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + ExternalKeyReferenceDetails *ExternalKeyReferenceDetails `mandatory:"false" json:"externalKeyReferenceDetails"` + + // An optional property indicating whether this keyversion is generated from auto rotatation. + IsAutoRotated *bool `mandatory:"false" json:"isAutoRotated"` } func (m KeyVersionSummary) String() string { @@ -64,7 +68,7 @@ func (m KeyVersionSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetKeyVersionSummaryLifecycleStateEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_ekm_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_ekm_client.go new file mode 100644 index 000000000..0f3648558 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_ekm_client.go @@ -0,0 +1,382 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// EkmClient a client for Ekm +type EkmClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewEkmClientWithConfigurationProvider Creates a new default Ekm client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewEkmClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client EkmClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newEkmClientFromBaseClient(baseClient, provider) +} + +// NewEkmClientWithOboToken Creates a new default Ekm client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewEkmClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client EkmClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newEkmClientFromBaseClient(baseClient, configProvider) +} + +func newEkmClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client EkmClient, err error) { + // Ekm service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Ekm")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = EkmClient{BaseClient: baseClient} + client.BasePath = "" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *EkmClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("kms", "https://kms.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *EkmClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *EkmClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateEkmsPrivateEndpoint Create a new EKMS private endpoint used to connect to external key manager system +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateEkmsPrivateEndpoint.go.html to see an example of how to use CreateEkmsPrivateEndpoint API. +func (client EkmClient) CreateEkmsPrivateEndpoint(ctx context.Context, request CreateEkmsPrivateEndpointRequest) (response CreateEkmsPrivateEndpointResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createEkmsPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateEkmsPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateEkmsPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateEkmsPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateEkmsPrivateEndpointResponse") + } + return +} + +// createEkmsPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client EkmClient) createEkmsPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/ekmsPrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateEkmsPrivateEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "ekm", "CreateEkmsPrivateEndpoint") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EkmsPrivateEndpoint/CreateEkmsPrivateEndpoint" + err = common.PostProcessServiceError(err, "Ekm", "CreateEkmsPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteEkmsPrivateEndpoint Deletes EKMS private endpoint by identifier. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteEkmsPrivateEndpoint.go.html to see an example of how to use DeleteEkmsPrivateEndpoint API. +func (client EkmClient) DeleteEkmsPrivateEndpoint(ctx context.Context, request DeleteEkmsPrivateEndpointRequest) (response DeleteEkmsPrivateEndpointResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteEkmsPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteEkmsPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteEkmsPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteEkmsPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteEkmsPrivateEndpointResponse") + } + return +} + +// deleteEkmsPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client EkmClient) deleteEkmsPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/20180608/ekmsPrivateEndpoints/{ekmsPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteEkmsPrivateEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "ekm", "DeleteEkmsPrivateEndpoint") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EkmsPrivateEndpoint/DeleteEkmsPrivateEndpoint" + err = common.PostProcessServiceError(err, "Ekm", "DeleteEkmsPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetEkmsPrivateEndpoint Gets a specific EKMS private by identifier. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetEkmsPrivateEndpoint.go.html to see an example of how to use GetEkmsPrivateEndpoint API. +func (client EkmClient) GetEkmsPrivateEndpoint(ctx context.Context, request GetEkmsPrivateEndpointRequest) (response GetEkmsPrivateEndpointResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getEkmsPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetEkmsPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetEkmsPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetEkmsPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetEkmsPrivateEndpointResponse") + } + return +} + +// getEkmsPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client EkmClient) getEkmsPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/ekmsPrivateEndpoints/{ekmsPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetEkmsPrivateEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "ekm", "GetEkmsPrivateEndpoint") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EkmsPrivateEndpoint/GetEkmsPrivateEndpoint" + err = common.PostProcessServiceError(err, "Ekm", "GetEkmsPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListEkmsPrivateEndpoints Returns a list of all the EKMS private endpoints in the specified compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListEkmsPrivateEndpoints.go.html to see an example of how to use ListEkmsPrivateEndpoints API. +func (client EkmClient) ListEkmsPrivateEndpoints(ctx context.Context, request ListEkmsPrivateEndpointsRequest) (response ListEkmsPrivateEndpointsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listEkmsPrivateEndpoints, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListEkmsPrivateEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListEkmsPrivateEndpointsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListEkmsPrivateEndpointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListEkmsPrivateEndpointsResponse") + } + return +} + +// listEkmsPrivateEndpoints implements the OCIOperation interface (enables retrying operations) +func (client EkmClient) listEkmsPrivateEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/ekmsPrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListEkmsPrivateEndpointsResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "ekm", "ListEkmsPrivateEndpoints") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EkmsPrivateEndpointSummary/ListEkmsPrivateEndpoints" + err = common.PostProcessServiceError(err, "Ekm", "ListEkmsPrivateEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateEkmsPrivateEndpoint Updates EKMS private endpoint. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateEkmsPrivateEndpoint.go.html to see an example of how to use UpdateEkmsPrivateEndpoint API. +func (client EkmClient) UpdateEkmsPrivateEndpoint(ctx context.Context, request UpdateEkmsPrivateEndpointRequest) (response UpdateEkmsPrivateEndpointResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateEkmsPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateEkmsPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateEkmsPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateEkmsPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateEkmsPrivateEndpointResponse") + } + return +} + +// updateEkmsPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client EkmClient) updateEkmsPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/20180608/ekmsPrivateEndpoints/{ekmsPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateEkmsPrivateEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "ekm", "UpdateEkmsPrivateEndpoint") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EkmsPrivateEndpoint/UpdateEkmsPrivateEndpoint" + err = common.PostProcessServiceError(err, "Ekm", "UpdateEkmsPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmscrypto_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmscrypto_client.go index 7bfdc91fb..bfbc7fd74 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmscrypto_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmscrypto_client.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -27,6 +26,9 @@ type KmsCryptoClient struct { // NewKmsCryptoClientWithConfigurationProvider Creates a new default KmsCrypto client with the given configuration provider. // the configuration provider will be used for the default signer func NewKmsCryptoClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client KmsCryptoClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -77,11 +79,11 @@ func (client *KmsCryptoClient) ConfigurationProvider() *common.ConfigurationProv return client.config } -// Decrypt Decrypts data using the given DecryptDataDetails (https://docs.cloud.oracle.com/api/#/en/key/latest/datatypes/DecryptDataDetails) resource. +// Decrypt Decrypts data using the given DecryptDataDetails (https://docs.oracle.com/iaas/api/#/en/key/latest/datatypes/DecryptDataDetails) resource. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Decrypt.go.html to see an example of how to use Decrypt API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Decrypt.go.html to see an example of how to use Decrypt API. func (client KmsCryptoClient) Decrypt(ctx context.Context, request DecryptRequest) (response DecryptResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -121,11 +123,11 @@ func (client KmsCryptoClient) decrypt(ctx context.Context, request common.OCIReq var response DecryptResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "Decrypt") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/DecryptedData/Decrypt" err = common.PostProcessServiceError(err, "KmsCrypto", "Decrypt", apiReferenceLink) return response, err } @@ -134,12 +136,12 @@ func (client KmsCryptoClient) decrypt(ctx context.Context, request common.OCIReq return response, err } -// Encrypt Encrypts data using the given EncryptDataDetails (https://docs.cloud.oracle.com/api/#/en/key/latest/datatypes/EncryptDataDetails) resource. +// Encrypt Encrypts data using the given EncryptDataDetails (https://docs.oracle.com/iaas/api/#/en/key/latest/datatypes/EncryptDataDetails) resource. // Plaintext included in the example request is a base64-encoded value of a UTF-8 string. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Encrypt.go.html to see an example of how to use Encrypt API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Encrypt.go.html to see an example of how to use Encrypt API. func (client KmsCryptoClient) Encrypt(ctx context.Context, request EncryptRequest) (response EncryptResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -179,11 +181,11 @@ func (client KmsCryptoClient) encrypt(ctx context.Context, request common.OCIReq var response EncryptResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "Encrypt") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/EncryptedData/Encrypt" err = common.PostProcessServiceError(err, "KmsCrypto", "Encrypt", apiReferenceLink) return response, err } @@ -195,10 +197,11 @@ func (client KmsCryptoClient) encrypt(ctx context.Context, request common.OCIReq // ExportKey Exports a specific version of a master encryption key according to the details of the request. For their protection, // keys that you create and store on a hardware security module (HSM) can never leave the HSM. You can only export keys // stored on the server. For export, the key version is encrypted by an RSA public key that you provide. +// This operation is not supported for keys having protection mode `EXTERNAL`. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ExportKey.go.html to see an example of how to use ExportKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ExportKey.go.html to see an example of how to use ExportKey API. func (client KmsCryptoClient) ExportKey(ctx context.Context, request ExportKeyRequest) (response ExportKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -238,11 +241,11 @@ func (client KmsCryptoClient) exportKey(ctx context.Context, request common.OCIR var response ExportKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "ExportKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/ExportedKeyData/ExportKey" err = common.PostProcessServiceError(err, "KmsCrypto", "ExportKey", apiReferenceLink) return response, err } @@ -253,9 +256,9 @@ func (client KmsCryptoClient) exportKey(ctx context.Context, request common.OCIR // GenerateDataEncryptionKey Generates a key that you can use to encrypt or decrypt data. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GenerateDataEncryptionKey.go.html to see an example of how to use GenerateDataEncryptionKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GenerateDataEncryptionKey.go.html to see an example of how to use GenerateDataEncryptionKey API. func (client KmsCryptoClient) GenerateDataEncryptionKey(ctx context.Context, request GenerateDataEncryptionKeyRequest) (response GenerateDataEncryptionKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -295,11 +298,11 @@ func (client KmsCryptoClient) generateDataEncryptionKey(ctx context.Context, req var response GenerateDataEncryptionKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "GenerateDataEncryptionKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/GeneratedKey/GenerateDataEncryptionKey" err = common.PostProcessServiceError(err, "KmsCrypto", "GenerateDataEncryptionKey", apiReferenceLink) return response, err } @@ -309,12 +312,13 @@ func (client KmsCryptoClient) generateDataEncryptionKey(ctx context.Context, req } // Sign Creates a digital signature for a message or message digest by using the private key of a public-private key pair, -// also known as an asymmetric key. To verify the generated signature, you can use the Verify (https://docs.cloud.oracle.com/api/#/en/key/latest/VerifiedData/Verify) +// also known as an asymmetric key. To verify the generated signature, you can use the Verify (https://docs.oracle.com/iaas/api/#/en/key/latest/VerifiedData/Verify) // operation. Or, if you want to validate the signature outside of the service, you can do so by using the public key of the same asymmetric key. +// This operation is not supported for keys having protection mode `EXTERNAL`. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Sign.go.html to see an example of how to use Sign API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Sign.go.html to see an example of how to use Sign API. func (client KmsCryptoClient) Sign(ctx context.Context, request SignRequest) (response SignResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -354,11 +358,11 @@ func (client KmsCryptoClient) sign(ctx context.Context, request common.OCIReques var response SignResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "Sign") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/SignedData/Sign" err = common.PostProcessServiceError(err, "KmsCrypto", "Sign", apiReferenceLink) return response, err } @@ -367,13 +371,14 @@ func (client KmsCryptoClient) sign(ctx context.Context, request common.OCIReques return response, err } -// Verify Verifies a digital signature that was generated by the Sign (https://docs.cloud.oracle.com/api/#/en/key/latest/SignedData/Sign) operation +// Verify Verifies a digital signature that was generated by the Sign (https://docs.oracle.com/iaas/api/#/en/key/latest/SignedData/Sign) operation // by using the public key of the same asymmetric key that was used to sign the data. If you want to validate the // digital signature outside of the service, you can do so by using the public key of the asymmetric key. +// This operation is not supported for keys having protection mode `EXTERNAL`. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Verify.go.html to see an example of how to use Verify API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Verify.go.html to see an example of how to use Verify API. func (client KmsCryptoClient) Verify(ctx context.Context, request VerifyRequest) (response VerifyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -413,11 +418,11 @@ func (client KmsCryptoClient) verify(ctx context.Context, request common.OCIRequ var response VerifyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsCrypto", "Verify") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/VerifiedData/Verify" err = common.PostProcessServiceError(err, "KmsCrypto", "Verify", apiReferenceLink) return response, err } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmshsmcluster_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmshsmcluster_client.go new file mode 100644 index 000000000..e870d96dd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmshsmcluster_client.go @@ -0,0 +1,829 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// KmsHsmClusterClient a client for KmsHsmCluster +type KmsHsmClusterClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewKmsHsmClusterClientWithConfigurationProvider Creates a new default KmsHsmCluster client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewKmsHsmClusterClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client KmsHsmClusterClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newKmsHsmClusterClientFromBaseClient(baseClient, provider) +} + +// NewKmsHsmClusterClientWithOboToken Creates a new default KmsHsmCluster client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewKmsHsmClusterClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client KmsHsmClusterClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newKmsHsmClusterClientFromBaseClient(baseClient, configProvider) +} + +func newKmsHsmClusterClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client KmsHsmClusterClient, err error) { + // KmsHsmCluster service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("KmsHsmCluster")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = KmsHsmClusterClient{BaseClient: baseClient} + client.BasePath = "" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *KmsHsmClusterClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("kms", "https://kms.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *KmsHsmClusterClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *KmsHsmClusterClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelHsmClusterDeletion Cancels deletion of specified HSM Cluster, restores it and associated HSM partitions to pre-deletion states. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelHsmClusterDeletion.go.html to see an example of how to use CancelHsmClusterDeletion API. +func (client KmsHsmClusterClient) CancelHsmClusterDeletion(ctx context.Context, request CancelHsmClusterDeletionRequest) (response CancelHsmClusterDeletionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.cancelHsmClusterDeletion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelHsmClusterDeletionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelHsmClusterDeletionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelHsmClusterDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelHsmClusterDeletionResponse") + } + return +} + +// cancelHsmClusterDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) cancelHsmClusterDeletion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/cancelDeletion", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelHsmClusterDeletionResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "CancelHsmClusterDeletion") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/CancelHsmClusterDeletion" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "CancelHsmClusterDeletion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeHsmClusterCompartment Moves a HSM Cluster resource to a different compartment within the same tenancy. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeHsmClusterCompartment.go.html to see an example of how to use ChangeHsmClusterCompartment API. +func (client KmsHsmClusterClient) ChangeHsmClusterCompartment(ctx context.Context, request ChangeHsmClusterCompartmentRequest) (response ChangeHsmClusterCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.changeHsmClusterCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeHsmClusterCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeHsmClusterCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeHsmClusterCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeHsmClusterCompartmentResponse") + } + return +} + +// changeHsmClusterCompartment implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) changeHsmClusterCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeHsmClusterCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "ChangeHsmClusterCompartment") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/ChangeHsmClusterCompartment" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ChangeHsmClusterCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateHsmCluster Creates a new HSM cluster resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateHsmCluster.go.html to see an example of how to use CreateHsmCluster API. +func (client KmsHsmClusterClient) CreateHsmCluster(ctx context.Context, request CreateHsmClusterRequest) (response CreateHsmClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateHsmClusterResponse") + } + return +} + +// createHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) createHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateHsmClusterResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "CreateHsmCluster") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/CreateHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "CreateHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DownloadCertificateSigningRequest Retrieves the certificate signing request for the designated HSM Cluster resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DownloadCertificateSigningRequest.go.html to see an example of how to use DownloadCertificateSigningRequest API. +func (client KmsHsmClusterClient) DownloadCertificateSigningRequest(ctx context.Context, request DownloadCertificateSigningRequestRequest) (response DownloadCertificateSigningRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.downloadCertificateSigningRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DownloadCertificateSigningRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DownloadCertificateSigningRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DownloadCertificateSigningRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DownloadCertificateSigningRequestResponse") + } + return +} + +// downloadCertificateSigningRequest implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) downloadCertificateSigningRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/downloadCertificateSigningRequest", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DownloadCertificateSigningRequestResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "DownloadCertificateSigningRequest") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/DownloadCertificateSigningRequest" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "DownloadCertificateSigningRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHsmCluster Retrieves configuration details for the specified HSM Cluster resource. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning read operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// read operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmCluster.go.html to see an example of how to use GetHsmCluster API. +func (client KmsHsmClusterClient) GetHsmCluster(ctx context.Context, request GetHsmClusterRequest) (response GetHsmClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHsmClusterResponse") + } + return +} + +// getHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetHsmClusterResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "GetHsmCluster") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/GetHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHsmPartition Retrieves HSM partition details for the specified HSM cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmPartition.go.html to see an example of how to use GetHsmPartition API. +func (client KmsHsmClusterClient) GetHsmPartition(ctx context.Context, request GetHsmPartitionRequest) (response GetHsmPartitionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.getHsmPartition, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetHsmPartitionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetHsmPartitionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetHsmPartitionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHsmPartitionResponse") + } + return +} + +// getHsmPartition implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getHsmPartition(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/hsmPartitions/{hsmPartitionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetHsmPartitionResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "GetHsmPartition") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmPartition/GetHsmPartition" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetHsmPartition", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPreCoUserCredentials Retrieves Pre Crypto Officer user credentials for the specified HSM cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetPreCoUserCredentials.go.html to see an example of how to use GetPreCoUserCredentials API. +func (client KmsHsmClusterClient) GetPreCoUserCredentials(ctx context.Context, request GetPreCoUserCredentialsRequest) (response GetPreCoUserCredentialsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.getPreCoUserCredentials, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPreCoUserCredentialsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPreCoUserCredentialsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPreCoUserCredentialsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPreCoUserCredentialsResponse") + } + return +} + +// getPreCoUserCredentials implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getPreCoUserCredentials(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/preCoUserCredentials", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPreCoUserCredentialsResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "GetPreCoUserCredentials") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/GetPreCoUserCredentials" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetPreCoUserCredentials", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHsmClusters Lists all HSM cluster resources contained within the specified compartment. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning read operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// read operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmClusters.go.html to see an example of how to use ListHsmClusters API. +func (client KmsHsmClusterClient) ListHsmClusters(ctx context.Context, request ListHsmClustersRequest) (response ListHsmClustersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHsmClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListHsmClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListHsmClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListHsmClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHsmClustersResponse") + } + return +} + +// listHsmClusters implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) listHsmClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListHsmClustersResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "ListHsmClusters") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/ListHsmClusters" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ListHsmClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHsmPartitions Lists all HSM partitions within the specified HSM Cluster resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmPartitions.go.html to see an example of how to use ListHsmPartitions API. +func (client KmsHsmClusterClient) ListHsmPartitions(ctx context.Context, request ListHsmPartitionsRequest) (response ListHsmPartitionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listHsmPartitions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListHsmPartitionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListHsmPartitionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListHsmPartitionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHsmPartitionsResponse") + } + return +} + +// listHsmPartitions implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) listHsmPartitions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/hsmPartitions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListHsmPartitionsResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "ListHsmPartitions") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmPartition/ListHsmPartitions" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ListHsmPartitions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ScheduleHsmClusterDeletion Schedules HSM cluster for deletion, update its lifecycle state to 'PENDING_DELETION' +// and deletes it after the retention period. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleHsmClusterDeletion.go.html to see an example of how to use ScheduleHsmClusterDeletion API. +func (client KmsHsmClusterClient) ScheduleHsmClusterDeletion(ctx context.Context, request ScheduleHsmClusterDeletionRequest) (response ScheduleHsmClusterDeletionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.scheduleHsmClusterDeletion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ScheduleHsmClusterDeletionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ScheduleHsmClusterDeletionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ScheduleHsmClusterDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ScheduleHsmClusterDeletionResponse") + } + return +} + +// scheduleHsmClusterDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) scheduleHsmClusterDeletion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/scheduleDeletion", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ScheduleHsmClusterDeletionResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "ScheduleHsmClusterDeletion") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/ScheduleHsmClusterDeletion" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ScheduleHsmClusterDeletion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateHsmCluster Modifies properties of an HSM cluster resource, including `displayName`, `freeformTags` and `definedTags`. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning write operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// write operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateHsmCluster.go.html to see an example of how to use UpdateHsmCluster API. +func (client KmsHsmClusterClient) UpdateHsmCluster(ctx context.Context, request UpdateHsmClusterRequest) (response UpdateHsmClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHsmClusterResponse") + } + return +} + +// updateHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) updateHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/20180608/hsmClusters/{hsmClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateHsmClusterResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "UpdateHsmCluster") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/UpdateHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "UpdateHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UploadPartitionCertificates Uploads the partition owner certificates to the HSM Cluster resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UploadPartitionCertificates.go.html to see an example of how to use UploadPartitionCertificates API. +func (client KmsHsmClusterClient) UploadPartitionCertificates(ctx context.Context, request UploadPartitionCertificatesRequest) (response UploadPartitionCertificatesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.uploadPartitionCertificates, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UploadPartitionCertificatesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UploadPartitionCertificatesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UploadPartitionCertificatesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadPartitionCertificatesResponse") + } + return +} + +// uploadPartitionCertificates implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) uploadPartitionCertificates(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/uploadPartitionCertificates", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UploadPartitionCertificatesResponse + var httpResponse *http.Response + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsHsmCluster", "UploadPartitionCertificates") + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/HsmCluster/UploadPartitionCertificates" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "UploadPartitionCertificates", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsmanagement_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsmanagement_client.go index eb20dad10..bf6bb80d5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsmanagement_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsmanagement_client.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -27,6 +26,9 @@ type KmsManagementClient struct { // NewKmsManagementClientWithConfigurationProvider Creates a new default KmsManagement client with the given configuration provider. // the configuration provider will be used for the default signer func NewKmsManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client KmsManagementClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -80,9 +82,9 @@ func (client *KmsManagementClient) ConfigurationProvider() *common.Configuration // BackupKey Backs up an encrypted file that contains all key versions and metadata of the specified key so that you can restore // the key later. The file also contains the metadata of the vault that the key belonged to. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupKey.go.html to see an example of how to use BackupKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupKey.go.html to see an example of how to use BackupKey API. func (client KmsManagementClient) BackupKey(ctx context.Context, request BackupKeyRequest) (response BackupKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -127,11 +129,11 @@ func (client KmsManagementClient) backupKey(ctx context.Context, request common. var response BackupKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "BackupKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/BackupKey" err = common.PostProcessServiceError(err, "KmsManagement", "BackupKey", apiReferenceLink) return response, err } @@ -148,9 +150,9 @@ func (client KmsManagementClient) backupKey(ctx context.Context, request common. // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyDeletion.go.html to see an example of how to use CancelKeyDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyDeletion.go.html to see an example of how to use CancelKeyDeletion API. func (client KmsManagementClient) CancelKeyDeletion(ctx context.Context, request CancelKeyDeletionRequest) (response CancelKeyDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -195,11 +197,11 @@ func (client KmsManagementClient) cancelKeyDeletion(ctx context.Context, request var response CancelKeyDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "CancelKeyDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/CancelKeyDeletion" err = common.PostProcessServiceError(err, "KmsManagement", "CancelKeyDeletion", apiReferenceLink) return response, err } @@ -216,9 +218,9 @@ func (client KmsManagementClient) cancelKeyDeletion(ctx context.Context, request // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyVersionDeletion.go.html to see an example of how to use CancelKeyVersionDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelKeyVersionDeletion.go.html to see an example of how to use CancelKeyVersionDeletion API. func (client KmsManagementClient) CancelKeyVersionDeletion(ctx context.Context, request CancelKeyVersionDeletionRequest) (response CancelKeyVersionDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -263,11 +265,11 @@ func (client KmsManagementClient) cancelKeyVersionDeletion(ctx context.Context, var response CancelKeyVersionDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "CancelKeyVersionDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersion/CancelKeyVersionDeletion" err = common.PostProcessServiceError(err, "KmsManagement", "CancelKeyVersionDeletion", apiReferenceLink) return response, err } @@ -277,16 +279,16 @@ func (client KmsManagementClient) cancelKeyVersionDeletion(ctx context.Context, } // ChangeKeyCompartment Moves a key into a different compartment within the same tenancy. For information about -// moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When provided, if-match is checked against the ETag values of the key. // As a provisioning operation, this call is subject to a Key Management limit that applies to // the total number of requests across all provisioning write operations. Key Management might // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeKeyCompartment.go.html to see an example of how to use ChangeKeyCompartment API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeKeyCompartment.go.html to see an example of how to use ChangeKeyCompartment API. func (client KmsManagementClient) ChangeKeyCompartment(ctx context.Context, request ChangeKeyCompartmentRequest) (response ChangeKeyCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -331,11 +333,11 @@ func (client KmsManagementClient) changeKeyCompartment(ctx context.Context, requ var response ChangeKeyCompartmentResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ChangeKeyCompartment") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/ChangeKeyCompartment" err = common.PostProcessServiceError(err, "KmsManagement", "ChangeKeyCompartment", apiReferenceLink) return response, err } @@ -350,9 +352,9 @@ func (client KmsManagementClient) changeKeyCompartment(ctx context.Context, requ // to reject an otherwise valid request when the total rate of management write operations exceeds 10 // requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKey.go.html to see an example of how to use CreateKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKey.go.html to see an example of how to use CreateKey API. func (client KmsManagementClient) CreateKey(ctx context.Context, request CreateKeyRequest) (response CreateKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -397,11 +399,11 @@ func (client KmsManagementClient) createKey(ctx context.Context, request common. var response CreateKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "CreateKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/CreateKey" err = common.PostProcessServiceError(err, "KmsManagement", "CreateKey", apiReferenceLink) return response, err } @@ -410,16 +412,16 @@ func (client KmsManagementClient) createKey(ctx context.Context, request common. return response, err } -// CreateKeyVersion Generates a new KeyVersion (https://docs.cloud.oracle.com/api/#/en/key/latest/KeyVersion/) resource that provides new cryptographic +// CreateKeyVersion Generates a new KeyVersion (https://docs.oracle.com/iaas/api/#/en/key/latest/KeyVersion/) resource that provides new cryptographic // material for a master encryption key. The key must be in an `ENABLED` state to be rotated. // As a management operation, this call is subject to a Key Management limit that applies to the total number // of requests across all management write operations. Key Management might throttle this call to reject an // otherwise valid request when the total rate of management write operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKeyVersion.go.html to see an example of how to use CreateKeyVersion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateKeyVersion.go.html to see an example of how to use CreateKeyVersion API. func (client KmsManagementClient) CreateKeyVersion(ctx context.Context, request CreateKeyVersionRequest) (response CreateKeyVersionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -464,11 +466,11 @@ func (client KmsManagementClient) createKeyVersion(ctx context.Context, request var response CreateKeyVersionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "CreateKeyVersion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersion/CreateKeyVersion" err = common.PostProcessServiceError(err, "KmsManagement", "CreateKeyVersion", apiReferenceLink) return response, err } @@ -484,9 +486,9 @@ func (client KmsManagementClient) createKeyVersion(ctx context.Context, request // otherwise valid request when the total rate of management write operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DisableKey.go.html to see an example of how to use DisableKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DisableKey.go.html to see an example of how to use DisableKey API. func (client KmsManagementClient) DisableKey(ctx context.Context, request DisableKeyRequest) (response DisableKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -531,11 +533,11 @@ func (client KmsManagementClient) disableKey(ctx context.Context, request common var response DisableKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "DisableKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/DisableKey" err = common.PostProcessServiceError(err, "KmsManagement", "DisableKey", apiReferenceLink) return response, err } @@ -551,9 +553,9 @@ func (client KmsManagementClient) disableKey(ctx context.Context, request common // otherwise valid request when the total rate of management write operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/EnableKey.go.html to see an example of how to use EnableKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/EnableKey.go.html to see an example of how to use EnableKey API. func (client KmsManagementClient) EnableKey(ctx context.Context, request EnableKeyRequest) (response EnableKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -598,11 +600,11 @@ func (client KmsManagementClient) enableKey(ctx context.Context, request common. var response EnableKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "EnableKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/EnableKey" err = common.PostProcessServiceError(err, "KmsManagement", "EnableKey", apiReferenceLink) return response, err } @@ -617,9 +619,9 @@ func (client KmsManagementClient) enableKey(ctx context.Context, request common. // otherwise valid request when the total rate of management read operations exceeds 10 requests per second for // a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKey.go.html to see an example of how to use GetKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKey.go.html to see an example of how to use GetKey API. func (client KmsManagementClient) GetKey(ctx context.Context, request GetKeyRequest) (response GetKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -659,11 +661,11 @@ func (client KmsManagementClient) getKey(ctx context.Context, request common.OCI var response GetKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "GetKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/GetKey" err = common.PostProcessServiceError(err, "KmsManagement", "GetKey", apiReferenceLink) return response, err } @@ -678,9 +680,9 @@ func (client KmsManagementClient) getKey(ctx context.Context, request common.OCI // otherwise valid request when the total rate of management read operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKeyVersion.go.html to see an example of how to use GetKeyVersion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetKeyVersion.go.html to see an example of how to use GetKeyVersion API. func (client KmsManagementClient) GetKeyVersion(ctx context.Context, request GetKeyVersionRequest) (response GetKeyVersionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -720,11 +722,11 @@ func (client KmsManagementClient) getKeyVersion(ctx context.Context, request com var response GetKeyVersionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "GetKeyVersion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersion/GetKeyVersion" err = common.PostProcessServiceError(err, "KmsManagement", "GetKeyVersion", apiReferenceLink) return response, err } @@ -738,9 +740,9 @@ func (client KmsManagementClient) getKeyVersion(ctx context.Context, request com // details about whether the operation associated with the given replicationId has been // successfully applied across replicas. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetReplicationStatus.go.html to see an example of how to use GetReplicationStatus API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetReplicationStatus.go.html to see an example of how to use GetReplicationStatus API. func (client KmsManagementClient) GetReplicationStatus(ctx context.Context, request GetReplicationStatusRequest) (response GetReplicationStatusResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -780,11 +782,11 @@ func (client KmsManagementClient) getReplicationStatus(ctx context.Context, requ var response GetReplicationStatusResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "GetReplicationStatus") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/ReplicationStatusDetails/GetReplicationStatus" err = common.PostProcessServiceError(err, "KmsManagement", "GetReplicationStatus", apiReferenceLink) return response, err } @@ -796,9 +798,9 @@ func (client KmsManagementClient) getReplicationStatus(ctx context.Context, requ // GetWrappingKey Gets details about the public RSA wrapping key associated with the vault in the endpoint. Each vault has an RSA key-pair that wraps and // unwraps AES key material for import into Key Management. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetWrappingKey.go.html to see an example of how to use GetWrappingKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetWrappingKey.go.html to see an example of how to use GetWrappingKey API. func (client KmsManagementClient) GetWrappingKey(ctx context.Context, request GetWrappingKeyRequest) (response GetWrappingKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -838,11 +840,11 @@ func (client KmsManagementClient) getWrappingKey(ctx context.Context, request co var response GetWrappingKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "GetWrappingKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/WrappingKey/GetWrappingKey" err = common.PostProcessServiceError(err, "KmsManagement", "GetWrappingKey", apiReferenceLink) return response, err } @@ -851,13 +853,16 @@ func (client KmsManagementClient) getWrappingKey(ctx context.Context, request co return response, err } -// ImportKey Imports AES key material to create a new key with. The key material must be base64-encoded and -// wrapped by the vault's public RSA wrapping key before you can import it. Key Management supports AES symmetric keys -// that are exactly 16, 24, or 32 bytes. Furthermore, the key length must match what you specify at the time of import. +// ImportKey Imports AES and RSA keys to create a new key. The key material must be base64-encoded +// and wrapped by the vault's public RSA wrapping key before you can import it. +// Key Management supports both RSA and AES keys. The AES keys are symmetric keys +// of length 128 bits (16 bytes), 192 bits (24 bytes), or 256 bits (32 bytes), and the RSA keys are asymmetric keys of length 2048 bits (256 bytes), 3072 bits (384 bytes), and 4096 bits (512 bytes). +// Furthermore, the key length must match what you specify at the time of import. When importing an asymmetric key, +// only private key must be wrapped in PKCS8 format while the corresponding public key is generated internally by KMS. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKey.go.html to see an example of how to use ImportKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKey.go.html to see an example of how to use ImportKey API. func (client KmsManagementClient) ImportKey(ctx context.Context, request ImportKeyRequest) (response ImportKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -902,11 +907,11 @@ func (client KmsManagementClient) importKey(ctx context.Context, request common. var response ImportKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ImportKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/ImportKey" err = common.PostProcessServiceError(err, "KmsManagement", "ImportKey", apiReferenceLink) return response, err } @@ -915,15 +920,16 @@ func (client KmsManagementClient) importKey(ctx context.Context, request common. return response, err } -// ImportKeyVersion Imports AES key material to create a new key version with, and then rotates the key to begin using the new +// ImportKeyVersion Imports AES key material to create a new key version and then rotate the key to begin using the new // key version. The key material must be base64-encoded and wrapped by the vault's public RSA wrapping key // before you can import it. Key Management supports AES symmetric keys that are exactly 16, 24, or 32 bytes. // Furthermore, the key length must match the length of the specified key and what you specify as the length -// at the time of import. +// at the time of import. When importing an asymmetric key, only the private key must be wrapped in PKCS8 format +// while the corresponding public key is generated internally by KMS. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKeyVersion.go.html to see an example of how to use ImportKeyVersion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ImportKeyVersion.go.html to see an example of how to use ImportKeyVersion API. func (client KmsManagementClient) ImportKeyVersion(ctx context.Context, request ImportKeyVersionRequest) (response ImportKeyVersionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -968,11 +974,11 @@ func (client KmsManagementClient) importKeyVersion(ctx context.Context, request var response ImportKeyVersionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ImportKeyVersion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersion/ImportKeyVersion" err = common.PostProcessServiceError(err, "KmsManagement", "ImportKeyVersion", apiReferenceLink) return response, err } @@ -981,16 +987,16 @@ func (client KmsManagementClient) importKeyVersion(ctx context.Context, request return response, err } -// ListKeyVersions Lists all KeyVersion (https://docs.cloud.oracle.com/api/#/en/key/latest/KeyVersion/) resources for the specified +// ListKeyVersions Lists all KeyVersion (https://docs.oracle.com/iaas/api/#/en/key/latest/KeyVersion/) resources for the specified // master encryption key. // As a management operation, this call is subject to a Key Management limit that applies to the total number // of requests across all management read operations. Key Management might throttle this call to reject an // otherwise valid request when the total rate of management read operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeyVersions.go.html to see an example of how to use ListKeyVersions API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeyVersions.go.html to see an example of how to use ListKeyVersions API. func (client KmsManagementClient) ListKeyVersions(ctx context.Context, request ListKeyVersionsRequest) (response ListKeyVersionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1030,11 +1036,11 @@ func (client KmsManagementClient) listKeyVersions(ctx context.Context, request c var response ListKeyVersionsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ListKeyVersions") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersionSummary/ListKeyVersions" err = common.PostProcessServiceError(err, "KmsManagement", "ListKeyVersions", apiReferenceLink) return response, err } @@ -1049,9 +1055,9 @@ func (client KmsManagementClient) listKeyVersions(ctx context.Context, request c // otherwise valid request when the total rate of management read operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeys.go.html to see an example of how to use ListKeys API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeys.go.html to see an example of how to use ListKeys API. func (client KmsManagementClient) ListKeys(ctx context.Context, request ListKeysRequest) (response ListKeysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1091,11 +1097,11 @@ func (client KmsManagementClient) listKeys(ctx context.Context, request common.O var response ListKeysResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ListKeys") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeySummary/ListKeys" err = common.PostProcessServiceError(err, "KmsManagement", "ListKeys", apiReferenceLink) return response, err } @@ -1108,9 +1114,9 @@ func (client KmsManagementClient) listKeys(ctx context.Context, request common.O // If the vault doesn't exist, the operation returns a response with a 404 HTTP status error code. You // need to first restore the vault associated with the key. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromFile.go.html to see an example of how to use RestoreKeyFromFile API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromFile.go.html to see an example of how to use RestoreKeyFromFile API. func (client KmsManagementClient) RestoreKeyFromFile(ctx context.Context, request RestoreKeyFromFileRequest) (response RestoreKeyFromFileResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1155,11 +1161,11 @@ func (client KmsManagementClient) restoreKeyFromFile(ctx context.Context, reques var response RestoreKeyFromFileResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "RestoreKeyFromFile") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/RestoreKeyFromFile" err = common.PostProcessServiceError(err, "KmsManagement", "RestoreKeyFromFile", apiReferenceLink) return response, err } @@ -1172,9 +1178,9 @@ func (client KmsManagementClient) restoreKeyFromFile(ctx context.Context, reques // Object Storage location. If the vault doesn't exist, the operation returns a response with a // 404 HTTP status error code. You need to first restore the vault associated with the key. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromObjectStore.go.html to see an example of how to use RestoreKeyFromObjectStore API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromObjectStore.go.html to see an example of how to use RestoreKeyFromObjectStore API. func (client KmsManagementClient) RestoreKeyFromObjectStore(ctx context.Context, request RestoreKeyFromObjectStoreRequest) (response RestoreKeyFromObjectStoreResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1219,11 +1225,11 @@ func (client KmsManagementClient) restoreKeyFromObjectStore(ctx context.Context, var response RestoreKeyFromObjectStoreResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "RestoreKeyFromObjectStore") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/RestoreKeyFromObjectStore" err = common.PostProcessServiceError(err, "KmsManagement", "RestoreKeyFromObjectStore", apiReferenceLink) return response, err } @@ -1239,9 +1245,9 @@ func (client KmsManagementClient) restoreKeyFromObjectStore(ctx context.Context, // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyDeletion.go.html to see an example of how to use ScheduleKeyDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyDeletion.go.html to see an example of how to use ScheduleKeyDeletion API. func (client KmsManagementClient) ScheduleKeyDeletion(ctx context.Context, request ScheduleKeyDeletionRequest) (response ScheduleKeyDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1286,11 +1292,11 @@ func (client KmsManagementClient) scheduleKeyDeletion(ctx context.Context, reque var response ScheduleKeyDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ScheduleKeyDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/ScheduleKeyDeletion" err = common.PostProcessServiceError(err, "KmsManagement", "ScheduleKeyDeletion", apiReferenceLink) return response, err } @@ -1306,9 +1312,9 @@ func (client KmsManagementClient) scheduleKeyDeletion(ctx context.Context, reque // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyVersionDeletion.go.html to see an example of how to use ScheduleKeyVersionDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyVersionDeletion.go.html to see an example of how to use ScheduleKeyVersionDeletion API. func (client KmsManagementClient) ScheduleKeyVersionDeletion(ctx context.Context, request ScheduleKeyVersionDeletionRequest) (response ScheduleKeyVersionDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1353,11 +1359,11 @@ func (client KmsManagementClient) scheduleKeyVersionDeletion(ctx context.Context var response ScheduleKeyVersionDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "ScheduleKeyVersionDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/KeyVersion/ScheduleKeyVersionDeletion" err = common.PostProcessServiceError(err, "KmsManagement", "ScheduleKeyVersionDeletion", apiReferenceLink) return response, err } @@ -1374,9 +1380,9 @@ func (client KmsManagementClient) scheduleKeyVersionDeletion(ctx context.Context // otherwise valid request when the total rate of management write operations exceeds 10 requests per second // for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateKey.go.html to see an example of how to use UpdateKey API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateKey.go.html to see an example of how to use UpdateKey API. func (client KmsManagementClient) UpdateKey(ctx context.Context, request UpdateKeyRequest) (response UpdateKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -1416,11 +1422,11 @@ func (client KmsManagementClient) updateKey(ctx context.Context, request common. var response UpdateKeyResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsManagement", "UpdateKey") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Key/UpdateKey" err = common.PostProcessServiceError(err, "KmsManagement", "UpdateKey", apiReferenceLink) return response, err } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsvault_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsvault_client.go index adf530a8e..91eb5f3f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsvault_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/keymanagement_kmsvault_client.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -27,6 +26,9 @@ type KmsVaultClient struct { // NewKmsVaultClientWithConfigurationProvider Creates a new default KmsVault client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewKmsVaultClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client KmsVaultClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } provider, err := auth.GetGenericConfigurationProvider(configProvider) if err != nil { return client, err @@ -78,7 +80,7 @@ func (client *KmsVaultClient) setConfigurationProvider(configProvider common.Con region, _ := configProvider.Region() client.SetRegion(region) if client.Host == "" { - return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") } client.config = &configProvider return nil @@ -93,9 +95,9 @@ func (client *KmsVaultClient) ConfigurationProvider() *common.ConfigurationProvi // You can backup a vault whether or not it contains keys. This operation only backs up the // metadata of the vault, and does not include key metadata. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupVault.go.html to see an example of how to use BackupVault API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/BackupVault.go.html to see an example of how to use BackupVault API. func (client KmsVaultClient) BackupVault(ctx context.Context, request BackupVaultRequest) (response BackupVaultResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -140,11 +142,11 @@ func (client KmsVaultClient) backupVault(ctx context.Context, request common.OCI var response BackupVaultResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "BackupVault") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/BackupVault" err = common.PostProcessServiceError(err, "KmsVault", "BackupVault", apiReferenceLink) return response, err } @@ -162,9 +164,9 @@ func (client KmsVaultClient) backupVault(ctx context.Context, request common.OCI // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelVaultDeletion.go.html to see an example of how to use CancelVaultDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelVaultDeletion.go.html to see an example of how to use CancelVaultDeletion API. func (client KmsVaultClient) CancelVaultDeletion(ctx context.Context, request CancelVaultDeletionRequest) (response CancelVaultDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -209,11 +211,11 @@ func (client KmsVaultClient) cancelVaultDeletion(ctx context.Context, request co var response CancelVaultDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "CancelVaultDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/CancelVaultDeletion" err = common.PostProcessServiceError(err, "KmsVault", "CancelVaultDeletion", apiReferenceLink) return response, err } @@ -223,16 +225,16 @@ func (client KmsVaultClient) cancelVaultDeletion(ctx context.Context, request co } // ChangeVaultCompartment Moves a vault into a different compartment within the same tenancy. For information about -// moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When provided, if-match is checked against the ETag values of the resource. // As a provisioning operation, this call is subject to a Key Management limit that applies to // the total number of requests across all provisioning write operations. Key Management might // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeVaultCompartment.go.html to see an example of how to use ChangeVaultCompartment API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeVaultCompartment.go.html to see an example of how to use ChangeVaultCompartment API. func (client KmsVaultClient) ChangeVaultCompartment(ctx context.Context, request ChangeVaultCompartmentRequest) (response ChangeVaultCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -277,11 +279,11 @@ func (client KmsVaultClient) changeVaultCompartment(ctx context.Context, request var response ChangeVaultCompartmentResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "ChangeVaultCompartment") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/ChangeVaultCompartment" err = common.PostProcessServiceError(err, "KmsVault", "ChangeVaultCompartment", apiReferenceLink) return response, err } @@ -299,9 +301,9 @@ func (client KmsVaultClient) changeVaultCompartment(ctx context.Context, request // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVault.go.html to see an example of how to use CreateVault API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVault.go.html to see an example of how to use CreateVault API. func (client KmsVaultClient) CreateVault(ctx context.Context, request CreateVaultRequest) (response CreateVaultResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -346,11 +348,11 @@ func (client KmsVaultClient) createVault(ctx context.Context, request common.OCI var response CreateVaultResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "CreateVault") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/CreateVault" err = common.PostProcessServiceError(err, "KmsVault", "CreateVault", apiReferenceLink) return response, err } @@ -368,9 +370,9 @@ func (client KmsVaultClient) createVault(ctx context.Context, request common.OCI // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVaultReplica.go.html to see an example of how to use CreateVaultReplica API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateVaultReplica.go.html to see an example of how to use CreateVaultReplica API. func (client KmsVaultClient) CreateVaultReplica(ctx context.Context, request CreateVaultReplicaRequest) (response CreateVaultReplicaResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -415,11 +417,11 @@ func (client KmsVaultClient) createVaultReplica(ctx context.Context, request com var response CreateVaultReplicaResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "CreateVaultReplica") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/CreateVaultReplica" err = common.PostProcessServiceError(err, "KmsVault", "CreateVaultReplica", apiReferenceLink) return response, err } @@ -434,9 +436,9 @@ func (client KmsVaultClient) createVaultReplica(ctx context.Context, request com // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteVaultReplica.go.html to see an example of how to use DeleteVaultReplica API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DeleteVaultReplica.go.html to see an example of how to use DeleteVaultReplica API. func (client KmsVaultClient) DeleteVaultReplica(ctx context.Context, request DeleteVaultReplicaRequest) (response DeleteVaultReplicaResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -481,11 +483,11 @@ func (client KmsVaultClient) deleteVaultReplica(ctx context.Context, request com var response DeleteVaultReplicaResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "DeleteVaultReplica") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/DeleteVaultReplica" err = common.PostProcessServiceError(err, "KmsVault", "DeleteVaultReplica", apiReferenceLink) return response, err } @@ -500,9 +502,9 @@ func (client KmsVaultClient) deleteVaultReplica(ctx context.Context, request com // throttle this call to reject an otherwise valid request when the total rate of provisioning // read operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVault.go.html to see an example of how to use GetVault API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVault.go.html to see an example of how to use GetVault API. func (client KmsVaultClient) GetVault(ctx context.Context, request GetVaultRequest) (response GetVaultResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -542,11 +544,11 @@ func (client KmsVaultClient) getVault(ctx context.Context, request common.OCIReq var response GetVaultResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "GetVault") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/GetVault" err = common.PostProcessServiceError(err, "KmsVault", "GetVault", apiReferenceLink) return response, err } @@ -557,9 +559,9 @@ func (client KmsVaultClient) getVault(ctx context.Context, request common.OCIReq // GetVaultUsage Gets the count of keys and key versions in the specified vault to calculate usage against service limits. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVaultUsage.go.html to see an example of how to use GetVaultUsage API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetVaultUsage.go.html to see an example of how to use GetVaultUsage API. func (client KmsVaultClient) GetVaultUsage(ctx context.Context, request GetVaultUsageRequest) (response GetVaultUsageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -599,11 +601,11 @@ func (client KmsVaultClient) getVaultUsage(ctx context.Context, request common.O var response GetVaultUsageResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "GetVaultUsage") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/VaultUsage/GetVaultUsage" err = common.PostProcessServiceError(err, "KmsVault", "GetVaultUsage", apiReferenceLink) return response, err } @@ -618,9 +620,9 @@ func (client KmsVaultClient) getVaultUsage(ctx context.Context, request common.O // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaultReplicas.go.html to see an example of how to use ListVaultReplicas API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaultReplicas.go.html to see an example of how to use ListVaultReplicas API. func (client KmsVaultClient) ListVaultReplicas(ctx context.Context, request ListVaultReplicasRequest) (response ListVaultReplicasResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -665,11 +667,11 @@ func (client KmsVaultClient) listVaultReplicas(ctx context.Context, request comm var response ListVaultReplicasResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "ListVaultReplicas") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/ListVaultReplicas" err = common.PostProcessServiceError(err, "KmsVault", "ListVaultReplicas", apiReferenceLink) return response, err } @@ -684,9 +686,9 @@ func (client KmsVaultClient) listVaultReplicas(ctx context.Context, request comm // throttle this call to reject an otherwise valid request when the total rate of provisioning // read operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaults.go.html to see an example of how to use ListVaults API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaults.go.html to see an example of how to use ListVaults API. func (client KmsVaultClient) ListVaults(ctx context.Context, request ListVaultsRequest) (response ListVaultsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -726,11 +728,11 @@ func (client KmsVaultClient) listVaults(ctx context.Context, request common.OCIR var response ListVaultsResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "ListVaults") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/VaultSummary/ListVaults" err = common.PostProcessServiceError(err, "KmsVault", "ListVaults", apiReferenceLink) return response, err } @@ -743,9 +745,9 @@ func (client KmsVaultClient) listVaults(ctx context.Context, request common.OCIR // with the same OCID already exists, this operation returns a response with a // 409 HTTP status error code. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromFile.go.html to see an example of how to use RestoreVaultFromFile API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromFile.go.html to see an example of how to use RestoreVaultFromFile API. func (client KmsVaultClient) RestoreVaultFromFile(ctx context.Context, request RestoreVaultFromFileRequest) (response RestoreVaultFromFileResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -790,11 +792,11 @@ func (client KmsVaultClient) restoreVaultFromFile(ctx context.Context, request c var response RestoreVaultFromFileResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "RestoreVaultFromFile") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/RestoreVaultFromFile" err = common.PostProcessServiceError(err, "KmsVault", "RestoreVaultFromFile", apiReferenceLink) return response, err } @@ -807,9 +809,9 @@ func (client KmsVaultClient) restoreVaultFromFile(ctx context.Context, request c // Storage. If a vault with the same OCID already exists, this operation returns // a response with a 409 HTTP status error code. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromObjectStore.go.html to see an example of how to use RestoreVaultFromObjectStore API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromObjectStore.go.html to see an example of how to use RestoreVaultFromObjectStore API. func (client KmsVaultClient) RestoreVaultFromObjectStore(ctx context.Context, request RestoreVaultFromObjectStoreRequest) (response RestoreVaultFromObjectStoreResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -854,11 +856,11 @@ func (client KmsVaultClient) restoreVaultFromObjectStore(ctx context.Context, re var response RestoreVaultFromObjectStoreResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "RestoreVaultFromObjectStore") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/RestoreVaultFromObjectStore" err = common.PostProcessServiceError(err, "KmsVault", "RestoreVaultFromObjectStore", apiReferenceLink) return response, err } @@ -877,9 +879,9 @@ func (client KmsVaultClient) restoreVaultFromObjectStore(ctx context.Context, re // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleVaultDeletion.go.html to see an example of how to use ScheduleVaultDeletion API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleVaultDeletion.go.html to see an example of how to use ScheduleVaultDeletion API. func (client KmsVaultClient) ScheduleVaultDeletion(ctx context.Context, request ScheduleVaultDeletionRequest) (response ScheduleVaultDeletionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -924,11 +926,11 @@ func (client KmsVaultClient) scheduleVaultDeletion(ctx context.Context, request var response ScheduleVaultDeletionResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "ScheduleVaultDeletion") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/ScheduleVaultDeletion" err = common.PostProcessServiceError(err, "KmsVault", "ScheduleVaultDeletion", apiReferenceLink) return response, err } @@ -945,9 +947,9 @@ func (client KmsVaultClient) scheduleVaultDeletion(ctx context.Context, request // throttle this call to reject an otherwise valid request when the total rate of provisioning // write operations exceeds 10 requests per second for a given tenancy. // -// See also +// # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateVault.go.html to see an example of how to use UpdateVault API. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateVault.go.html to see an example of how to use UpdateVault API. func (client KmsVaultClient) UpdateVault(ctx context.Context, request UpdateVaultRequest) (response UpdateVaultResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() @@ -987,11 +989,11 @@ func (client KmsVaultClient) updateVault(ctx context.Context, request common.OCI var response UpdateVaultResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + httpResponse, err = client.CallWithServiceAndOperationName(ctx, &httpRequest, "kmsVault", "UpdateVault") defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/key/release/Vault/UpdateVault" err = common.PostProcessServiceError(err, "KmsVault", "UpdateVault", apiReferenceLink) return response, err } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_ekms_private_endpoints_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_ekms_private_endpoints_request_response.go new file mode 100644 index 000000000..003001f77 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_ekms_private_endpoints_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListEkmsPrivateEndpointsRequest wrapper for the ListEkmsPrivateEndpoints operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListEkmsPrivateEndpoints.go.html to see an example of how to use ListEkmsPrivateEndpointsRequest. +type ListEkmsPrivateEndpointsRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListEkmsPrivateEndpointsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can specify only one sort order. The default + // order for `TIMECREATED` is descending. The default order for `DISPLAYNAME` + // is ascending. + SortBy ListEkmsPrivateEndpointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListEkmsPrivateEndpointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListEkmsPrivateEndpointsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListEkmsPrivateEndpointsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListEkmsPrivateEndpointsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListEkmsPrivateEndpointsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListEkmsPrivateEndpointsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListEkmsPrivateEndpointsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListEkmsPrivateEndpointsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListEkmsPrivateEndpointsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListEkmsPrivateEndpointsResponse wrapper for the ListEkmsPrivateEndpoints operation +type ListEkmsPrivateEndpointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []EkmsPrivateEndpointSummary instances + Items []EkmsPrivateEndpointSummary `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListEkmsPrivateEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListEkmsPrivateEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListEkmsPrivateEndpointsSortOrderEnum Enum with underlying type: string +type ListEkmsPrivateEndpointsSortOrderEnum string + +// Set of constants representing the allowable values for ListEkmsPrivateEndpointsSortOrderEnum +const ( + ListEkmsPrivateEndpointsSortOrderAsc ListEkmsPrivateEndpointsSortOrderEnum = "ASC" + ListEkmsPrivateEndpointsSortOrderDesc ListEkmsPrivateEndpointsSortOrderEnum = "DESC" +) + +var mappingListEkmsPrivateEndpointsSortOrderEnum = map[string]ListEkmsPrivateEndpointsSortOrderEnum{ + "ASC": ListEkmsPrivateEndpointsSortOrderAsc, + "DESC": ListEkmsPrivateEndpointsSortOrderDesc, +} + +var mappingListEkmsPrivateEndpointsSortOrderEnumLowerCase = map[string]ListEkmsPrivateEndpointsSortOrderEnum{ + "asc": ListEkmsPrivateEndpointsSortOrderAsc, + "desc": ListEkmsPrivateEndpointsSortOrderDesc, +} + +// GetListEkmsPrivateEndpointsSortOrderEnumValues Enumerates the set of values for ListEkmsPrivateEndpointsSortOrderEnum +func GetListEkmsPrivateEndpointsSortOrderEnumValues() []ListEkmsPrivateEndpointsSortOrderEnum { + values := make([]ListEkmsPrivateEndpointsSortOrderEnum, 0) + for _, v := range mappingListEkmsPrivateEndpointsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListEkmsPrivateEndpointsSortOrderEnumStringValues Enumerates the set of values in String for ListEkmsPrivateEndpointsSortOrderEnum +func GetListEkmsPrivateEndpointsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListEkmsPrivateEndpointsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEkmsPrivateEndpointsSortOrderEnum(val string) (ListEkmsPrivateEndpointsSortOrderEnum, bool) { + enum, ok := mappingListEkmsPrivateEndpointsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListEkmsPrivateEndpointsSortByEnum Enum with underlying type: string +type ListEkmsPrivateEndpointsSortByEnum string + +// Set of constants representing the allowable values for ListEkmsPrivateEndpointsSortByEnum +const ( + ListEkmsPrivateEndpointsSortByTimecreated ListEkmsPrivateEndpointsSortByEnum = "TIMECREATED" + ListEkmsPrivateEndpointsSortByDisplayname ListEkmsPrivateEndpointsSortByEnum = "DISPLAYNAME" +) + +var mappingListEkmsPrivateEndpointsSortByEnum = map[string]ListEkmsPrivateEndpointsSortByEnum{ + "TIMECREATED": ListEkmsPrivateEndpointsSortByTimecreated, + "DISPLAYNAME": ListEkmsPrivateEndpointsSortByDisplayname, +} + +var mappingListEkmsPrivateEndpointsSortByEnumLowerCase = map[string]ListEkmsPrivateEndpointsSortByEnum{ + "timecreated": ListEkmsPrivateEndpointsSortByTimecreated, + "displayname": ListEkmsPrivateEndpointsSortByDisplayname, +} + +// GetListEkmsPrivateEndpointsSortByEnumValues Enumerates the set of values for ListEkmsPrivateEndpointsSortByEnum +func GetListEkmsPrivateEndpointsSortByEnumValues() []ListEkmsPrivateEndpointsSortByEnum { + values := make([]ListEkmsPrivateEndpointsSortByEnum, 0) + for _, v := range mappingListEkmsPrivateEndpointsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListEkmsPrivateEndpointsSortByEnumStringValues Enumerates the set of values in String for ListEkmsPrivateEndpointsSortByEnum +func GetListEkmsPrivateEndpointsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListEkmsPrivateEndpointsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEkmsPrivateEndpointsSortByEnum(val string) (ListEkmsPrivateEndpointsSortByEnum, bool) { + enum, ok := mappingListEkmsPrivateEndpointsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_clusters_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_clusters_request_response.go new file mode 100644 index 000000000..23036c668 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_clusters_request_response.go @@ -0,0 +1,203 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListHsmClustersRequest wrapper for the ListHsmClusters operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmClusters.go.html to see an example of how to use ListHsmClustersRequest. +type ListHsmClustersRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `TIMECREATED` is descending. The default order for `DISPLAYNAME` + // is ascending. + SortBy ListHsmClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListHsmClustersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHsmClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHsmClustersRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListHsmClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHsmClustersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListHsmClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListHsmClustersSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListHsmClustersSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListHsmClustersSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListHsmClustersSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListHsmClustersResponse wrapper for the ListHsmClusters operation +type ListHsmClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of HsmClusterCollection instances + HsmClusterCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListHsmClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHsmClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHsmClustersSortByEnum Enum with underlying type: string +type ListHsmClustersSortByEnum string + +// Set of constants representing the allowable values for ListHsmClustersSortByEnum +const ( + ListHsmClustersSortByTimecreated ListHsmClustersSortByEnum = "TIMECREATED" + ListHsmClustersSortByDisplayname ListHsmClustersSortByEnum = "DISPLAYNAME" +) + +var mappingListHsmClustersSortByEnum = map[string]ListHsmClustersSortByEnum{ + "TIMECREATED": ListHsmClustersSortByTimecreated, + "DISPLAYNAME": ListHsmClustersSortByDisplayname, +} + +var mappingListHsmClustersSortByEnumLowerCase = map[string]ListHsmClustersSortByEnum{ + "timecreated": ListHsmClustersSortByTimecreated, + "displayname": ListHsmClustersSortByDisplayname, +} + +// GetListHsmClustersSortByEnumValues Enumerates the set of values for ListHsmClustersSortByEnum +func GetListHsmClustersSortByEnumValues() []ListHsmClustersSortByEnum { + values := make([]ListHsmClustersSortByEnum, 0) + for _, v := range mappingListHsmClustersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListHsmClustersSortByEnumStringValues Enumerates the set of values in String for ListHsmClustersSortByEnum +func GetListHsmClustersSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListHsmClustersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmClustersSortByEnum(val string) (ListHsmClustersSortByEnum, bool) { + enum, ok := mappingListHsmClustersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListHsmClustersSortOrderEnum Enum with underlying type: string +type ListHsmClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListHsmClustersSortOrderEnum +const ( + ListHsmClustersSortOrderAsc ListHsmClustersSortOrderEnum = "ASC" + ListHsmClustersSortOrderDesc ListHsmClustersSortOrderEnum = "DESC" +) + +var mappingListHsmClustersSortOrderEnum = map[string]ListHsmClustersSortOrderEnum{ + "ASC": ListHsmClustersSortOrderAsc, + "DESC": ListHsmClustersSortOrderDesc, +} + +var mappingListHsmClustersSortOrderEnumLowerCase = map[string]ListHsmClustersSortOrderEnum{ + "asc": ListHsmClustersSortOrderAsc, + "desc": ListHsmClustersSortOrderDesc, +} + +// GetListHsmClustersSortOrderEnumValues Enumerates the set of values for ListHsmClustersSortOrderEnum +func GetListHsmClustersSortOrderEnumValues() []ListHsmClustersSortOrderEnum { + values := make([]ListHsmClustersSortOrderEnum, 0) + for _, v := range mappingListHsmClustersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListHsmClustersSortOrderEnumStringValues Enumerates the set of values in String for ListHsmClustersSortOrderEnum +func GetListHsmClustersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListHsmClustersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmClustersSortOrderEnum(val string) (ListHsmClustersSortOrderEnum, bool) { + enum, ok := mappingListHsmClustersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_partitions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_partitions_request_response.go new file mode 100644 index 000000000..980ce5395 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_hsm_partitions_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListHsmPartitionsRequest wrapper for the ListHsmPartitions operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmPartitions.go.html to see an example of how to use ListHsmPartitionsRequest. +type ListHsmPartitionsRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header + // from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `TIMECREATED` is descending. The default order for `DISPLAYNAME` + // is ascending. + SortBy ListHsmPartitionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListHsmPartitionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter that returns only resources that match the specified lifecycle state. The state value is case-insensitive. + LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListHsmPartitionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHsmPartitionsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListHsmPartitionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHsmPartitionsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListHsmPartitionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListHsmPartitionsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListHsmPartitionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListHsmPartitionsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListHsmPartitionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListHsmPartitionsResponse wrapper for the ListHsmPartitions operation +type ListHsmPartitionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of HsmPartitionCollection instances + HsmPartitionCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListHsmPartitionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHsmPartitionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHsmPartitionsSortByEnum Enum with underlying type: string +type ListHsmPartitionsSortByEnum string + +// Set of constants representing the allowable values for ListHsmPartitionsSortByEnum +const ( + ListHsmPartitionsSortByTimecreated ListHsmPartitionsSortByEnum = "TIMECREATED" + ListHsmPartitionsSortByDisplayname ListHsmPartitionsSortByEnum = "DISPLAYNAME" +) + +var mappingListHsmPartitionsSortByEnum = map[string]ListHsmPartitionsSortByEnum{ + "TIMECREATED": ListHsmPartitionsSortByTimecreated, + "DISPLAYNAME": ListHsmPartitionsSortByDisplayname, +} + +var mappingListHsmPartitionsSortByEnumLowerCase = map[string]ListHsmPartitionsSortByEnum{ + "timecreated": ListHsmPartitionsSortByTimecreated, + "displayname": ListHsmPartitionsSortByDisplayname, +} + +// GetListHsmPartitionsSortByEnumValues Enumerates the set of values for ListHsmPartitionsSortByEnum +func GetListHsmPartitionsSortByEnumValues() []ListHsmPartitionsSortByEnum { + values := make([]ListHsmPartitionsSortByEnum, 0) + for _, v := range mappingListHsmPartitionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListHsmPartitionsSortByEnumStringValues Enumerates the set of values in String for ListHsmPartitionsSortByEnum +func GetListHsmPartitionsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListHsmPartitionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmPartitionsSortByEnum(val string) (ListHsmPartitionsSortByEnum, bool) { + enum, ok := mappingListHsmPartitionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListHsmPartitionsSortOrderEnum Enum with underlying type: string +type ListHsmPartitionsSortOrderEnum string + +// Set of constants representing the allowable values for ListHsmPartitionsSortOrderEnum +const ( + ListHsmPartitionsSortOrderAsc ListHsmPartitionsSortOrderEnum = "ASC" + ListHsmPartitionsSortOrderDesc ListHsmPartitionsSortOrderEnum = "DESC" +) + +var mappingListHsmPartitionsSortOrderEnum = map[string]ListHsmPartitionsSortOrderEnum{ + "ASC": ListHsmPartitionsSortOrderAsc, + "DESC": ListHsmPartitionsSortOrderDesc, +} + +var mappingListHsmPartitionsSortOrderEnumLowerCase = map[string]ListHsmPartitionsSortOrderEnum{ + "asc": ListHsmPartitionsSortOrderAsc, + "desc": ListHsmPartitionsSortOrderDesc, +} + +// GetListHsmPartitionsSortOrderEnumValues Enumerates the set of values for ListHsmPartitionsSortOrderEnum +func GetListHsmPartitionsSortOrderEnumValues() []ListHsmPartitionsSortOrderEnum { + values := make([]ListHsmPartitionsSortOrderEnum, 0) + for _, v := range mappingListHsmPartitionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListHsmPartitionsSortOrderEnumStringValues Enumerates the set of values in String for ListHsmPartitionsSortOrderEnum +func GetListHsmPartitionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListHsmPartitionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmPartitionsSortOrderEnum(val string) (ListHsmPartitionsSortOrderEnum, bool) { + enum, ok := mappingListHsmPartitionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_key_versions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_key_versions_request_response.go index 513371e05..c31d34f59 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_key_versions_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_key_versions_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeyVersions.go.html to see an example of how to use ListKeyVersionsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeyVersions.go.html to see an example of how to use ListKeyVersionsRequest. type ListKeyVersionsRequest struct { // The OCID of the key. @@ -84,7 +84,7 @@ func (request ListKeyVersionsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListKeyVersionsSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -101,7 +101,7 @@ type ListKeyVersionsResponse struct { // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_keys_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_keys_request_response.go index 8aa8e8f46..dad1e7a3a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_keys_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_keys_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeys.go.html to see an example of how to use ListKeysRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListKeys.go.html to see an example of how to use ListKeysRequest. type ListKeysRequest struct { // The OCID of the compartment. @@ -46,6 +46,8 @@ type ListKeysRequest struct { // performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's // RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of // `SOFTWARE` are performed on the server. + // A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. + // Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. ProtectionMode ListKeysProtectionModeEnum `mandatory:"false" contributesTo:"query" name:"protectionMode" omitEmpty:"true"` // The algorithm used by a key's key versions to encrypt or decrypt data. Currently, support includes AES, RSA, and ECDSA algorithms. @@ -109,7 +111,7 @@ func (request ListKeysRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurveId: %s. Supported values are: %s.", request.CurveId, strings.Join(GetListKeysCurveIdEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -126,7 +128,7 @@ type ListKeysResponse struct { // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about @@ -234,16 +236,19 @@ type ListKeysProtectionModeEnum string const ( ListKeysProtectionModeHsm ListKeysProtectionModeEnum = "HSM" ListKeysProtectionModeSoftware ListKeysProtectionModeEnum = "SOFTWARE" + ListKeysProtectionModeExternal ListKeysProtectionModeEnum = "EXTERNAL" ) var mappingListKeysProtectionModeEnum = map[string]ListKeysProtectionModeEnum{ "HSM": ListKeysProtectionModeHsm, "SOFTWARE": ListKeysProtectionModeSoftware, + "EXTERNAL": ListKeysProtectionModeExternal, } var mappingListKeysProtectionModeEnumLowerCase = map[string]ListKeysProtectionModeEnum{ "hsm": ListKeysProtectionModeHsm, "software": ListKeysProtectionModeSoftware, + "external": ListKeysProtectionModeExternal, } // GetListKeysProtectionModeEnumValues Enumerates the set of values for ListKeysProtectionModeEnum @@ -260,6 +265,7 @@ func GetListKeysProtectionModeEnumStringValues() []string { return []string{ "HSM", "SOFTWARE", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vault_replicas_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vault_replicas_request_response.go index 4494e64fe..0c0e71ab5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vault_replicas_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vault_replicas_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaultReplicas.go.html to see an example of how to use ListVaultReplicasRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaultReplicas.go.html to see an example of how to use ListVaultReplicasRequest. type ListVaultReplicasRequest struct { // The OCID of the vault. @@ -99,7 +99,7 @@ func (request ListVaultReplicasRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListVaultReplicasSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -119,7 +119,7 @@ type ListVaultReplicasResponse struct { // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vaults_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vaults_request_response.go index 6b9390990..354e3cd37 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vaults_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/list_vaults_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaults.go.html to see an example of how to use ListVaultsRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListVaults.go.html to see an example of how to use ListVaultsRequest. type ListVaultsRequest struct { // The OCID of the compartment. @@ -84,7 +84,7 @@ func (request ListVaultsRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListVaultsSortOrderEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -101,7 +101,7 @@ type ListVaultsResponse struct { // For pagination of a list of items. When paging through a list, if this header appears in the response, // then there are additional items still to get. Include this value as the `page` parameter for the // subsequent GET request. For information about pagination, see - // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata.go new file mode 100644 index 000000000..f3a59c4ce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OauthMetadata Authorization details required to get access token from IDP for accessing protected resources. +type OauthMetadata struct { + + // Base URL of the IDCS account where confidential client app is created. + IdcsAccountNameUrl *string `mandatory:"true" json:"idcsAccountNameUrl"` + + // ID of the client app created in IDP. + ClientAppId *string `mandatory:"true" json:"clientAppId"` + + // Secret of the client app created in IDP. + ClientAppSecret *string `mandatory:"true" json:"clientAppSecret"` +} + +func (m OauthMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OauthMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata_summary.go new file mode 100644 index 000000000..c45577e0e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/oauth_metadata_summary.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OauthMetadataSummary Summary about authorization to be returned to the customer as a response. +type OauthMetadataSummary struct { + + // Base URL of the IDCS account where confidential client app is created. + IdcsAccountNameUrl *string `mandatory:"true" json:"idcsAccountNameUrl"` + + // ID of the client app created in IDP. + ClientAppId *string `mandatory:"true" json:"clientAppId"` +} + +func (m OauthMetadataSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OauthMetadataSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/port_information.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/port_information.go new file mode 100644 index 000000000..efe102380 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/port_information.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PortInformation Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (this refers to either an enum value of Management Utility, Client Utility, or null) +type PortInformation struct { + + // The port number is a unique identifier which is typically used as the loadbalancer listener. + PortNumber *int `mandatory:"true" json:"portNumber"` + + // Port type associated for the port number. The two port type enums are `CLIENTUTILITY` and `MANAGEMENTUTILITY`. The CLIENTUTILITY enum corresponds to a port which is used by the client daemon. The MANAGEMENTUTILITY enum corresponds to a port used by user management utility. + PortType PortInformationPortTypeEnum `mandatory:"true" json:"portType"` +} + +func (m PortInformation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PortInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPortInformationPortTypeEnum(string(m.PortType)); !ok && m.PortType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PortType: %s. Supported values are: %s.", m.PortType, strings.Join(GetPortInformationPortTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PortInformationPortTypeEnum Enum with underlying type: string +type PortInformationPortTypeEnum string + +// Set of constants representing the allowable values for PortInformationPortTypeEnum +const ( + PortInformationPortTypeClientutility PortInformationPortTypeEnum = "CLIENTUTILITY" + PortInformationPortTypeManagementutility PortInformationPortTypeEnum = "MANAGEMENTUTILITY" +) + +var mappingPortInformationPortTypeEnum = map[string]PortInformationPortTypeEnum{ + "CLIENTUTILITY": PortInformationPortTypeClientutility, + "MANAGEMENTUTILITY": PortInformationPortTypeManagementutility, +} + +var mappingPortInformationPortTypeEnumLowerCase = map[string]PortInformationPortTypeEnum{ + "clientutility": PortInformationPortTypeClientutility, + "managementutility": PortInformationPortTypeManagementutility, +} + +// GetPortInformationPortTypeEnumValues Enumerates the set of values for PortInformationPortTypeEnum +func GetPortInformationPortTypeEnumValues() []PortInformationPortTypeEnum { + values := make([]PortInformationPortTypeEnum, 0) + for _, v := range mappingPortInformationPortTypeEnum { + values = append(values, v) + } + return values +} + +// GetPortInformationPortTypeEnumStringValues Enumerates the set of values in String for PortInformationPortTypeEnum +func GetPortInformationPortTypeEnumStringValues() []string { + return []string{ + "CLIENTUTILITY", + "MANAGEMENTUTILITY", + } +} + +// GetMappingPortInformationPortTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPortInformationPortTypeEnum(val string) (PortInformationPortTypeEnum, bool) { + enum, ok := mappingPortInformationPortTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/pre_co_user_credentials.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/pre_co_user_credentials.go new file mode 100644 index 000000000..6ebd70cd3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/pre_co_user_credentials.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PreCoUserCredentials Pre Crypto officer user credentials. +type PreCoUserCredentials struct { + + // The pre crypto officer username, which should be chosen as a non confidential string. + Username *string `mandatory:"true" json:"username"` + + // The base 64 encoded pre crypto officer password. + Password *string `mandatory:"true" json:"password"` +} + +func (m PreCoUserCredentials) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PreCoUserCredentials) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_details.go index d5dd4a057..c9b45d2b7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -40,7 +39,7 @@ func (m ReplicaDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetReplicaDetailsStatusEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_external_vault_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_external_vault_metadata.go new file mode 100644 index 000000000..e45385557 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_external_vault_metadata.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicaExternalVaultMetadata Metadata of the replica region External Vault +type ReplicaExternalVaultMetadata struct { + + // OCID of the EKMS private endpoint in the replica region and must be in ACTIVE state + PrivateEndpointId *string `mandatory:"true" json:"privateEndpointId"` + + // Replica region URL of the IDCS domain + IdcsAccountNameUrl *string `mandatory:"true" json:"idcsAccountNameUrl"` +} + +func (m ReplicaExternalVaultMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ReplicaExternalVaultMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ReplicaExternalVaultMetadata) MarshalJSON() (buff []byte, e error) { + type MarshalTypeReplicaExternalVaultMetadata ReplicaExternalVaultMetadata + s := struct { + DiscriminatorParam string `json:"vaultType"` + MarshalTypeReplicaExternalVaultMetadata + }{ + "EXTERNAL", + (MarshalTypeReplicaExternalVaultMetadata)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_vault_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_vault_metadata.go new file mode 100644 index 000000000..dd42927f5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replica_vault_metadata.go @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicaVaultMetadata Metadata for the replica vault, needed if different from primary vault +type ReplicaVaultMetadata interface { +} + +type replicavaultmetadata struct { + JsonData []byte + VaultType string `json:"vaultType"` +} + +// UnmarshalJSON unmarshals json +func (m *replicavaultmetadata) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerreplicavaultmetadata replicavaultmetadata + s := struct { + Model Unmarshalerreplicavaultmetadata + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.VaultType = s.Model.VaultType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *replicavaultmetadata) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.VaultType { + case "EXTERNAL": + mm := ReplicaExternalVaultMetadata{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for ReplicaVaultMetadata: %s.", m.VaultType) + return *m, nil + } +} + +func (m replicavaultmetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m replicavaultmetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReplicaVaultMetadataVaultTypeEnum Enum with underlying type: string +type ReplicaVaultMetadataVaultTypeEnum string + +// Set of constants representing the allowable values for ReplicaVaultMetadataVaultTypeEnum +const ( + ReplicaVaultMetadataVaultTypeExternal ReplicaVaultMetadataVaultTypeEnum = "EXTERNAL" +) + +var mappingReplicaVaultMetadataVaultTypeEnum = map[string]ReplicaVaultMetadataVaultTypeEnum{ + "EXTERNAL": ReplicaVaultMetadataVaultTypeExternal, +} + +var mappingReplicaVaultMetadataVaultTypeEnumLowerCase = map[string]ReplicaVaultMetadataVaultTypeEnum{ + "external": ReplicaVaultMetadataVaultTypeExternal, +} + +// GetReplicaVaultMetadataVaultTypeEnumValues Enumerates the set of values for ReplicaVaultMetadataVaultTypeEnum +func GetReplicaVaultMetadataVaultTypeEnumValues() []ReplicaVaultMetadataVaultTypeEnum { + values := make([]ReplicaVaultMetadataVaultTypeEnum, 0) + for _, v := range mappingReplicaVaultMetadataVaultTypeEnum { + values = append(values, v) + } + return values +} + +// GetReplicaVaultMetadataVaultTypeEnumStringValues Enumerates the set of values in String for ReplicaVaultMetadataVaultTypeEnum +func GetReplicaVaultMetadataVaultTypeEnumStringValues() []string { + return []string{ + "EXTERNAL", + } +} + +// GetMappingReplicaVaultMetadataVaultTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReplicaVaultMetadataVaultTypeEnum(val string) (ReplicaVaultMetadataVaultTypeEnum, bool) { + enum, ok := mappingReplicaVaultMetadataVaultTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replication_status_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replication_status_details.go index 251d9be75..de72524f1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replication_status_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/replication_status_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -18,6 +17,8 @@ import ( // ReplicationStatusDetails Details of replication status across all replica regions type ReplicationStatusDetails struct { + + // Replica Details. ReplicaDetails []ReplicaDetails `mandatory:"false" json:"replicaDetails"` } @@ -32,7 +33,7 @@ func (m ReplicationStatusDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_file_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_file_request_response.go index c568358b0..bb18ebfd7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_file_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_file_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -16,7 +16,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromFile.go.html to see an example of how to use RestoreKeyFromFileRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromFile.go.html to see an example of how to use RestoreKeyFromFileRequest. type RestoreKeyFromFileRequest struct { // The content length of the body. @@ -91,7 +91,7 @@ func (request RestoreKeyFromFileRequest) RetryPolicy() *common.RetryPolicy { func (request RestoreKeyFromFileRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_details.go index 0fb33f27d..db9e5978e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -17,7 +16,7 @@ import ( "strings" ) -// RestoreKeyFromObjectStoreDetails The representation of RestoreKeyFromObjectStoreDetails +// RestoreKeyFromObjectStoreDetails The details of the backup location from which you want to restore the Key. type RestoreKeyFromObjectStoreDetails struct { BackupLocation BackupLocation `mandatory:"false" json:"backupLocation"` } @@ -33,7 +32,7 @@ func (m RestoreKeyFromObjectStoreDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_request_response.go index 48085652a..2ec008206 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_key_from_object_store_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromObjectStore.go.html to see an example of how to use RestoreKeyFromObjectStoreRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreKeyFromObjectStore.go.html to see an example of how to use RestoreKeyFromObjectStoreRequest. type RestoreKeyFromObjectStoreRequest struct { // For optimistic concurrency control. In the PUT or DELETE call for a @@ -78,7 +78,7 @@ func (request RestoreKeyFromObjectStoreRequest) RetryPolicy() *common.RetryPolic func (request RestoreKeyFromObjectStoreRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_file_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_file_request_response.go index 87c64c3dc..27553385b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_file_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_file_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -16,7 +16,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromFile.go.html to see an example of how to use RestoreVaultFromFileRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromFile.go.html to see an example of how to use RestoreVaultFromFileRequest. type RestoreVaultFromFileRequest struct { // The OCID of the compartment. @@ -94,7 +94,7 @@ func (request RestoreVaultFromFileRequest) RetryPolicy() *common.RetryPolicy { func (request RestoreVaultFromFileRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_details.go index bea3dd3cd..d9e6fa4e8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -17,7 +16,7 @@ import ( "strings" ) -// RestoreVaultFromObjectStoreDetails The representation of RestoreVaultFromObjectStoreDetails +// RestoreVaultFromObjectStoreDetails The details of the backup location from which you want to restore the Vault. type RestoreVaultFromObjectStoreDetails struct { BackupLocation BackupLocation `mandatory:"false" json:"backupLocation"` } @@ -33,7 +32,7 @@ func (m RestoreVaultFromObjectStoreDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_request_response.go index 08dac78b9..9532194c8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/restore_vault_from_object_store_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromObjectStore.go.html to see an example of how to use RestoreVaultFromObjectStoreRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/RestoreVaultFromObjectStore.go.html to see an example of how to use RestoreVaultFromObjectStoreRequest. type RestoreVaultFromObjectStoreRequest struct { // The OCID of the compartment. @@ -81,7 +81,7 @@ func (request RestoreVaultFromObjectStoreRequest) RetryPolicy() *common.RetryPol func (request RestoreVaultFromObjectStoreRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_details.go new file mode 100644 index 000000000..ef584c20c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleHsmClusterDeletionDetails Details for scheduling HSM resource deletion. +type ScheduleHsmClusterDeletionDetails struct { + + // An optional property indicating when to delete the HsmCluster resource, expressed in + // RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. The specified + // time must be between 7 and 30 days from the time when the request is received. + // If this property is missing, it will be set to 30 days from the time of the request + // by default. + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` +} + +func (m ScheduleHsmClusterDeletionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduleHsmClusterDeletionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_request_response.go new file mode 100644 index 000000000..16ac42eb9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_hsm_cluster_deletion_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScheduleHsmClusterDeletionRequest wrapper for the ScheduleHsmClusterDeletion operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleHsmClusterDeletion.go.html to see an example of how to use ScheduleHsmClusterDeletionRequest. +type ScheduleHsmClusterDeletionRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of ScheduleHsmClusterDeletionDetails + ScheduleHsmClusterDeletionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ScheduleHsmClusterDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScheduleHsmClusterDeletionRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ScheduleHsmClusterDeletionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScheduleHsmClusterDeletionRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ScheduleHsmClusterDeletionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduleHsmClusterDeletionResponse wrapper for the ScheduleHsmClusterDeletion operation +type ScheduleHsmClusterDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ScheduleHsmClusterDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScheduleHsmClusterDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_details.go index 5eb0920c8..62b1cfd86 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -38,7 +37,7 @@ func (m ScheduleKeyDeletionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_request_response.go index a83f421da..fd0f996a7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyDeletion.go.html to see an example of how to use ScheduleKeyDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyDeletion.go.html to see an example of how to use ScheduleKeyDeletionRequest. type ScheduleKeyDeletionRequest struct { // The OCID of the key. @@ -81,7 +81,7 @@ func (request ScheduleKeyDeletionRequest) RetryPolicy() *common.RetryPolicy { func (request ScheduleKeyDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_details.go index 119fe8adb..7ba7e92d6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -36,7 +35,7 @@ func (m ScheduleKeyVersionDeletionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_request_response.go index dbbb61d9e..c83f0eb51 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_key_version_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyVersionDeletion.go.html to see an example of how to use ScheduleKeyVersionDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleKeyVersionDeletion.go.html to see an example of how to use ScheduleKeyVersionDeletionRequest. type ScheduleKeyVersionDeletionRequest struct { // The OCID of the key. @@ -84,7 +84,7 @@ func (request ScheduleKeyVersionDeletionRequest) RetryPolicy() *common.RetryPoli func (request ScheduleKeyVersionDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_details.go index b1a4c4f49..2704b667d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -38,7 +37,7 @@ func (m ScheduleVaultDeletionDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_request_response.go index 48741026d..abbf84fe5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/schedule_vault_deletion_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleVaultDeletion.go.html to see an example of how to use ScheduleVaultDeletionRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleVaultDeletion.go.html to see an example of how to use ScheduleVaultDeletionRequest. type ScheduleVaultDeletionRequest struct { // The OCID of the vault. @@ -81,7 +81,7 @@ func (request ScheduleVaultDeletionRequest) RetryPolicy() *common.RetryPolicy { func (request ScheduleVaultDeletionRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_data_details.go index bfb14753d..21009293b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_data_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// SignDataDetails The representation of SignDataDetails +// SignDataDetails The details of the message that you want to sign. type SignDataDetails struct { // The base64-encoded binary data object denoting the message or message digest to sign. You can have a message up to 4096 bytes in size. To sign a larger message, provide the message digest. @@ -39,6 +38,10 @@ type SignDataDetails struct { // Denotes whether the value of the message parameter is a raw message or a message digest. // The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. MessageType SignDataDetailsMessageTypeEnum `mandatory:"false" json:"messageType,omitempty"` + + // Information that can be used to provide context for audit logging. It is a map that contains any additional + // data that you provide to include with audit logs, if audit logging is enabled. + LoggingContext map[string]string `mandatory:"false" json:"loggingContext"` } func (m SignDataDetails) String() string { @@ -58,7 +61,7 @@ func (m SignDataDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MessageType: %s. Supported values are: %s.", m.MessageType, strings.Join(GetSignDataDetailsMessageTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_request_response.go index 9095df5c4..30f0a6eb3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/sign_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Sign.go.html to see an example of how to use SignRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Sign.go.html to see an example of how to use SignRequest. type SignRequest struct { // SignDataDetails @@ -63,7 +63,7 @@ func (request SignRequest) RetryPolicy() *common.RetryPolicy { func (request SignRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/signed_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/signed_data.go index 54153097f..2a8486f7e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/signed_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/signed_data.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// SignedData The representation of SignedData +// SignedData The response to a request to sign the message. type SignedData struct { // The OCID of the key used to sign the message. @@ -51,7 +50,7 @@ func (m SignedData) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_details.go new file mode 100644 index 000000000..e51813134 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateEkmsPrivateEndpointDetails Information needed to modify EKMS private endpoint resource +type UpdateEkmsPrivateEndpointDetails struct { + + // Display name of EKMS private endpoint resource. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Usage of predefined tag keys. These predefined keys are scoped to namespaces. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateEkmsPrivateEndpointDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateEkmsPrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_request_response.go new file mode 100644 index 000000000..6012f9cc1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_ekms_private_endpoint_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateEkmsPrivateEndpointRequest wrapper for the UpdateEkmsPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateEkmsPrivateEndpoint.go.html to see an example of how to use UpdateEkmsPrivateEndpointRequest. +type UpdateEkmsPrivateEndpointRequest struct { + + // Unique EKMS private endpoint identifier. + EkmsPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"ekmsPrivateEndpointId"` + + // The information to be updated in EKMS private endpoint + UpdateEkmsPrivateEndpointDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateEkmsPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateEkmsPrivateEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateEkmsPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateEkmsPrivateEndpointRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateEkmsPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateEkmsPrivateEndpointResponse wrapper for the UpdateEkmsPrivateEndpoint operation +type UpdateEkmsPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The EkmsPrivateEndpoint instance + EkmsPrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateEkmsPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateEkmsPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_details.go new file mode 100644 index 000000000..36795d356 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateHsmClusterDetails The details of the HsmCluster resource that you wish to update. +type UpdateHsmClusterDetails struct { + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the HSM resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateHsmClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateHsmClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_request_response.go new file mode 100644 index 000000000..4785c23c5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_hsm_cluster_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateHsmClusterRequest wrapper for the UpdateHsmCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateHsmCluster.go.html to see an example of how to use UpdateHsmClusterRequest. +type UpdateHsmClusterRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of the HsmCluster Resource + UpdateHsmClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateHsmClusterRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHsmClusterRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateHsmClusterResponse wrapper for the UpdateHsmCluster operation +type UpdateHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_details.go index cfe20cf5b..0f456590b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,11 +15,16 @@ import ( "strings" ) -// UpdateKeyDetails The representation of UpdateKeyDetails +// UpdateKeyDetails The details of the Key that you wish to update. type UpdateKeyDetails struct { + // A parameter specifying whether the auto key rotation is enabled or not. + IsAutoRotationEnabled *bool `mandatory:"false" json:"isAutoRotationEnabled"` + + AutoKeyRotationDetails *AutoKeyRotationDetails `mandatory:"false" json:"autoKeyRotationDetails"` + // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -29,7 +33,7 @@ type UpdateKeyDetails struct { DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -45,7 +49,7 @@ func (m UpdateKeyDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_request_response.go index f599a4b5f..69d4aceb6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_key_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateKey.go.html to see an example of how to use UpdateKeyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateKey.go.html to see an example of how to use UpdateKeyRequest. type UpdateKeyRequest struct { // The OCID of the key. @@ -73,7 +73,7 @@ func (request UpdateKeyRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateKeyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_details.go index cfbff51e4..17d89a87d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,11 +15,11 @@ import ( "strings" ) -// UpdateVaultDetails The representation of UpdateVaultDetails +// UpdateVaultDetails The details of the Vault that you wish to update. type UpdateVaultDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` @@ -29,7 +28,7 @@ type UpdateVaultDetails struct { DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } @@ -45,7 +44,7 @@ func (m UpdateVaultDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_request_response.go index 25e421165..03f2b0a15 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/update_vault_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateVault.go.html to see an example of how to use UpdateVaultRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateVault.go.html to see an example of how to use UpdateVaultRequest. type UpdateVaultRequest struct { // The OCID of the vault. @@ -73,7 +73,7 @@ func (request UpdateVaultRequest) RetryPolicy() *common.RetryPolicy { func (request UpdateVaultRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_details.go new file mode 100644 index 000000000..19f166865 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UploadPartitionCertificatesDetails An object that encapsulates the necessary partition certificates. +type UploadPartitionCertificatesDetails struct { + + // Base64 encoded (StandardCharsets.UTF_8) Partition Certificate, which gets created when the CSR is signed. + PartitionCertificate *string `mandatory:"true" json:"partitionCertificate"` + + // Base64 encoded (StandardCharsets.UTF_8) Partition Owner Certificate, which is used to help sign the CSR. + PartitionOwnerCertificate *string `mandatory:"true" json:"partitionOwnerCertificate"` +} + +func (m UploadPartitionCertificatesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UploadPartitionCertificatesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_request_response.go new file mode 100644 index 000000000..041240058 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/upload_partition_certificates_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UploadPartitionCertificatesRequest wrapper for the UploadPartitionCertificates operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UploadPartitionCertificates.go.html to see an example of how to use UploadPartitionCertificatesRequest. +type UploadPartitionCertificatesRequest struct { + + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // To upload partition certificates. + UploadPartitionCertificatesDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated + // before then due to conflicting operations (e.g., if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `if-match` parameter to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UploadPartitionCertificatesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UploadPartitionCertificatesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UploadPartitionCertificatesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadPartitionCertificatesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UploadPartitionCertificatesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UploadPartitionCertificatesResponse wrapper for the UploadPartitionCertificates operation +type UploadPartitionCertificatesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UploadPartitionCertificatesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UploadPartitionCertificatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault.go index 3a855a493..441a7d4f2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,15 +15,15 @@ import ( "strings" ) -// Vault The representation of Vault +// Vault The logical entity where the Vault service creates and durably stores keys. type Vault struct { // The OCID of the compartment that contains this vault. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The service endpoint to perform cryptographic operations against. Cryptographic operations include - // Encrypt (https://docs.cloud.oracle.com/api/#/en/key/latest/EncryptedData/Encrypt), Decrypt (https://docs.cloud.oracle.com/api/#/en/key/latest/DecryptedData/Decrypt), - // and GenerateDataEncryptionKey (https://docs.cloud.oracle.com/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. + // Encrypt (https://docs.oracle.com/iaas/api/#/en/key/latest/EncryptedData/Encrypt), Decrypt (https://docs.oracle.com/iaas/api/#/en/key/latest/DecryptedData/Decrypt), + // and GenerateDataEncryptionKey (https://docs.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. CryptoEndpoint *string `mandatory:"true" json:"cryptoEndpoint"` // A user-friendly name for the vault. It does not have to be unique, and it is changeable. @@ -53,12 +52,12 @@ type Vault struct { WrappingkeyId *string `mandatory:"true" json:"wrappingkeyId"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -73,7 +72,13 @@ type Vault struct { ReplicaDetails *VaultReplicaDetails `mandatory:"false" json:"replicaDetails"` + // A Boolean value that indicates whether the Vault is primary Vault or replica Vault. IsPrimary *bool `mandatory:"false" json:"isPrimary"` + + // A Boolean value that indicates whether the Vault has cross region replication capability. Always true for Virtual Private Vaults. + IsVaultReplicable *bool `mandatory:"false" json:"isVaultReplicable"` + + ExternalKeyManagerMetadataSummary *ExternalKeyManagerMetadataSummary `mandatory:"false" json:"externalKeyManagerMetadataSummary"` } func (m Vault) String() string { @@ -93,7 +98,7 @@ func (m Vault) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -179,16 +184,19 @@ type VaultVaultTypeEnum string const ( VaultVaultTypeVirtualPrivate VaultVaultTypeEnum = "VIRTUAL_PRIVATE" VaultVaultTypeDefault VaultVaultTypeEnum = "DEFAULT" + VaultVaultTypeExternal VaultVaultTypeEnum = "EXTERNAL" ) var mappingVaultVaultTypeEnum = map[string]VaultVaultTypeEnum{ "VIRTUAL_PRIVATE": VaultVaultTypeVirtualPrivate, "DEFAULT": VaultVaultTypeDefault, + "EXTERNAL": VaultVaultTypeExternal, } var mappingVaultVaultTypeEnumLowerCase = map[string]VaultVaultTypeEnum{ "virtual_private": VaultVaultTypeVirtualPrivate, "default": VaultVaultTypeDefault, + "external": VaultVaultTypeExternal, } // GetVaultVaultTypeEnumValues Enumerates the set of values for VaultVaultTypeEnum @@ -205,6 +213,7 @@ func GetVaultVaultTypeEnumStringValues() []string { return []string{ "VIRTUAL_PRIVATE", "DEFAULT", + "EXTERNAL", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_details.go index 99cd4cc3b..7214fda7b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -34,7 +33,7 @@ func (m VaultReplicaDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_summary.go index 90931bf4d..b89e6e0dc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_replica_summary.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -28,6 +27,7 @@ type VaultReplicaSummary struct { // Region to which vault is replicated to Region *string `mandatory:"false" json:"region"` + // Status of the Vault Status VaultReplicaSummaryStatusEnum `mandatory:"false" json:"status,omitempty"` } @@ -45,7 +45,7 @@ func (m VaultReplicaSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetVaultReplicaSummaryStatusEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_summary.go index 2c44a2061..876eaf0d2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_summary.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,15 +15,15 @@ import ( "strings" ) -// VaultSummary The representation of VaultSummary +// VaultSummary The details of the Vault. type VaultSummary struct { // The OCID of the compartment that contains a particular vault. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The service endpoint to perform cryptographic operations against. Cryptographic operations include - // Encrypt (https://docs.cloud.oracle.com/api/#/en/key/latest/EncryptedData/Encrypt), Decrypt (https://docs.cloud.oracle.com/api/#/en/key/latest/DecryptedData/Decrypt), - // and GenerateDataEncryptionKey (https://docs.cloud.oracle.com/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. + // Encrypt (https://docs.oracle.com/iaas/api/#/en/key/latest/EncryptedData/Encrypt), Decrypt (https://docs.oracle.com/iaas/api/#/en/key/latest/DecryptedData/Decrypt), + // and GenerateDataEncryptionKey (https://docs.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. CryptoEndpoint *string `mandatory:"true" json:"cryptoEndpoint"` // A user-friendly name for a vault. It does not have to be unique, and it is changeable. @@ -50,14 +49,16 @@ type VaultSummary struct { VaultType VaultSummaryVaultTypeEnum `mandatory:"true" json:"vaultType"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. - // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + ExternalKeyManagerMetadataSummary *ExternalKeyManagerMetadataSummary `mandatory:"false" json:"externalKeyManagerMetadataSummary"` } func (m VaultSummary) String() string { @@ -77,7 +78,7 @@ func (m VaultSummary) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } @@ -162,16 +163,19 @@ type VaultSummaryVaultTypeEnum string // Set of constants representing the allowable values for VaultSummaryVaultTypeEnum const ( VaultSummaryVaultTypeVirtualPrivate VaultSummaryVaultTypeEnum = "VIRTUAL_PRIVATE" + VaultSummaryVaultTypeExternal VaultSummaryVaultTypeEnum = "EXTERNAL" VaultSummaryVaultTypeDefault VaultSummaryVaultTypeEnum = "DEFAULT" ) var mappingVaultSummaryVaultTypeEnum = map[string]VaultSummaryVaultTypeEnum{ "VIRTUAL_PRIVATE": VaultSummaryVaultTypeVirtualPrivate, + "EXTERNAL": VaultSummaryVaultTypeExternal, "DEFAULT": VaultSummaryVaultTypeDefault, } var mappingVaultSummaryVaultTypeEnumLowerCase = map[string]VaultSummaryVaultTypeEnum{ "virtual_private": VaultSummaryVaultTypeVirtualPrivate, + "external": VaultSummaryVaultTypeExternal, "default": VaultSummaryVaultTypeDefault, } @@ -188,6 +192,7 @@ func GetVaultSummaryVaultTypeEnumValues() []VaultSummaryVaultTypeEnum { func GetVaultSummaryVaultTypeEnumStringValues() []string { return []string{ "VIRTUAL_PRIVATE", + "EXTERNAL", "DEFAULT", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_usage.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_usage.go index ce34a6fc4..40e3ced9e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_usage.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/vault_usage.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// VaultUsage The representation of VaultUsage +// VaultUsage The details of the number of Keys and KeyVersions usage in a Vault. type VaultUsage struct { // The number of keys in this vault that persist on a hardware security module (HSM), across all compartments, excluding keys in a `DELETED` state. @@ -43,7 +42,7 @@ func (m VaultUsage) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verified_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verified_data.go index c147dfd28..f461b522c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verified_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verified_data.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// VerifiedData The representation of VerifiedData +// VerifiedData The response to a request to verify the message. type VerifiedData struct { // A Boolean value that indicates whether the signature was verified. @@ -34,7 +33,7 @@ func (m VerifiedData) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_data_details.go index b8cac598d..0526ade37 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_data_details.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// VerifyDataDetails The representation of VerifyDataDetails +// VerifyDataDetails The details of the message that you want to verify. type VerifyDataDetails struct { // The OCID of the key used to sign the message. @@ -61,7 +60,7 @@ func (m VerifyDataDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MessageType: %s. Supported values are: %s.", m.MessageType, strings.Join(GetVerifyDataDetailsMessageTypeEnumStringValues(), ","))) } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_request_response.go index 37ad1282a..30f73d7c5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/verify_request_response.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. @@ -15,7 +15,7 @@ import ( // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Verify.go.html to see an example of how to use VerifyRequest. +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/Verify.go.html to see an example of how to use VerifyRequest. type VerifyRequest struct { // VerifyDataDetails @@ -63,7 +63,7 @@ func (request VerifyRequest) RetryPolicy() *common.RetryPolicy { func (request VerifyRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapped_import_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapped_import_key.go index 65a2dfdf6..1b7cc9827 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapped_import_key.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapped_import_key.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// WrappedImportKey The representation of WrappedImportKey +// WrappedImportKey The details of the wrapped import Key. type WrappedImportKey struct { // The key material to import, wrapped by the vault's RSA public wrapping key and base64-encoded. @@ -44,7 +43,7 @@ func (m WrappedImportKey) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapping_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapping_key.go index 49947545e..b4374ce34 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapping_key.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/keymanagement/wrapping_key.go @@ -1,11 +1,10 @@ -// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2016, 2018, 2026, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Vault Service Key Management API +// Vault Key Management API // -// API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service -// Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingkeys.htm). // package keymanagement @@ -16,7 +15,7 @@ import ( "strings" ) -// WrappingKey The representation of WrappingKey +// WrappingKey The public RSA wrapping key associated with the vault type WrappingKey struct { // The OCID of the compartment that contains this key. @@ -54,7 +53,7 @@ func (m WrappingKey) ValidateEnumValue() (bool, error) { } if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } return false, nil } diff --git a/vendor/github.com/youmark/pkcs8/.gitignore b/vendor/github.com/youmark/pkcs8/.gitignore new file mode 100644 index 000000000..836562412 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/youmark/pkcs8/LICENSE b/vendor/github.com/youmark/pkcs8/LICENSE new file mode 100644 index 000000000..c939f4481 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 youmark + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/youmark/pkcs8/README b/vendor/github.com/youmark/pkcs8/README new file mode 100644 index 000000000..376fcaf64 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/README @@ -0,0 +1 @@ +pkcs8 package: implement PKCS#8 private key parsing and conversion as defined in RFC5208 and RFC5958 diff --git a/vendor/github.com/youmark/pkcs8/README.md b/vendor/github.com/youmark/pkcs8/README.md new file mode 100644 index 000000000..ef6c76257 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/README.md @@ -0,0 +1,22 @@ +pkcs8 +=== +OpenSSL can generate private keys in both "traditional format" and PKCS#8 format. Newer applications are advised to use more secure PKCS#8 format. Go standard crypto package provides a [function](http://golang.org/pkg/crypto/x509/#ParsePKCS8PrivateKey) to parse private key in PKCS#8 format. There is a limitation to this function. It can only handle unencrypted PKCS#8 private keys. To use this function, the user has to save the private key in file without encryption, which is a bad practice to leave private keys unprotected on file systems. In addition, Go standard package lacks the functions to convert RSA/ECDSA private keys into PKCS#8 format. + +pkcs8 package fills the gap here. It implements functions to process private keys in PKCS#8 format, as defined in [RFC5208](https://tools.ietf.org/html/rfc5208) and [RFC5958](https://tools.ietf.org/html/rfc5958). It can handle both unencrypted PKCS#8 PrivateKeyInfo format and EncryptedPrivateKeyInfo format with PKCS#5 (v2.0) algorithms. + + +[**Godoc**](http://godoc.org/github.com/youmark/pkcs8) + +## Installation +Supports Go 1.10+. Release v1.1 is the last release supporting Go 1.9 + +```text +go get github.com/youmark/pkcs8 +``` +## dependency +This package depends on golang.org/x/crypto/pbkdf2 and golang.org/x/crypto/scrypt packages. Use the following command to retrieve them +```text +go get golang.org/x/crypto/pbkdf2 +go get golang.org/x/crypto/scrypt +``` + diff --git a/vendor/github.com/youmark/pkcs8/cipher.go b/vendor/github.com/youmark/pkcs8/cipher.go new file mode 100644 index 000000000..2946c93e8 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/cipher.go @@ -0,0 +1,60 @@ +package pkcs8 + +import ( + "bytes" + "crypto/cipher" + "encoding/asn1" +) + +type cipherWithBlock struct { + oid asn1.ObjectIdentifier + ivSize int + keySize int + newBlock func(key []byte) (cipher.Block, error) +} + +func (c cipherWithBlock) IVSize() int { + return c.ivSize +} + +func (c cipherWithBlock) KeySize() int { + return c.keySize +} + +func (c cipherWithBlock) OID() asn1.ObjectIdentifier { + return c.oid +} + +func (c cipherWithBlock) Encrypt(key, iv, plaintext []byte) ([]byte, error) { + block, err := c.newBlock(key) + if err != nil { + return nil, err + } + return cbcEncrypt(block, key, iv, plaintext) +} + +func (c cipherWithBlock) Decrypt(key, iv, ciphertext []byte) ([]byte, error) { + block, err := c.newBlock(key) + if err != nil { + return nil, err + } + return cbcDecrypt(block, key, iv, ciphertext) +} + +func cbcEncrypt(block cipher.Block, key, iv, plaintext []byte) ([]byte, error) { + mode := cipher.NewCBCEncrypter(block, iv) + paddingLen := block.BlockSize() - (len(plaintext) % block.BlockSize()) + ciphertext := make([]byte, len(plaintext)+paddingLen) + copy(ciphertext, plaintext) + copy(ciphertext[len(plaintext):], bytes.Repeat([]byte{byte(paddingLen)}, paddingLen)) + mode.CryptBlocks(ciphertext, ciphertext) + return ciphertext, nil +} + +func cbcDecrypt(block cipher.Block, key, iv, ciphertext []byte) ([]byte, error) { + mode := cipher.NewCBCDecrypter(block, iv) + plaintext := make([]byte, len(ciphertext)) + mode.CryptBlocks(plaintext, ciphertext) + // TODO: remove padding + return plaintext, nil +} diff --git a/vendor/github.com/youmark/pkcs8/cipher_3des.go b/vendor/github.com/youmark/pkcs8/cipher_3des.go new file mode 100644 index 000000000..562966440 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/cipher_3des.go @@ -0,0 +1,24 @@ +package pkcs8 + +import ( + "crypto/des" + "encoding/asn1" +) + +var ( + oidDESEDE3CBC = asn1.ObjectIdentifier{1, 2, 840, 113549, 3, 7} +) + +func init() { + RegisterCipher(oidDESEDE3CBC, func() Cipher { + return TripleDESCBC + }) +} + +// TripleDESCBC is the 168-bit key 3DES cipher in CBC mode. +var TripleDESCBC = cipherWithBlock{ + ivSize: des.BlockSize, + keySize: 24, + newBlock: des.NewTripleDESCipher, + oid: oidDESEDE3CBC, +} diff --git a/vendor/github.com/youmark/pkcs8/cipher_aes.go b/vendor/github.com/youmark/pkcs8/cipher_aes.go new file mode 100644 index 000000000..c0372d1ee --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/cipher_aes.go @@ -0,0 +1,84 @@ +package pkcs8 + +import ( + "crypto/aes" + "encoding/asn1" +) + +var ( + oidAES128CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 2} + oidAES128GCM = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 6} + oidAES192CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 22} + oidAES192GCM = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 26} + oidAES256CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 42} + oidAES256GCM = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 46} +) + +func init() { + RegisterCipher(oidAES128CBC, func() Cipher { + return AES128CBC + }) + RegisterCipher(oidAES128GCM, func() Cipher { + return AES128GCM + }) + RegisterCipher(oidAES192CBC, func() Cipher { + return AES192CBC + }) + RegisterCipher(oidAES192GCM, func() Cipher { + return AES192GCM + }) + RegisterCipher(oidAES256CBC, func() Cipher { + return AES256CBC + }) + RegisterCipher(oidAES256GCM, func() Cipher { + return AES256GCM + }) +} + +// AES128CBC is the 128-bit key AES cipher in CBC mode. +var AES128CBC = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 16, + newBlock: aes.NewCipher, + oid: oidAES128CBC, +} + +// AES128GCM is the 128-bit key AES cipher in GCM mode. +var AES128GCM = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 16, + newBlock: aes.NewCipher, + oid: oidAES128GCM, +} + +// AES192CBC is the 192-bit key AES cipher in CBC mode. +var AES192CBC = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 24, + newBlock: aes.NewCipher, + oid: oidAES192CBC, +} + +// AES192GCM is the 912-bit key AES cipher in GCM mode. +var AES192GCM = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 24, + newBlock: aes.NewCipher, + oid: oidAES192GCM, +} + +// AES256CBC is the 256-bit key AES cipher in CBC mode. +var AES256CBC = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 32, + newBlock: aes.NewCipher, + oid: oidAES256CBC, +} + +// AES256GCM is the 256-bit key AES cipher in GCM mode. +var AES256GCM = cipherWithBlock{ + ivSize: aes.BlockSize, + keySize: 32, + newBlock: aes.NewCipher, + oid: oidAES256GCM, +} diff --git a/vendor/github.com/youmark/pkcs8/kdf_pbkdf2.go b/vendor/github.com/youmark/pkcs8/kdf_pbkdf2.go new file mode 100644 index 000000000..79697dd82 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/kdf_pbkdf2.go @@ -0,0 +1,91 @@ +package pkcs8 + +import ( + "crypto" + "crypto/sha1" + "crypto/sha256" + "crypto/x509/pkix" + "encoding/asn1" + "errors" + "hash" + + "golang.org/x/crypto/pbkdf2" +) + +var ( + oidPKCS5PBKDF2 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 5, 12} + oidHMACWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 113549, 2, 7} + oidHMACWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 113549, 2, 9} +) + +func init() { + RegisterKDF(oidPKCS5PBKDF2, func() KDFParameters { + return new(pbkdf2Params) + }) +} + +func newHashFromPRF(ai pkix.AlgorithmIdentifier) (func() hash.Hash, error) { + switch { + case len(ai.Algorithm) == 0 || ai.Algorithm.Equal(oidHMACWithSHA1): + return sha1.New, nil + case ai.Algorithm.Equal(oidHMACWithSHA256): + return sha256.New, nil + default: + return nil, errors.New("pkcs8: unsupported hash function") + } +} + +func newPRFParamFromHash(h crypto.Hash) (pkix.AlgorithmIdentifier, error) { + switch h { + case crypto.SHA1: + return pkix.AlgorithmIdentifier{ + Algorithm: oidHMACWithSHA1, + Parameters: asn1.RawValue{Tag: asn1.TagNull}}, nil + case crypto.SHA256: + return pkix.AlgorithmIdentifier{ + Algorithm: oidHMACWithSHA256, + Parameters: asn1.RawValue{Tag: asn1.TagNull}}, nil + } + return pkix.AlgorithmIdentifier{}, errors.New("pkcs8: unsupported hash function") +} + +type pbkdf2Params struct { + Salt []byte + IterationCount int + PRF pkix.AlgorithmIdentifier `asn1:"optional"` +} + +func (p pbkdf2Params) DeriveKey(password []byte, size int) (key []byte, err error) { + h, err := newHashFromPRF(p.PRF) + if err != nil { + return nil, err + } + return pbkdf2.Key(password, p.Salt, p.IterationCount, size, h), nil +} + +// PBKDF2Opts contains options for the PBKDF2 key derivation function. +type PBKDF2Opts struct { + SaltSize int + IterationCount int + HMACHash crypto.Hash +} + +func (p PBKDF2Opts) DeriveKey(password, salt []byte, size int) ( + key []byte, params KDFParameters, err error) { + + key = pbkdf2.Key(password, salt, p.IterationCount, size, p.HMACHash.New) + prfParam, err := newPRFParamFromHash(p.HMACHash) + if err != nil { + return nil, nil, err + } + params = pbkdf2Params{salt, p.IterationCount, prfParam} + return key, params, nil +} + +func (p PBKDF2Opts) GetSaltSize() int { + return p.SaltSize +} + +func (p PBKDF2Opts) OID() asn1.ObjectIdentifier { + return oidPKCS5PBKDF2 +} diff --git a/vendor/github.com/youmark/pkcs8/kdf_scrypt.go b/vendor/github.com/youmark/pkcs8/kdf_scrypt.go new file mode 100644 index 000000000..36c4f4f59 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/kdf_scrypt.go @@ -0,0 +1,62 @@ +package pkcs8 + +import ( + "encoding/asn1" + + "golang.org/x/crypto/scrypt" +) + +var ( + oidScrypt = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11591, 4, 11} +) + +func init() { + RegisterKDF(oidScrypt, func() KDFParameters { + return new(scryptParams) + }) +} + +type scryptParams struct { + Salt []byte + CostParameter int + BlockSize int + ParallelizationParameter int +} + +func (p scryptParams) DeriveKey(password []byte, size int) (key []byte, err error) { + return scrypt.Key(password, p.Salt, p.CostParameter, p.BlockSize, + p.ParallelizationParameter, size) +} + +// ScryptOpts contains options for the scrypt key derivation function. +type ScryptOpts struct { + SaltSize int + CostParameter int + BlockSize int + ParallelizationParameter int +} + +func (p ScryptOpts) DeriveKey(password, salt []byte, size int) ( + key []byte, params KDFParameters, err error) { + + key, err = scrypt.Key(password, salt, p.CostParameter, p.BlockSize, + p.ParallelizationParameter, size) + if err != nil { + return nil, nil, err + } + params = scryptParams{ + BlockSize: p.BlockSize, + CostParameter: p.CostParameter, + ParallelizationParameter: p.ParallelizationParameter, + Salt: salt, + } + return key, params, nil +} + +func (p ScryptOpts) GetSaltSize() int { + return p.SaltSize +} + +func (p ScryptOpts) OID() asn1.ObjectIdentifier { + return oidScrypt +} diff --git a/vendor/github.com/youmark/pkcs8/pkcs8.go b/vendor/github.com/youmark/pkcs8/pkcs8.go new file mode 100644 index 000000000..f27f62752 --- /dev/null +++ b/vendor/github.com/youmark/pkcs8/pkcs8.go @@ -0,0 +1,309 @@ +// Package pkcs8 implements functions to parse and convert private keys in PKCS#8 format, as defined in RFC5208 and RFC5958 +package pkcs8 + +import ( + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" + "encoding/asn1" + "errors" + "fmt" +) + +// DefaultOpts are the default options for encrypting a key if none are given. +// The defaults can be changed by the library user. +var DefaultOpts = &Opts{ + Cipher: AES256CBC, + KDFOpts: PBKDF2Opts{ + SaltSize: 8, + IterationCount: 10000, + HMACHash: crypto.SHA256, + }, +} + +// KDFOpts contains options for a key derivation function. +// An implementation of this interface must be specified when encrypting a PKCS#8 key. +type KDFOpts interface { + // DeriveKey derives a key of size bytes from the given password and salt. + // It returns the key and the ASN.1-encodable parameters used. + DeriveKey(password, salt []byte, size int) (key []byte, params KDFParameters, err error) + // GetSaltSize returns the salt size specified. + GetSaltSize() int + // OID returns the OID of the KDF specified. + OID() asn1.ObjectIdentifier +} + +// KDFParameters contains parameters (salt, etc.) for a key deriviation function. +// It must be a ASN.1-decodable structure. +// An implementation of this interface is created when decoding an encrypted PKCS#8 key. +type KDFParameters interface { + // DeriveKey derives a key of size bytes from the given password. + // It uses the salt from the decoded parameters. + DeriveKey(password []byte, size int) (key []byte, err error) +} + +var kdfs = make(map[string]func() KDFParameters) + +// RegisterKDF registers a function that returns a new instance of the given KDF +// parameters. This allows the library to support client-provided KDFs. +func RegisterKDF(oid asn1.ObjectIdentifier, params func() KDFParameters) { + kdfs[oid.String()] = params +} + +// Cipher represents a cipher for encrypting the key material. +type Cipher interface { + // IVSize returns the IV size of the cipher, in bytes. + IVSize() int + // KeySize returns the key size of the cipher, in bytes. + KeySize() int + // Encrypt encrypts the key material. + Encrypt(key, iv, plaintext []byte) ([]byte, error) + // Decrypt decrypts the key material. + Decrypt(key, iv, ciphertext []byte) ([]byte, error) + // OID returns the OID of the cipher specified. + OID() asn1.ObjectIdentifier +} + +var ciphers = make(map[string]func() Cipher) + +// RegisterCipher registers a function that returns a new instance of the given +// cipher. This allows the library to support client-provided ciphers. +func RegisterCipher(oid asn1.ObjectIdentifier, cipher func() Cipher) { + ciphers[oid.String()] = cipher +} + +// Opts contains options for encrypting a PKCS#8 key. +type Opts struct { + Cipher Cipher + KDFOpts KDFOpts +} + +// Unecrypted PKCS8 +var ( + oidPBES2 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 5, 13} +) + +type encryptedPrivateKeyInfo struct { + EncryptionAlgorithm pkix.AlgorithmIdentifier + EncryptedData []byte +} + +type pbes2Params struct { + KeyDerivationFunc pkix.AlgorithmIdentifier + EncryptionScheme pkix.AlgorithmIdentifier +} + +type privateKeyInfo struct { + Version int + PrivateKeyAlgorithm pkix.AlgorithmIdentifier + PrivateKey []byte +} + +func parseKeyDerivationFunc(keyDerivationFunc pkix.AlgorithmIdentifier) (KDFParameters, error) { + oid := keyDerivationFunc.Algorithm.String() + newParams, ok := kdfs[oid] + if !ok { + return nil, fmt.Errorf("pkcs8: unsupported KDF (OID: %s)", oid) + } + params := newParams() + _, err := asn1.Unmarshal(keyDerivationFunc.Parameters.FullBytes, params) + if err != nil { + return nil, errors.New("pkcs8: invalid KDF parameters") + } + return params, nil +} + +func parseEncryptionScheme(encryptionScheme pkix.AlgorithmIdentifier) (Cipher, []byte, error) { + oid := encryptionScheme.Algorithm.String() + newCipher, ok := ciphers[oid] + if !ok { + return nil, nil, fmt.Errorf("pkcs8: unsupported cipher (OID: %s)", oid) + } + cipher := newCipher() + var iv []byte + if _, err := asn1.Unmarshal(encryptionScheme.Parameters.FullBytes, &iv); err != nil { + return nil, nil, errors.New("pkcs8: invalid cipher parameters") + } + return cipher, iv, nil +} + +// ParsePrivateKey parses a DER-encoded PKCS#8 private key. +// Password can be nil. +// This is equivalent to ParsePKCS8PrivateKey. +func ParsePrivateKey(der []byte, password []byte) (interface{}, KDFParameters, error) { + // No password provided, assume the private key is unencrypted + if len(password) == 0 { + privateKey, err := x509.ParsePKCS8PrivateKey(der) + return privateKey, nil, err + } + + // Use the password provided to decrypt the private key + var privKey encryptedPrivateKeyInfo + if _, err := asn1.Unmarshal(der, &privKey); err != nil { + return nil, nil, errors.New("pkcs8: only PKCS #5 v2.0 supported") + } + + if !privKey.EncryptionAlgorithm.Algorithm.Equal(oidPBES2) { + return nil, nil, errors.New("pkcs8: only PBES2 supported") + } + + var params pbes2Params + if _, err := asn1.Unmarshal(privKey.EncryptionAlgorithm.Parameters.FullBytes, ¶ms); err != nil { + return nil, nil, errors.New("pkcs8: invalid PBES2 parameters") + } + + cipher, iv, err := parseEncryptionScheme(params.EncryptionScheme) + if err != nil { + return nil, nil, err + } + + kdfParams, err := parseKeyDerivationFunc(params.KeyDerivationFunc) + if err != nil { + return nil, nil, err + } + + keySize := cipher.KeySize() + symkey, err := kdfParams.DeriveKey(password, keySize) + if err != nil { + return nil, nil, err + } + + encryptedKey := privKey.EncryptedData + decryptedKey, err := cipher.Decrypt(symkey, iv, encryptedKey) + if err != nil { + return nil, nil, err + } + + key, err := x509.ParsePKCS8PrivateKey(decryptedKey) + if err != nil { + return nil, nil, errors.New("pkcs8: incorrect password") + } + return key, kdfParams, nil +} + +// MarshalPrivateKey encodes a private key into DER-encoded PKCS#8 with the given options. +// Password can be nil. +func MarshalPrivateKey(priv interface{}, password []byte, opts *Opts) ([]byte, error) { + if len(password) == 0 { + return x509.MarshalPKCS8PrivateKey(priv) + } + + if opts == nil { + opts = DefaultOpts + } + + // Convert private key into PKCS8 format + pkey, err := x509.MarshalPKCS8PrivateKey(priv) + if err != nil { + return nil, err + } + + encAlg := opts.Cipher + salt := make([]byte, opts.KDFOpts.GetSaltSize()) + _, err = rand.Read(salt) + if err != nil { + return nil, err + } + iv := make([]byte, encAlg.IVSize()) + _, err = rand.Read(iv) + if err != nil { + return nil, err + } + key, kdfParams, err := opts.KDFOpts.DeriveKey(password, salt, encAlg.KeySize()) + if err != nil { + return nil, err + } + + encryptedKey, err := encAlg.Encrypt(key, iv, pkey) + if err != nil { + return nil, err + } + + marshalledParams, err := asn1.Marshal(kdfParams) + if err != nil { + return nil, err + } + keyDerivationFunc := pkix.AlgorithmIdentifier{ + Algorithm: opts.KDFOpts.OID(), + Parameters: asn1.RawValue{FullBytes: marshalledParams}, + } + marshalledIV, err := asn1.Marshal(iv) + if err != nil { + return nil, err + } + encryptionScheme := pkix.AlgorithmIdentifier{ + Algorithm: encAlg.OID(), + Parameters: asn1.RawValue{FullBytes: marshalledIV}, + } + + encryptionAlgorithmParams := pbes2Params{ + EncryptionScheme: encryptionScheme, + KeyDerivationFunc: keyDerivationFunc, + } + marshalledEncryptionAlgorithmParams, err := asn1.Marshal(encryptionAlgorithmParams) + if err != nil { + return nil, err + } + encryptionAlgorithm := pkix.AlgorithmIdentifier{ + Algorithm: oidPBES2, + Parameters: asn1.RawValue{FullBytes: marshalledEncryptionAlgorithmParams}, + } + + encryptedPkey := encryptedPrivateKeyInfo{ + EncryptionAlgorithm: encryptionAlgorithm, + EncryptedData: encryptedKey, + } + + return asn1.Marshal(encryptedPkey) +} + +// ParsePKCS8PrivateKey parses encrypted/unencrypted private keys in PKCS#8 format. To parse encrypted private keys, a password of []byte type should be provided to the function as the second parameter. +func ParsePKCS8PrivateKey(der []byte, v ...[]byte) (interface{}, error) { + var password []byte + if len(v) > 0 { + password = v[0] + } + privateKey, _, err := ParsePrivateKey(der, password) + return privateKey, err +} + +// ParsePKCS8PrivateKeyRSA parses encrypted/unencrypted private keys in PKCS#8 format. To parse encrypted private keys, a password of []byte type should be provided to the function as the second parameter. +func ParsePKCS8PrivateKeyRSA(der []byte, v ...[]byte) (*rsa.PrivateKey, error) { + key, err := ParsePKCS8PrivateKey(der, v...) + if err != nil { + return nil, err + } + typedKey, ok := key.(*rsa.PrivateKey) + if !ok { + return nil, errors.New("key block is not of type RSA") + } + return typedKey, nil +} + +// ParsePKCS8PrivateKeyECDSA parses encrypted/unencrypted private keys in PKCS#8 format. To parse encrypted private keys, a password of []byte type should be provided to the function as the second parameter. +func ParsePKCS8PrivateKeyECDSA(der []byte, v ...[]byte) (*ecdsa.PrivateKey, error) { + key, err := ParsePKCS8PrivateKey(der, v...) + if err != nil { + return nil, err + } + typedKey, ok := key.(*ecdsa.PrivateKey) + if !ok { + return nil, errors.New("key block is not of type ECDSA") + } + return typedKey, nil +} + +// ConvertPrivateKeyToPKCS8 converts the private key into PKCS#8 format. +// To encrypt the private key, the password of []byte type should be provided as the second parameter. +// +// The only supported key types are RSA and ECDSA (*rsa.PrivateKey or *ecdsa.PrivateKey for priv) +func ConvertPrivateKeyToPKCS8(priv interface{}, v ...[]byte) ([]byte, error) { + var password []byte + if len(v) > 0 { + password = v[0] + } + return MarshalPrivateKey(priv, password, nil) +} diff --git a/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go new file mode 100644 index 000000000..28cd99c7f --- /dev/null +++ b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go @@ -0,0 +1,77 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC +2898 / PKCS #5 v2.0. + +A key derivation function is useful when encrypting data based on a password +or any other not-fully-random data. It uses a pseudorandom function to derive +a secure encryption key based on the password. + +While v2.0 of the standard defines only one pseudorandom function to use, +HMAC-SHA1, the drafted v2.1 specification allows use of all five FIPS Approved +Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To +choose, you can pass the `New` functions from the different SHA packages to +pbkdf2.Key. +*/ +package pbkdf2 + +import ( + "crypto/hmac" + "hash" +) + +// Key derives a key from the password, salt and iteration count, returning a +// []byte of length keylen that can be used as cryptographic key. The key is +// derived based on the method described as PBKDF2 with the HMAC variant using +// the supplied hash function. +// +// For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you +// can get a derived key for e.g. AES-256 (which needs a 32-byte key) by +// doing: +// +// dk := pbkdf2.Key([]byte("some password"), salt, 4096, 32, sha1.New) +// +// Remember to get a good random salt. At least 8 bytes is recommended by the +// RFC. +// +// Using a higher iteration count will increase the cost of an exhaustive +// search but will also make derivation proportionally slower. +func Key(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte { + prf := hmac.New(h, password) + hashLen := prf.Size() + numBlocks := (keyLen + hashLen - 1) / hashLen + + var buf [4]byte + dk := make([]byte, 0, numBlocks*hashLen) + U := make([]byte, hashLen) + for block := 1; block <= numBlocks; block++ { + // N.B.: || means concatenation, ^ means XOR + // for each block T_i = U_1 ^ U_2 ^ ... ^ U_iter + // U_1 = PRF(password, salt || uint(i)) + prf.Reset() + prf.Write(salt) + buf[0] = byte(block >> 24) + buf[1] = byte(block >> 16) + buf[2] = byte(block >> 8) + buf[3] = byte(block) + prf.Write(buf[:4]) + dk = prf.Sum(dk) + T := dk[len(dk)-hashLen:] + copy(U, T) + + // U_n = PRF(password, U_(n-1)) + for n := 2; n <= iter; n++ { + prf.Reset() + prf.Write(U) + U = U[:0] + U = prf.Sum(U) + for x := range U { + T[x] ^= U[x] + } + } + } + return dk[:keyLen] +} diff --git a/vendor/golang.org/x/crypto/scrypt/scrypt.go b/vendor/golang.org/x/crypto/scrypt/scrypt.go new file mode 100644 index 000000000..76fa40fb2 --- /dev/null +++ b/vendor/golang.org/x/crypto/scrypt/scrypt.go @@ -0,0 +1,212 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package scrypt implements the scrypt key derivation function as defined in +// Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard +// Functions" (https://www.tarsnap.com/scrypt/scrypt.pdf). +package scrypt + +import ( + "crypto/sha256" + "encoding/binary" + "errors" + "math/bits" + + "golang.org/x/crypto/pbkdf2" +) + +const maxInt = int(^uint(0) >> 1) + +// blockCopy copies n numbers from src into dst. +func blockCopy(dst, src []uint32, n int) { + copy(dst, src[:n]) +} + +// blockXOR XORs numbers from dst with n numbers from src. +func blockXOR(dst, src []uint32, n int) { + for i, v := range src[:n] { + dst[i] ^= v + } +} + +// salsaXOR applies Salsa20/8 to the XOR of 16 numbers from tmp and in, +// and puts the result into both tmp and out. +func salsaXOR(tmp *[16]uint32, in, out []uint32) { + w0 := tmp[0] ^ in[0] + w1 := tmp[1] ^ in[1] + w2 := tmp[2] ^ in[2] + w3 := tmp[3] ^ in[3] + w4 := tmp[4] ^ in[4] + w5 := tmp[5] ^ in[5] + w6 := tmp[6] ^ in[6] + w7 := tmp[7] ^ in[7] + w8 := tmp[8] ^ in[8] + w9 := tmp[9] ^ in[9] + w10 := tmp[10] ^ in[10] + w11 := tmp[11] ^ in[11] + w12 := tmp[12] ^ in[12] + w13 := tmp[13] ^ in[13] + w14 := tmp[14] ^ in[14] + w15 := tmp[15] ^ in[15] + + x0, x1, x2, x3, x4, x5, x6, x7, x8 := w0, w1, w2, w3, w4, w5, w6, w7, w8 + x9, x10, x11, x12, x13, x14, x15 := w9, w10, w11, w12, w13, w14, w15 + + for i := 0; i < 8; i += 2 { + x4 ^= bits.RotateLeft32(x0+x12, 7) + x8 ^= bits.RotateLeft32(x4+x0, 9) + x12 ^= bits.RotateLeft32(x8+x4, 13) + x0 ^= bits.RotateLeft32(x12+x8, 18) + + x9 ^= bits.RotateLeft32(x5+x1, 7) + x13 ^= bits.RotateLeft32(x9+x5, 9) + x1 ^= bits.RotateLeft32(x13+x9, 13) + x5 ^= bits.RotateLeft32(x1+x13, 18) + + x14 ^= bits.RotateLeft32(x10+x6, 7) + x2 ^= bits.RotateLeft32(x14+x10, 9) + x6 ^= bits.RotateLeft32(x2+x14, 13) + x10 ^= bits.RotateLeft32(x6+x2, 18) + + x3 ^= bits.RotateLeft32(x15+x11, 7) + x7 ^= bits.RotateLeft32(x3+x15, 9) + x11 ^= bits.RotateLeft32(x7+x3, 13) + x15 ^= bits.RotateLeft32(x11+x7, 18) + + x1 ^= bits.RotateLeft32(x0+x3, 7) + x2 ^= bits.RotateLeft32(x1+x0, 9) + x3 ^= bits.RotateLeft32(x2+x1, 13) + x0 ^= bits.RotateLeft32(x3+x2, 18) + + x6 ^= bits.RotateLeft32(x5+x4, 7) + x7 ^= bits.RotateLeft32(x6+x5, 9) + x4 ^= bits.RotateLeft32(x7+x6, 13) + x5 ^= bits.RotateLeft32(x4+x7, 18) + + x11 ^= bits.RotateLeft32(x10+x9, 7) + x8 ^= bits.RotateLeft32(x11+x10, 9) + x9 ^= bits.RotateLeft32(x8+x11, 13) + x10 ^= bits.RotateLeft32(x9+x8, 18) + + x12 ^= bits.RotateLeft32(x15+x14, 7) + x13 ^= bits.RotateLeft32(x12+x15, 9) + x14 ^= bits.RotateLeft32(x13+x12, 13) + x15 ^= bits.RotateLeft32(x14+x13, 18) + } + x0 += w0 + x1 += w1 + x2 += w2 + x3 += w3 + x4 += w4 + x5 += w5 + x6 += w6 + x7 += w7 + x8 += w8 + x9 += w9 + x10 += w10 + x11 += w11 + x12 += w12 + x13 += w13 + x14 += w14 + x15 += w15 + + out[0], tmp[0] = x0, x0 + out[1], tmp[1] = x1, x1 + out[2], tmp[2] = x2, x2 + out[3], tmp[3] = x3, x3 + out[4], tmp[4] = x4, x4 + out[5], tmp[5] = x5, x5 + out[6], tmp[6] = x6, x6 + out[7], tmp[7] = x7, x7 + out[8], tmp[8] = x8, x8 + out[9], tmp[9] = x9, x9 + out[10], tmp[10] = x10, x10 + out[11], tmp[11] = x11, x11 + out[12], tmp[12] = x12, x12 + out[13], tmp[13] = x13, x13 + out[14], tmp[14] = x14, x14 + out[15], tmp[15] = x15, x15 +} + +func blockMix(tmp *[16]uint32, in, out []uint32, r int) { + blockCopy(tmp[:], in[(2*r-1)*16:], 16) + for i := 0; i < 2*r; i += 2 { + salsaXOR(tmp, in[i*16:], out[i*8:]) + salsaXOR(tmp, in[i*16+16:], out[i*8+r*16:]) + } +} + +func integer(b []uint32, r int) uint64 { + j := (2*r - 1) * 16 + return uint64(b[j]) | uint64(b[j+1])<<32 +} + +func smix(b []byte, r, N int, v, xy []uint32) { + var tmp [16]uint32 + R := 32 * r + x := xy + y := xy[R:] + + j := 0 + for i := 0; i < R; i++ { + x[i] = binary.LittleEndian.Uint32(b[j:]) + j += 4 + } + for i := 0; i < N; i += 2 { + blockCopy(v[i*R:], x, R) + blockMix(&tmp, x, y, r) + + blockCopy(v[(i+1)*R:], y, R) + blockMix(&tmp, y, x, r) + } + for i := 0; i < N; i += 2 { + j := int(integer(x, r) & uint64(N-1)) + blockXOR(x, v[j*R:], R) + blockMix(&tmp, x, y, r) + + j = int(integer(y, r) & uint64(N-1)) + blockXOR(y, v[j*R:], R) + blockMix(&tmp, y, x, r) + } + j = 0 + for _, v := range x[:R] { + binary.LittleEndian.PutUint32(b[j:], v) + j += 4 + } +} + +// Key derives a key from the password, salt, and cost parameters, returning +// a byte slice of length keyLen that can be used as cryptographic key. +// +// N is a CPU/memory cost parameter, which must be a power of two greater than 1. +// r and p must satisfy r * p < 2³⁰. If the parameters do not satisfy the +// limits, the function returns a nil byte slice and an error. +// +// For example, you can get a derived key for e.g. AES-256 (which needs a +// 32-byte key) by doing: +// +// dk, err := scrypt.Key([]byte("some password"), salt, 32768, 8, 1, 32) +// +// The recommended parameters for interactive logins as of 2017 are N=32768, r=8 +// and p=1. The parameters N, r, and p should be increased as memory latency and +// CPU parallelism increases; consider setting N to the highest power of 2 you +// can derive within 100 milliseconds. Remember to get a good random salt. +func Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error) { + if N <= 1 || N&(N-1) != 0 { + return nil, errors.New("scrypt: N must be > 1 and a power of 2") + } + if uint64(r)*uint64(p) >= 1<<30 || r > maxInt/128/p || r > maxInt/256 || N > maxInt/128/r { + return nil, errors.New("scrypt: parameters are too large") + } + + xy := make([]uint32, 64*r) + v := make([]uint32, 32*N*r) + b := pbkdf2.Key(password, salt, 1, p*128*r, sha256.New) + + for i := 0; i < p; i++ { + smix(b[i*128*r:], r, N, v, xy) + } + + return pbkdf2.Key(password, b, 1, keyLen, sha256.New), nil +} diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index db1c95fab..24cea6882 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -2,44 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package context defines the Context type, which carries deadlines, -// cancellation signals, and other request-scoped values across API boundaries -// and between processes. -// As of Go 1.7 this package is available in the standard library under the -// name [context], and migrating to it can be done automatically with [go fix]. -// -// Incoming requests to a server should create a [Context], and outgoing -// calls to servers should accept a Context. The chain of function -// calls between them must propagate the Context, optionally replacing -// it with a derived Context created using [WithCancel], [WithDeadline], -// [WithTimeout], or [WithValue]. -// -// Programs that use Contexts should follow these rules to keep interfaces -// consistent across packages and enable static analysis tools to check context -// propagation: -// -// Do not store Contexts inside a struct type; instead, pass a Context -// explicitly to each function that needs it. This is discussed further in -// https://go.dev/blog/context-and-structs. The Context should be the first -// parameter, typically named ctx: -// -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } -// -// Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] -// if you are unsure about which Context to use. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. +// Package context has been superseded by the standard library [context] package. // -// The same Context may be passed to functions running in different goroutines; -// Contexts are safe for simultaneous use by multiple goroutines. -// -// See https://go.dev/blog/context for example code for a server that uses -// Contexts. -// -// [go fix]: https://go.dev/cmd/go#hdr-Update_packages_to_use_new_APIs +// Deprecated: Use the standard library context package instead. package context import ( @@ -51,36 +16,37 @@ import ( // API boundaries. // // Context's methods may be called by multiple goroutines simultaneously. +// +//go:fix inline type Context = context.Context // Canceled is the error returned by [Context.Err] when the context is canceled // for some reason other than its deadline passing. +// +//go:fix inline var Canceled = context.Canceled // DeadlineExceeded is the error returned by [Context.Err] when the context is canceled // due to its deadline passing. +// +//go:fix inline var DeadlineExceeded = context.DeadlineExceeded // Background returns a non-nil, empty Context. It is never canceled, has no // values, and has no deadline. It is typically used by the main function, // initialization, and tests, and as the top-level Context for incoming // requests. -func Background() Context { - return background -} +// +//go:fix inline +func Background() Context { return context.Background() } // TODO returns a non-nil, empty Context. Code should use context.TODO when // it's unclear which Context to use or it is not yet available (because the // surrounding function has not yet been extended to accept a Context // parameter). -func TODO() Context { - return todo -} - -var ( - background = context.Background() - todo = context.TODO() -) +// +//go:fix inline +func TODO() Context { return context.TODO() } // A CancelFunc tells an operation to abandon its work. // A CancelFunc does not wait for the work to stop. @@ -95,6 +61,8 @@ type CancelFunc = context.CancelFunc // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this [Context] complete. +// +//go:fix inline func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { return context.WithCancel(parent) } @@ -108,6 +76,8 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this [Context] complete. +// +//go:fix inline func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) { return context.WithDeadline(parent, d) } @@ -122,6 +92,8 @@ func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) { // defer cancel() // releases resources if slowOperation completes before timeout elapses // return slowOperation(ctx) // } +// +//go:fix inline func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return context.WithTimeout(parent, timeout) } @@ -139,6 +111,8 @@ func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { // interface{}, context keys often have concrete type // struct{}. Alternatively, exported context key variables' static // type should be a pointer or interface. +// +//go:fix inline func WithValue(parent Context, key, val interface{}) Context { return context.WithValue(parent, key, val) } diff --git a/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go deleted file mode 100644 index 73687de74..000000000 --- a/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.5 - -package plan9 - -import "syscall" - -func fixwd() { - syscall.Fixwd() -} - -func Getwd() (wd string, err error) { - return syscall.Getwd() -} - -func Chdir(path string) error { - return syscall.Chdir(path) -} diff --git a/vendor/golang.org/x/sys/plan9/pwd_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_plan9.go index fb9458218..7a76489db 100644 --- a/vendor/golang.org/x/sys/plan9/pwd_plan9.go +++ b/vendor/golang.org/x/sys/plan9/pwd_plan9.go @@ -2,22 +2,18 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.5 - package plan9 +import "syscall" + func fixwd() { + syscall.Fixwd() } func Getwd() (wd string, err error) { - fd, err := open(".", O_RDONLY) - if err != nil { - return "", err - } - defer Close(fd) - return Fd2path(fd) + return syscall.Getwd() } func Chdir(path string) error { - return chdir(path) + return syscall.Chdir(path) } diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go index 6e5c81acd..3ea470387 100644 --- a/vendor/golang.org/x/sys/unix/affinity_linux.go +++ b/vendor/golang.org/x/sys/unix/affinity_linux.go @@ -38,8 +38,15 @@ func SchedSetaffinity(pid int, set *CPUSet) error { // Zero clears the set s, so that it contains no CPUs. func (s *CPUSet) Zero() { + clear(s[:]) +} + +// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinity] +// will silently ignore any invalid CPU bits in [CPUSet] so this is an +// efficient way of resetting the CPU affinity of a process. +func (s *CPUSet) Fill() { for i := range s { - s[i] = 0 + s[i] = ^cpuMask(0) } } diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go index 9e83d18cd..62ed12645 100644 --- a/vendor/golang.org/x/sys/unix/fdset.go +++ b/vendor/golang.org/x/sys/unix/fdset.go @@ -23,7 +23,5 @@ func (fds *FdSet) IsSet(fd int) bool { // Zero clears the set fds. func (fds *FdSet) Zero() { - for i := range fds.Bits { - fds.Bits[i] = 0 - } + clear(fds.Bits[:]) } diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go index 848840ae4..309f5a2b0 100644 --- a/vendor/golang.org/x/sys/unix/ifreq_linux.go +++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go @@ -111,9 +111,7 @@ func (ifr *Ifreq) SetUint32(v uint32) { // clear zeroes the ifreq's union field to prevent trailing garbage data from // being sent to the kernel if an ifreq is reused. func (ifr *Ifreq) clear() { - for i := range ifr.raw.Ifru { - ifr.raw.Ifru[i] = 0 - } + clear(ifr.raw.Ifru[:]) } // TODO(mdlayher): export as IfreqData? For now we can provide helpers such as diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index e6f31d374..d0ed61191 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -49,6 +49,7 @@ esac if [[ "$GOOS" = "linux" ]]; then # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) + set -e $cmd docker build --tag generate:$GOOS $GOOS $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS exit diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6ab02b6c3..42517077c 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -226,6 +226,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -349,6 +350,9 @@ struct ltchars { #define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN) #define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN) +// Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") +#define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME +#define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION ' includes_NetBSD=' @@ -526,6 +530,7 @@ ccflags="$@" $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || + $2 ~ /^(DT|EI|ELF|EV|NN|NT|PF|SHF|SHN|SHT|STB|STT|VER)_/ || $2 ~ /^O?XTABS$/ || $2 ~ /^TC[IO](ON|OFF)$/ || $2 ~ /^IN_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 798f61ad3..7838ca5db 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,14 +602,9 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) const minIovec = 8 func Readv(fd int, iovs [][]byte) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = readv(fd, iovecs) @@ -618,9 +613,6 @@ func Readv(fd int, iovs [][]byte) (n int, err error) { } func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = preadv(fd, iovecs, offset) @@ -629,10 +621,6 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { } func Writev(fd int, iovs [][]byte) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { @@ -644,10 +632,6 @@ func Writev(fd int, iovs [][]byte) (n int, err error) { } func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { @@ -707,45 +691,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { } } -func darwinMajorMinPatch() (maj, min, patch int, err error) { - var un Utsname - err = Uname(&un) - if err != nil { - return - } - - var mmp [3]int - c := 0 -Loop: - for _, b := range un.Release[:] { - switch { - case b >= '0' && b <= '9': - mmp[c] = 10*mmp[c] + int(b-'0') - case b == '.': - c++ - if c > 2 { - return 0, 0, 0, ENOTSUP - } - case b == 0: - break Loop - default: - return 0, 0, 0, ENOTSUP - } - } - if c != 2 { - return 0, 0, 0, ENOTSUP - } - return mmp[0], mmp[1], mmp[2], nil -} - -func darwinKernelVersionMin(maj, min, patch int) bool { - actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch() - if err != nil { - return false - } - return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch) -} - +//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 4958a6570..06c0eea6f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -801,9 +801,7 @@ func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) { // one. The kernel expects SID to be in network byte order. binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID) copy(sa.raw[8:14], sa.Remote) - for i := 14; i < 14+IFNAMSIZ; i++ { - sa.raw[i] = 0 - } + clear(sa.raw[14 : 14+IFNAMSIZ]) copy(sa.raw[14:], sa.Dev) return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil } @@ -2645,3 +2643,9 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) //sys Mseal(b []byte, flags uint) (err error) + +//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY + +func SetMemPolicy(mode int, mask *CPUSet) error { + return setMemPolicy(mode, mask, _CPU_SETSIZE) +} diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 88162099a..34a467697 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -248,6 +248,23 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { return Statvfs1(path, buf, ST_WAIT) } +func Getvfsstat(buf []Statvfs_t, flags int) (n int, err error) { + var ( + _p0 unsafe.Pointer + bufsize uintptr + ) + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + bufsize = unsafe.Sizeof(Statvfs_t{}) * uintptr(len(buf)) + } + r0, _, e1 := Syscall(SYS_GETVFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = e1 + } + return +} + /* * Exposed directly */ diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index abc395547..18a3d9bda 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -629,7 +629,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Kill(pid int, signum syscall.Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) -//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten +//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_listen //sys Lstat(path string, stat *Stat_t) (err error) //sys Madvise(b []byte, advice int) (err error) //sys Mkdir(path string, mode uint32) (err error) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 4f432bfe8..d0a75da57 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -319,6 +319,7 @@ const ( AUDIT_INTEGRITY_POLICY_RULE = 0x70f AUDIT_INTEGRITY_RULE = 0x70d AUDIT_INTEGRITY_STATUS = 0x70a + AUDIT_INTEGRITY_USERSPACE = 0x710 AUDIT_IPC = 0x517 AUDIT_IPC_SET_PERM = 0x51f AUDIT_IPE_ACCESS = 0x58c @@ -327,6 +328,8 @@ const ( AUDIT_KERNEL = 0x7d0 AUDIT_KERNEL_OTHER = 0x524 AUDIT_KERN_MODULE = 0x532 + AUDIT_LANDLOCK_ACCESS = 0x58f + AUDIT_LANDLOCK_DOMAIN = 0x590 AUDIT_LAST_FEATURE = 0x1 AUDIT_LAST_KERN_ANOM_MSG = 0x707 AUDIT_LAST_USER_MSG = 0x4af @@ -491,6 +494,7 @@ const ( BPF_F_BEFORE = 0x8 BPF_F_ID = 0x20 BPF_F_NETFILTER_IP_DEFRAG = 0x1 + BPF_F_PREORDER = 0x40 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REDIRECT_FLAGS = 0x19 BPF_F_REPLACE = 0x4 @@ -527,6 +531,7 @@ const ( BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LL_OFF = -0x200000 + BPF_LOAD_ACQ = 0x100 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXINSNS = 0x1000 @@ -554,6 +559,7 @@ const ( BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 + BPF_STORE_REL = 0x110 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAG_SIZE = 0x8 @@ -843,24 +849,90 @@ const ( DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 - DM_VERSION_EXTRA = "-ioctl (2023-03-01)" + DM_VERSION_EXTRA = "-ioctl (2025-04-28)" DM_VERSION_MAJOR = 0x4 - DM_VERSION_MINOR = 0x30 + DM_VERSION_MINOR = 0x32 DM_VERSION_PATCHLEVEL = 0x0 + DT_ADDRRNGHI = 0x6ffffeff + DT_ADDRRNGLO = 0x6ffffe00 DT_BLK = 0x6 DT_CHR = 0x2 + DT_DEBUG = 0x15 DT_DIR = 0x4 + DT_ENCODING = 0x20 DT_FIFO = 0x1 + DT_FINI = 0xd + DT_FLAGS_1 = 0x6ffffffb + DT_GNU_HASH = 0x6ffffef5 + DT_HASH = 0x4 + DT_HIOS = 0x6ffff000 + DT_HIPROC = 0x7fffffff + DT_INIT = 0xc + DT_JMPREL = 0x17 DT_LNK = 0xa + DT_LOOS = 0x6000000d + DT_LOPROC = 0x70000000 + DT_NEEDED = 0x1 + DT_NULL = 0x0 + DT_PLTGOT = 0x3 + DT_PLTREL = 0x14 + DT_PLTRELSZ = 0x2 DT_REG = 0x8 + DT_REL = 0x11 + DT_RELA = 0x7 + DT_RELACOUNT = 0x6ffffff9 + DT_RELAENT = 0x9 + DT_RELASZ = 0x8 + DT_RELCOUNT = 0x6ffffffa + DT_RELENT = 0x13 + DT_RELSZ = 0x12 + DT_RPATH = 0xf DT_SOCK = 0xc + DT_SONAME = 0xe + DT_STRSZ = 0xa + DT_STRTAB = 0x5 + DT_SYMBOLIC = 0x10 + DT_SYMENT = 0xb + DT_SYMTAB = 0x6 + DT_TEXTREL = 0x16 DT_UNKNOWN = 0x0 + DT_VALRNGHI = 0x6ffffdff + DT_VALRNGLO = 0x6ffffd00 + DT_VERDEF = 0x6ffffffc + DT_VERDEFNUM = 0x6ffffffd + DT_VERNEED = 0x6ffffffe + DT_VERNEEDNUM = 0x6fffffff + DT_VERSYM = 0x6ffffff0 DT_WHT = 0xe ECHO = 0x8 ECRYPTFS_SUPER_MAGIC = 0xf15f EFD_SEMAPHORE = 0x1 EFIVARFS_MAGIC = 0xde5e81e4 EFS_SUPER_MAGIC = 0x414a53 + EI_CLASS = 0x4 + EI_DATA = 0x5 + EI_MAG0 = 0x0 + EI_MAG1 = 0x1 + EI_MAG2 = 0x2 + EI_MAG3 = 0x3 + EI_NIDENT = 0x10 + EI_OSABI = 0x7 + EI_PAD = 0x8 + EI_VERSION = 0x6 + ELFCLASS32 = 0x1 + ELFCLASS64 = 0x2 + ELFCLASSNONE = 0x0 + ELFCLASSNUM = 0x3 + ELFDATA2LSB = 0x1 + ELFDATA2MSB = 0x2 + ELFDATANONE = 0x0 + ELFMAG = "\177ELF" + ELFMAG0 = 0x7f + ELFMAG1 = 'E' + ELFMAG2 = 'L' + ELFMAG3 = 'F' + ELFOSABI_LINUX = 0x3 + ELFOSABI_NONE = 0x0 EM_386 = 0x3 EM_486 = 0x6 EM_68K = 0x4 @@ -936,11 +1008,10 @@ const ( EPOLL_CTL_MOD = 0x3 EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 - ESP_V4_FLOW = 0xa - ESP_V6_FLOW = 0xc - ETHER_FLOW = 0x12 ETHTOOL_BUSINFO_LEN = 0x20 ETHTOOL_EROMVERS_LEN = 0x20 + ETHTOOL_FAMILY_NAME = "ethtool" + ETHTOOL_FAMILY_VERSION = 0x1 ETHTOOL_FEC_AUTO = 0x2 ETHTOOL_FEC_BASER = 0x10 ETHTOOL_FEC_LLRS = 0x20 @@ -1147,14 +1218,24 @@ const ( ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 + ET_CORE = 0x4 + ET_DYN = 0x3 + ET_EXEC = 0x2 + ET_HIPROC = 0xffff + ET_LOPROC = 0xff00 + ET_NONE = 0x0 + ET_REL = 0x1 EV_ABS = 0x3 EV_CNT = 0x20 + EV_CURRENT = 0x1 EV_FF = 0x15 EV_FF_STATUS = 0x17 EV_KEY = 0x1 EV_LED = 0x11 EV_MAX = 0x1f EV_MSC = 0x4 + EV_NONE = 0x0 + EV_NUM = 0x2 EV_PWR = 0x16 EV_REL = 0x2 EV_REP = 0x14 @@ -1203,13 +1284,18 @@ const ( FAN_DENY = 0x2 FAN_ENABLE_AUDIT = 0x40 FAN_EPIDFD = -0x2 + FAN_ERRNO_BITS = 0x8 + FAN_ERRNO_MASK = 0xff + FAN_ERRNO_SHIFT = 0x18 FAN_EVENT_INFO_TYPE_DFID = 0x3 FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 + FAN_EVENT_INFO_TYPE_MNT = 0x7 FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 + FAN_EVENT_INFO_TYPE_RANGE = 0x6 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 FAN_FS_ERROR = 0x8000 @@ -1224,9 +1310,12 @@ const ( FAN_MARK_IGNORED_SURV_MODIFY = 0x40 FAN_MARK_IGNORE_SURV = 0x440 FAN_MARK_INODE = 0x0 + FAN_MARK_MNTNS = 0x110 FAN_MARK_MOUNT = 0x10 FAN_MARK_ONLYDIR = 0x8 FAN_MARK_REMOVE = 0x2 + FAN_MNT_ATTACH = 0x1000000 + FAN_MNT_DETACH = 0x2000000 FAN_MODIFY = 0x2 FAN_MOVE = 0xc0 FAN_MOVED_FROM = 0x40 @@ -1240,6 +1329,7 @@ const ( FAN_OPEN_EXEC = 0x1000 FAN_OPEN_EXEC_PERM = 0x40000 FAN_OPEN_PERM = 0x10000 + FAN_PRE_ACCESS = 0x100000 FAN_Q_OVERFLOW = 0x4000 FAN_RENAME = 0x10000000 FAN_REPORT_DFID_NAME = 0xc00 @@ -1247,6 +1337,7 @@ const ( FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FD_ERROR = 0x2000 FAN_REPORT_FID = 0x200 + FAN_REPORT_MNT = 0x4000 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 FAN_REPORT_TARGET_FID = 0x1000 @@ -1266,6 +1357,7 @@ const ( FIB_RULE_PERMANENT = 0x1 FIB_RULE_UNRESOLVED = 0x4 FIDEDUPERANGE = 0xc0189436 + FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED = 0x1 FSCRYPT_KEY_DESCRIPTOR_SIZE = 0x8 FSCRYPT_KEY_DESC_PREFIX = "fscrypt:" FSCRYPT_KEY_DESC_PREFIX_SIZE = 0x8 @@ -1574,7 +1666,6 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b - IPV6_FLOW = 0x11 IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 @@ -1625,7 +1716,6 @@ const ( IPV6_TRANSPARENT = 0x4b IPV6_UNICAST_HOPS = 0x10 IPV6_UNICAST_IF = 0x4c - IPV6_USER_FLOW = 0xe IPV6_V6ONLY = 0x1a IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 @@ -1687,7 +1777,6 @@ const ( IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 IP_UNICAST_IF = 0x32 - IP_USER_FLOW = 0xd IP_XFRM_POLICY = 0x11 ISOFS_SUPER_MAGIC = 0x9660 ISTRIP = 0x20 @@ -1809,7 +1898,11 @@ const ( LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2 LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 + LANDLOCK_CREATE_RULESET_ERRATA = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 + LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 @@ -2259,7 +2352,167 @@ const ( NLM_F_REPLACE = 0x100 NLM_F_REQUEST = 0x1 NLM_F_ROOT = 0x100 + NN_386_IOPERM = "LINUX" + NN_386_TLS = "LINUX" + NN_ARC_V2 = "LINUX" + NN_ARM_FPMR = "LINUX" + NN_ARM_GCS = "LINUX" + NN_ARM_HW_BREAK = "LINUX" + NN_ARM_HW_WATCH = "LINUX" + NN_ARM_PACA_KEYS = "LINUX" + NN_ARM_PACG_KEYS = "LINUX" + NN_ARM_PAC_ENABLED_KEYS = "LINUX" + NN_ARM_PAC_MASK = "LINUX" + NN_ARM_POE = "LINUX" + NN_ARM_SSVE = "LINUX" + NN_ARM_SVE = "LINUX" + NN_ARM_SYSTEM_CALL = "LINUX" + NN_ARM_TAGGED_ADDR_CTRL = "LINUX" + NN_ARM_TLS = "LINUX" + NN_ARM_VFP = "LINUX" + NN_ARM_ZA = "LINUX" + NN_ARM_ZT = "LINUX" + NN_AUXV = "CORE" + NN_FILE = "CORE" + NN_GNU_PROPERTY_TYPE_0 = "GNU" + NN_LOONGARCH_CPUCFG = "LINUX" + NN_LOONGARCH_CSR = "LINUX" + NN_LOONGARCH_HW_BREAK = "LINUX" + NN_LOONGARCH_HW_WATCH = "LINUX" + NN_LOONGARCH_LASX = "LINUX" + NN_LOONGARCH_LBT = "LINUX" + NN_LOONGARCH_LSX = "LINUX" + NN_MIPS_DSP = "LINUX" + NN_MIPS_FP_MODE = "LINUX" + NN_MIPS_MSA = "LINUX" + NN_PPC_DEXCR = "LINUX" + NN_PPC_DSCR = "LINUX" + NN_PPC_EBB = "LINUX" + NN_PPC_HASHKEYR = "LINUX" + NN_PPC_PKEY = "LINUX" + NN_PPC_PMU = "LINUX" + NN_PPC_PPR = "LINUX" + NN_PPC_SPE = "LINUX" + NN_PPC_TAR = "LINUX" + NN_PPC_TM_CDSCR = "LINUX" + NN_PPC_TM_CFPR = "LINUX" + NN_PPC_TM_CGPR = "LINUX" + NN_PPC_TM_CPPR = "LINUX" + NN_PPC_TM_CTAR = "LINUX" + NN_PPC_TM_CVMX = "LINUX" + NN_PPC_TM_CVSX = "LINUX" + NN_PPC_TM_SPR = "LINUX" + NN_PPC_VMX = "LINUX" + NN_PPC_VSX = "LINUX" + NN_PRFPREG = "CORE" + NN_PRPSINFO = "CORE" + NN_PRSTATUS = "CORE" + NN_PRXFPREG = "LINUX" + NN_RISCV_CSR = "LINUX" + NN_RISCV_TAGGED_ADDR_CTRL = "LINUX" + NN_RISCV_VECTOR = "LINUX" + NN_S390_CTRS = "LINUX" + NN_S390_GS_BC = "LINUX" + NN_S390_GS_CB = "LINUX" + NN_S390_HIGH_GPRS = "LINUX" + NN_S390_LAST_BREAK = "LINUX" + NN_S390_PREFIX = "LINUX" + NN_S390_PV_CPU_DATA = "LINUX" + NN_S390_RI_CB = "LINUX" + NN_S390_SYSTEM_CALL = "LINUX" + NN_S390_TDB = "LINUX" + NN_S390_TIMER = "LINUX" + NN_S390_TODCMP = "LINUX" + NN_S390_TODPREG = "LINUX" + NN_S390_VXRS_HIGH = "LINUX" + NN_S390_VXRS_LOW = "LINUX" + NN_SIGINFO = "CORE" + NN_TASKSTRUCT = "CORE" + NN_VMCOREDD = "LINUX" + NN_X86_SHSTK = "LINUX" + NN_X86_XSAVE_LAYOUT = "LINUX" + NN_X86_XSTATE = "LINUX" NSFS_MAGIC = 0x6e736673 + NT_386_IOPERM = 0x201 + NT_386_TLS = 0x200 + NT_ARC_V2 = 0x600 + NT_ARM_FPMR = 0x40e + NT_ARM_GCS = 0x410 + NT_ARM_HW_BREAK = 0x402 + NT_ARM_HW_WATCH = 0x403 + NT_ARM_PACA_KEYS = 0x407 + NT_ARM_PACG_KEYS = 0x408 + NT_ARM_PAC_ENABLED_KEYS = 0x40a + NT_ARM_PAC_MASK = 0x406 + NT_ARM_POE = 0x40f + NT_ARM_SSVE = 0x40b + NT_ARM_SVE = 0x405 + NT_ARM_SYSTEM_CALL = 0x404 + NT_ARM_TAGGED_ADDR_CTRL = 0x409 + NT_ARM_TLS = 0x401 + NT_ARM_VFP = 0x400 + NT_ARM_ZA = 0x40c + NT_ARM_ZT = 0x40d + NT_AUXV = 0x6 + NT_FILE = 0x46494c45 + NT_GNU_PROPERTY_TYPE_0 = 0x5 + NT_LOONGARCH_CPUCFG = 0xa00 + NT_LOONGARCH_CSR = 0xa01 + NT_LOONGARCH_HW_BREAK = 0xa05 + NT_LOONGARCH_HW_WATCH = 0xa06 + NT_LOONGARCH_LASX = 0xa03 + NT_LOONGARCH_LBT = 0xa04 + NT_LOONGARCH_LSX = 0xa02 + NT_MIPS_DSP = 0x800 + NT_MIPS_FP_MODE = 0x801 + NT_MIPS_MSA = 0x802 + NT_PPC_DEXCR = 0x111 + NT_PPC_DSCR = 0x105 + NT_PPC_EBB = 0x106 + NT_PPC_HASHKEYR = 0x112 + NT_PPC_PKEY = 0x110 + NT_PPC_PMU = 0x107 + NT_PPC_PPR = 0x104 + NT_PPC_SPE = 0x101 + NT_PPC_TAR = 0x103 + NT_PPC_TM_CDSCR = 0x10f + NT_PPC_TM_CFPR = 0x109 + NT_PPC_TM_CGPR = 0x108 + NT_PPC_TM_CPPR = 0x10e + NT_PPC_TM_CTAR = 0x10d + NT_PPC_TM_CVMX = 0x10a + NT_PPC_TM_CVSX = 0x10b + NT_PPC_TM_SPR = 0x10c + NT_PPC_VMX = 0x100 + NT_PPC_VSX = 0x102 + NT_PRFPREG = 0x2 + NT_PRPSINFO = 0x3 + NT_PRSTATUS = 0x1 + NT_PRXFPREG = 0x46e62b7f + NT_RISCV_CSR = 0x900 + NT_RISCV_TAGGED_ADDR_CTRL = 0x902 + NT_RISCV_VECTOR = 0x901 + NT_S390_CTRS = 0x304 + NT_S390_GS_BC = 0x30c + NT_S390_GS_CB = 0x30b + NT_S390_HIGH_GPRS = 0x300 + NT_S390_LAST_BREAK = 0x306 + NT_S390_PREFIX = 0x305 + NT_S390_PV_CPU_DATA = 0x30e + NT_S390_RI_CB = 0x30d + NT_S390_SYSTEM_CALL = 0x307 + NT_S390_TDB = 0x308 + NT_S390_TIMER = 0x301 + NT_S390_TODCMP = 0x302 + NT_S390_TODPREG = 0x303 + NT_S390_VXRS_HIGH = 0x30a + NT_S390_VXRS_LOW = 0x309 + NT_SIGINFO = 0x53494749 + NT_TASKSTRUCT = 0x4 + NT_VMCOREDD = 0x700 + NT_X86_SHSTK = 0x204 + NT_X86_XSAVE_LAYOUT = 0x205 + NT_X86_XSTATE = 0x202 OCFS2_SUPER_MAGIC = 0x7461636f OCRNL = 0x8 OFDEL = 0x80 @@ -2446,6 +2699,59 @@ const ( PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 + PF_ALG = 0x26 + PF_APPLETALK = 0x5 + PF_ASH = 0x12 + PF_ATMPVC = 0x8 + PF_ATMSVC = 0x14 + PF_AX25 = 0x3 + PF_BLUETOOTH = 0x1f + PF_BRIDGE = 0x7 + PF_CAIF = 0x25 + PF_CAN = 0x1d + PF_DECnet = 0xc + PF_ECONET = 0x13 + PF_FILE = 0x1 + PF_IB = 0x1b + PF_IEEE802154 = 0x24 + PF_INET = 0x2 + PF_INET6 = 0xa + PF_IPX = 0x4 + PF_IRDA = 0x17 + PF_ISDN = 0x22 + PF_IUCV = 0x20 + PF_KCM = 0x29 + PF_KEY = 0xf + PF_LLC = 0x1a + PF_LOCAL = 0x1 + PF_MAX = 0x2e + PF_MCTP = 0x2d + PF_MPLS = 0x1c + PF_NETBEUI = 0xd + PF_NETLINK = 0x10 + PF_NETROM = 0x6 + PF_NFC = 0x27 + PF_PACKET = 0x11 + PF_PHONET = 0x23 + PF_PPPOX = 0x18 + PF_QIPCRTR = 0x2a + PF_R = 0x4 + PF_RDS = 0x15 + PF_ROSE = 0xb + PF_ROUTE = 0x10 + PF_RXRPC = 0x21 + PF_SECURITY = 0xe + PF_SMC = 0x2b + PF_SNA = 0x16 + PF_TIPC = 0x1e + PF_UNIX = 0x1 + PF_UNSPEC = 0x0 + PF_VSOCK = 0x28 + PF_W = 0x2 + PF_WANPIPE = 0x19 + PF_X = 0x1 + PF_X25 = 0x9 + PF_XDP = 0x2c PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c @@ -2485,6 +2791,10 @@ const ( PR_FP_EXC_UND = 0x40000 PR_FP_MODE_FR = 0x1 PR_FP_MODE_FRE = 0x2 + PR_FUTEX_HASH = 0x4e + PR_FUTEX_HASH_GET_IMMUTABLE = 0x3 + PR_FUTEX_HASH_GET_SLOTS = 0x2 + PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 @@ -2644,6 +2954,10 @@ const ( PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_TIMER_CREATE_RESTORE_IDS = 0x4d + PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 + PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 + PR_TIMER_CREATE_RESTORE_IDS_ON = 0x1 PR_TIMING_STATISTICAL = 0x0 PR_TIMING_TIMESTAMP = 0x1 PR_TSC_ENABLE = 0x1 @@ -2724,6 +3038,7 @@ const ( PTRACE_SETREGSET = 0x4205 PTRACE_SETSIGINFO = 0x4203 PTRACE_SETSIGMASK = 0x420b + PTRACE_SET_SYSCALL_INFO = 0x4212 PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210 PTRACE_SINGLESTEP = 0x9 PTRACE_SYSCALL = 0x18 @@ -2732,6 +3047,23 @@ const ( PTRACE_SYSCALL_INFO_NONE = 0x0 PTRACE_SYSCALL_INFO_SECCOMP = 0x3 PTRACE_TRACEME = 0x0 + PT_AARCH64_MEMTAG_MTE = 0x70000002 + PT_DYNAMIC = 0x2 + PT_GNU_EH_FRAME = 0x6474e550 + PT_GNU_PROPERTY = 0x6474e553 + PT_GNU_RELRO = 0x6474e552 + PT_GNU_STACK = 0x6474e551 + PT_HIOS = 0x6fffffff + PT_HIPROC = 0x7fffffff + PT_INTERP = 0x3 + PT_LOAD = 0x1 + PT_LOOS = 0x60000000 + PT_LOPROC = 0x70000000 + PT_NOTE = 0x4 + PT_NULL = 0x0 + PT_PHDR = 0x6 + PT_SHLIB = 0x5 + PT_TLS = 0x7 P_ALL = 0x0 P_PGID = 0x2 P_PID = 0x1 @@ -2787,7 +3119,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1e + RTA_MAX = 0x1f RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -2864,10 +3196,12 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELANYCAST = 0x3d RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 + RTM_DELMULTICAST = 0x39 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 RTM_DELNEXTHOP = 0x69 @@ -2917,11 +3251,13 @@ const ( RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 + RTM_NEWANYCAST = 0x3c RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 + RTM_NEWMULTICAST = 0x38 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c RTM_NEWNEIGHTBL = 0x40 @@ -2970,6 +3306,7 @@ const ( RTPROT_NTK = 0xf RTPROT_OPENR = 0x63 RTPROT_OSPF = 0xbc + RTPROT_OVN = 0x54 RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 RTPROT_RIP = 0xbd @@ -2987,11 +3324,12 @@ const ( RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 RWF_ATOMIC = 0x40 + RWF_DONTCACHE = 0x80 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x7f + RWF_SUPPORTED = 0xff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3059,6 +3397,47 @@ const ( SEEK_MAX = 0x4 SEEK_SET = 0x0 SELINUX_MAGIC = 0xf97cff8c + SHF_ALLOC = 0x2 + SHF_EXCLUDE = 0x8000000 + SHF_EXECINSTR = 0x4 + SHF_GROUP = 0x200 + SHF_INFO_LINK = 0x40 + SHF_LINK_ORDER = 0x80 + SHF_MASKOS = 0xff00000 + SHF_MASKPROC = 0xf0000000 + SHF_MERGE = 0x10 + SHF_ORDERED = 0x4000000 + SHF_OS_NONCONFORMING = 0x100 + SHF_RELA_LIVEPATCH = 0x100000 + SHF_RO_AFTER_INIT = 0x200000 + SHF_STRINGS = 0x20 + SHF_TLS = 0x400 + SHF_WRITE = 0x1 + SHN_ABS = 0xfff1 + SHN_COMMON = 0xfff2 + SHN_HIPROC = 0xff1f + SHN_HIRESERVE = 0xffff + SHN_LIVEPATCH = 0xff20 + SHN_LOPROC = 0xff00 + SHN_LORESERVE = 0xff00 + SHN_UNDEF = 0x0 + SHT_DYNAMIC = 0x6 + SHT_DYNSYM = 0xb + SHT_HASH = 0x5 + SHT_HIPROC = 0x7fffffff + SHT_HIUSER = 0xffffffff + SHT_LOPROC = 0x70000000 + SHT_LOUSER = 0x80000000 + SHT_NOBITS = 0x8 + SHT_NOTE = 0x7 + SHT_NULL = 0x0 + SHT_NUM = 0xc + SHT_PROGBITS = 0x1 + SHT_REL = 0x9 + SHT_RELA = 0x4 + SHT_SHLIB = 0xa + SHT_STRTAB = 0x3 + SHT_SYMTAB = 0x2 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 @@ -3271,6 +3650,7 @@ const ( STATX_BTIME = 0x800 STATX_CTIME = 0x80 STATX_DIOALIGN = 0x2000 + STATX_DIO_READ_ALIGN = 0x20000 STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 @@ -3284,6 +3664,16 @@ const ( STATX_UID = 0x8 STATX_WRITE_ATOMIC = 0x10000 STATX__RESERVED = 0x80000000 + STB_GLOBAL = 0x1 + STB_LOCAL = 0x0 + STB_WEAK = 0x2 + STT_COMMON = 0x5 + STT_FILE = 0x4 + STT_FUNC = 0x2 + STT_NOTYPE = 0x0 + STT_OBJECT = 0x1 + STT_SECTION = 0x3 + STT_TLS = 0x6 SYNC_FILE_RANGE_WAIT_AFTER = 0x4 SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 SYNC_FILE_RANGE_WRITE = 0x2 @@ -3322,7 +3712,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0xe + TASKSTATS_VERSION = 0x10 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -3392,8 +3782,6 @@ const ( TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 - TCP_V4_FLOW = 0x1 - TCP_V6_FLOW = 0x5 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 TFD_TIMER_ABSTIME = 0x1 @@ -3503,6 +3891,7 @@ const ( TP_STATUS_WRONG_FORMAT = 0x4 TRACEFS_MAGIC = 0x74726163 TS_COMM_LEN = 0x20 + UBI_IOCECNFO = 0xc01c6f06 UDF_SUPER_MAGIC = 0x15013346 UDP_CORK = 0x1 UDP_ENCAP = 0x64 @@ -3515,14 +3904,14 @@ const ( UDP_NO_CHECK6_RX = 0x66 UDP_NO_CHECK6_TX = 0x65 UDP_SEGMENT = 0x67 - UDP_V4_FLOW = 0x2 - UDP_V6_FLOW = 0x6 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 UTIME_NOW = 0x3fffffff UTIME_OMIT = 0x3ffffffe V9FS_MAGIC = 0x1021997 VERASE = 0x2 + VER_FLG_BASE = 0x1 + VER_FLG_WEAK = 0x2 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xf @@ -3559,7 +3948,7 @@ const ( WDIOS_TEMPPANIC = 0x4 WDIOS_UNKNOWN = -0x1 WEXITED = 0x4 - WGALLOWEDIP_A_MAX = 0x3 + WGALLOWEDIP_A_MAX = 0x4 WGDEVICE_A_MAX = 0x8 WGPEER_A_MAX = 0xa WG_CMD_MAX = 0x1 @@ -3673,6 +4062,7 @@ const ( XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 XDP_TXMD_FLAGS_CHECKSUM = 0x2 + XDP_TXMD_FLAGS_LAUNCH_TIME = 0x4 XDP_TXMD_FLAGS_TIMESTAMP = 0x1 XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 75207613c..1c37f9fbc 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -360,6 +361,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -372,6 +374,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c68acda53..6f54d34ae 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -361,6 +362,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -373,6 +375,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index a8c607ab8..783ec5c12 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -366,6 +367,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -378,6 +380,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 18563dd8d..ca83d3ba1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 22912cdaa..607e611c0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -353,6 +354,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -365,6 +367,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 29344eb37..b9cb5bd3c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 20d51fb96..65b078a63 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 321b60902..5298a3033 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 9bacdf1e2..7bc557c87 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c22427261..152399bb0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -414,6 +415,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -426,6 +428,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 6270c8ee1..1a1ce2409 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -430,6 +432,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 9966c1941..4231a1fb5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -430,6 +432,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 848e5fcc4..21c0e9526 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -350,6 +351,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -362,6 +364,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 669b2adb8..f00d1cd7c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -422,6 +423,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -434,6 +436,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 4834e5751..bc8d539e6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -71,6 +71,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -461,6 +462,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x2 SO_PASSPIDFD = 0x55 + SO_PASSRIGHTS = 0x5c SO_PASSSEC = 0x1f SO_PEEK_OFF = 0x26 SO_PEERCRED = 0x40 @@ -473,6 +475,7 @@ const ( SO_RCVBUFFORCE = 0x100b SO_RCVLOWAT = 0x800 SO_RCVMARK = 0x54 + SO_RCVPRIORITY = 0x5b SO_RCVTIMEO = 0x2000 SO_RCVTIMEO_NEW = 0x44 SO_RCVTIMEO_OLD = 0x2000 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 5cc1e8eb2..8935d10a3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2238,3 +2238,13 @@ func Mseal(b []byte, flags uint) (err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setMemPolicy(mode int, mask *CPUSet, size int) (err error) { + _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index c6545413c..b4609c20c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -72,7 +72,7 @@ import ( //go:cgo_import_dynamic libc_kill kill "libc.so" //go:cgo_import_dynamic libc_lchown lchown "libc.so" //go:cgo_import_dynamic libc_link link "libc.so" -//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so" +//go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so" //go:cgo_import_dynamic libc_lstat lstat "libc.so" //go:cgo_import_dynamic libc_madvise madvise "libc.so" //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" @@ -221,7 +221,7 @@ import ( //go:linkname procKill libc_kill //go:linkname procLchown libc_lchown //go:linkname procLink libc_link -//go:linkname proc__xnet_llisten libc___xnet_llisten +//go:linkname proc__xnet_listen libc___xnet_listen //go:linkname procLstat libc_lstat //go:linkname procMadvise libc_madvise //go:linkname procMkdir libc_mkdir @@ -371,7 +371,7 @@ var ( procKill, procLchown, procLink, - proc__xnet_llisten, + proc__xnet_listen, procLstat, procMadvise, procMkdir, @@ -1178,7 +1178,7 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index c79aaff30..aca56ee49 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -462,4 +462,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 5eb450695..2ea1ef58c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -385,4 +385,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 05e502974..d22c8af31 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -426,4 +426,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 38c53ec51..5ee264ae9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -329,4 +329,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 31d2e71a1..f9f03ebf5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -325,4 +325,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index f4184a336..87c2118e8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 05b996227..391ad102f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 43a256e9e..565615775 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index eea5ddfc2..0482b52e3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 0d777bfbb..71806f08f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -453,4 +453,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index b44636502..e35a71058 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 0c7d21c18..2aea47670 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 840539169..6c9bb4e56 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -330,4 +330,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index fcf1b790d..680bc9915 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -391,4 +391,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 52d15b5f9..620f27105 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -404,4 +404,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index a46abe647..c1a467017 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -114,8 +114,10 @@ type Statx_t struct { Atomic_write_unit_min uint32 Atomic_write_unit_max uint32 Atomic_write_segments_max uint32 + Dio_read_offset_align uint32 + Atomic_write_unit_max_opt uint32 _ [1]uint32 - _ [9]uint64 + _ [8]uint64 } type Fsid struct { @@ -199,7 +201,8 @@ type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 Key_id uint32 - _ [8]uint32 + Flags uint32 + _ [7]uint32 } type FscryptRemoveKeyArg struct { @@ -629,6 +632,8 @@ const ( IFA_FLAGS = 0x8 IFA_RT_PRIORITY = 0x9 IFA_TARGET_NETNSID = 0xa + IFAL_LABEL = 0x2 + IFAL_ADDRESS = 0x1 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -686,6 +691,7 @@ const ( SizeofRtAttr = 0x4 SizeofIfInfomsg = 0x10 SizeofIfAddrmsg = 0x8 + SizeofIfAddrlblmsg = 0xc SizeofIfaCacheinfo = 0x10 SizeofRtMsg = 0xc SizeofRtNexthop = 0x8 @@ -737,6 +743,15 @@ type IfAddrmsg struct { Index uint32 } +type IfAddrlblmsg struct { + Family uint8 + _ uint8 + Prefixlen uint8 + Flags uint8 + Index uint32 + Seq uint32 +} + type IfaCacheinfo struct { Prefered uint32 Valid uint32 @@ -2226,8 +2241,11 @@ const ( NFT_PAYLOAD_LL_HEADER = 0x0 NFT_PAYLOAD_NETWORK_HEADER = 0x1 NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 + NFT_PAYLOAD_INNER_HEADER = 0x3 + NFT_PAYLOAD_TUN_HEADER = 0x4 NFT_PAYLOAD_CSUM_NONE = 0x0 NFT_PAYLOAD_CSUM_INET = 0x1 + NFT_PAYLOAD_CSUM_SCTP = 0x2 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 NFTA_PAYLOAD_UNSPEC = 0x0 NFTA_PAYLOAD_DREG = 0x1 @@ -2314,6 +2332,11 @@ const ( NFT_CT_AVGPKT = 0x10 NFT_CT_ZONE = 0x11 NFT_CT_EVENTMASK = 0x12 + NFT_CT_SRC_IP = 0x13 + NFT_CT_DST_IP = 0x14 + NFT_CT_SRC_IP6 = 0x15 + NFT_CT_DST_IP6 = 0x16 + NFT_CT_ID = 0x17 NFTA_CT_UNSPEC = 0x0 NFTA_CT_DREG = 0x1 NFTA_CT_KEY = 0x2 @@ -2594,8 +2617,8 @@ const ( SOF_TIMESTAMPING_BIND_PHC = 0x8000 SOF_TIMESTAMPING_OPT_ID_TCP = 0x10000 - SOF_TIMESTAMPING_LAST = 0x20000 - SOF_TIMESTAMPING_MASK = 0x3ffff + SOF_TIMESTAMPING_LAST = 0x40000 + SOF_TIMESTAMPING_MASK = 0x7ffff SCM_TSTAMP_SND = 0x0 SCM_TSTAMP_SCHED = 0x1 @@ -3041,6 +3064,23 @@ const ( ) const ( + TCA_UNSPEC = 0x0 + TCA_KIND = 0x1 + TCA_OPTIONS = 0x2 + TCA_STATS = 0x3 + TCA_XSTATS = 0x4 + TCA_RATE = 0x5 + TCA_FCNT = 0x6 + TCA_STATS2 = 0x7 + TCA_STAB = 0x8 + TCA_PAD = 0x9 + TCA_DUMP_INVISIBLE = 0xa + TCA_CHAIN = 0xb + TCA_HW_OFFLOAD = 0xc + TCA_INGRESS_BLOCK = 0xd + TCA_EGRESS_BLOCK = 0xe + TCA_DUMP_FLAGS = 0xf + TCA_EXT_WARN_MSG = 0x10 RTNLGRP_NONE = 0x0 RTNLGRP_LINK = 0x1 RTNLGRP_NOTIFY = 0x2 @@ -3075,6 +3115,18 @@ const ( RTNLGRP_IPV6_MROUTE_R = 0x1f RTNLGRP_NEXTHOP = 0x20 RTNLGRP_BRVLAN = 0x21 + RTNLGRP_MCTP_IFADDR = 0x22 + RTNLGRP_TUNNEL = 0x23 + RTNLGRP_STATS = 0x24 + RTNLGRP_IPV4_MCADDR = 0x25 + RTNLGRP_IPV6_MCADDR = 0x26 + RTNLGRP_IPV6_ACADDR = 0x27 + TCA_ROOT_UNSPEC = 0x0 + TCA_ROOT_TAB = 0x1 + TCA_ROOT_FLAGS = 0x2 + TCA_ROOT_COUNT = 0x3 + TCA_ROOT_TIME_DELTA = 0x4 + TCA_ROOT_EXT_WARN_MSG = 0x5 ) type CapUserHeader struct { @@ -3538,6 +3590,8 @@ type Nhmsg struct { Flags uint32 } +const SizeofNhmsg = 0x8 + type NexthopGrp struct { Id uint32 Weight uint8 @@ -3545,6 +3599,8 @@ type NexthopGrp struct { Resvd2 uint16 } +const SizeofNexthopGrp = 0x8 + const ( NHA_UNSPEC = 0x0 NHA_ID = 0x1 @@ -3802,7 +3858,16 @@ const ( ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 - ETHTOOL_MSG_USER_MAX = 0x2d + ETHTOOL_MSG_PLCA_GET_CFG = 0x27 + ETHTOOL_MSG_PLCA_SET_CFG = 0x28 + ETHTOOL_MSG_PLCA_GET_STATUS = 0x29 + ETHTOOL_MSG_MM_GET = 0x2a + ETHTOOL_MSG_MM_SET = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_ACT = 0x2c + ETHTOOL_MSG_PHY_GET = 0x2d + ETHTOOL_MSG_TSCONFIG_GET = 0x2e + ETHTOOL_MSG_TSCONFIG_SET = 0x2f + ETHTOOL_MSG_USER_MAX = 0x2f ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3842,7 +3907,17 @@ const ( ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 - ETHTOOL_MSG_KERNEL_MAX = 0x2e + ETHTOOL_MSG_PLCA_GET_CFG_REPLY = 0x27 + ETHTOOL_MSG_PLCA_GET_STATUS_REPLY = 0x28 + ETHTOOL_MSG_PLCA_NTF = 0x29 + ETHTOOL_MSG_MM_GET_REPLY = 0x2a + ETHTOOL_MSG_MM_NTF = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_NTF = 0x2c + ETHTOOL_MSG_PHY_GET_REPLY = 0x2d + ETHTOOL_MSG_PHY_NTF = 0x2e + ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f + ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 + ETHTOOL_MSG_KERNEL_MAX = 0x30 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 @@ -3949,7 +4024,12 @@ const ( ETHTOOL_A_RINGS_TCP_DATA_SPLIT = 0xb ETHTOOL_A_RINGS_CQE_SIZE = 0xc ETHTOOL_A_RINGS_TX_PUSH = 0xd - ETHTOOL_A_RINGS_MAX = 0x10 + ETHTOOL_A_RINGS_RX_PUSH = 0xe + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN = 0xf + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX = 0x10 + ETHTOOL_A_RINGS_HDS_THRESH = 0x11 + ETHTOOL_A_RINGS_HDS_THRESH_MAX = 0x12 + ETHTOOL_A_RINGS_MAX = 0x12 ETHTOOL_A_CHANNELS_UNSPEC = 0x0 ETHTOOL_A_CHANNELS_HEADER = 0x1 ETHTOOL_A_CHANNELS_RX_MAX = 0x2 @@ -4015,7 +4095,9 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x6 + ETHTOOL_A_TSINFO_STATS = 0x6 + ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER = 0x7 + ETHTOOL_A_TSINFO_MAX = 0x9 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4101,6 +4183,19 @@ const ( ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 ) +const ( + TCP_V4_FLOW = 0x1 + UDP_V4_FLOW = 0x2 + TCP_V6_FLOW = 0x5 + UDP_V6_FLOW = 0x6 + ESP_V4_FLOW = 0xa + ESP_V6_FLOW = 0xc + IP_USER_FLOW = 0xd + IPV6_USER_FLOW = 0xe + IPV6_FLOW = 0x11 + ETHER_FLOW = 0x12 +) + const SPEED_UNKNOWN = -0x1 type EthtoolDrvinfo struct { @@ -4613,6 +4708,7 @@ const ( NL80211_ATTR_AKM_SUITES = 0x4c NL80211_ATTR_AP_ISOLATE = 0x60 NL80211_ATTR_AP_SETTINGS_FLAGS = 0x135 + NL80211_ATTR_ASSOC_SPP_AMSDU = 0x14a NL80211_ATTR_AUTH_DATA = 0x9c NL80211_ATTR_AUTH_TYPE = 0x35 NL80211_ATTR_BANDS = 0xef @@ -4623,6 +4719,7 @@ const ( NL80211_ATTR_BSS_BASIC_RATES = 0x24 NL80211_ATTR_BSS = 0x2f NL80211_ATTR_BSS_CTS_PROT = 0x1c + NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA = 0x147 NL80211_ATTR_BSS_HT_OPMODE = 0x6d NL80211_ATTR_BSSID = 0xf5 NL80211_ATTR_BSS_SELECT = 0xe3 @@ -4682,6 +4779,7 @@ const ( NL80211_ATTR_DTIM_PERIOD = 0xd NL80211_ATTR_DURATION = 0x57 NL80211_ATTR_EHT_CAPABILITY = 0x136 + NL80211_ATTR_EMA_RNR_ELEMS = 0x145 NL80211_ATTR_EML_CAPABILITY = 0x13d NL80211_ATTR_EXT_CAPA = 0xa9 NL80211_ATTR_EXT_CAPA_MASK = 0xaa @@ -4717,6 +4815,7 @@ const ( NL80211_ATTR_HIDDEN_SSID = 0x7e NL80211_ATTR_HT_CAPABILITY = 0x1f NL80211_ATTR_HT_CAPABILITY_MASK = 0x94 + NL80211_ATTR_HW_TIMESTAMP_ENABLED = 0x144 NL80211_ATTR_IE_ASSOC_RESP = 0x80 NL80211_ATTR_IE = 0x2a NL80211_ATTR_IE_PROBE_RESP = 0x7f @@ -4747,9 +4846,10 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14d + NL80211_ATTR_MAX = 0x151 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce + NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 NL80211_ATTR_MAX_MATCH_SETS = 0x85 NL80211_ATTR_MAX_NUM_AKM_SUITES = 0x13c NL80211_ATTR_MAX_NUM_PMKIDS = 0x56 @@ -4774,9 +4874,12 @@ const ( NL80211_ATTR_MGMT_SUBTYPE = 0x29 NL80211_ATTR_MLD_ADDR = 0x13a NL80211_ATTR_MLD_CAPA_AND_OPS = 0x13e + NL80211_ATTR_MLO_LINK_DISABLED = 0x146 NL80211_ATTR_MLO_LINK_ID = 0x139 NL80211_ATTR_MLO_LINKS = 0x138 NL80211_ATTR_MLO_SUPPORT = 0x13b + NL80211_ATTR_MLO_TTLM_DLINK = 0x148 + NL80211_ATTR_MLO_TTLM_ULINK = 0x149 NL80211_ATTR_MNTR_FLAGS = 0x17 NL80211_ATTR_MPATH_INFO = 0x1b NL80211_ATTR_MPATH_NEXT_HOP = 0x1a @@ -4809,12 +4912,14 @@ const ( NL80211_ATTR_PORT_AUTHORIZED = 0x103 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN = 0x5 NL80211_ATTR_POWER_RULE_MAX_EIRP = 0x6 + NL80211_ATTR_POWER_RULE_PSD = 0x8 NL80211_ATTR_PREV_BSSID = 0x4f NL80211_ATTR_PRIVACY = 0x46 NL80211_ATTR_PROBE_RESP = 0x91 NL80211_ATTR_PROBE_RESP_OFFLOAD = 0x90 NL80211_ATTR_PROTOCOL_FEATURES = 0xad NL80211_ATTR_PS_STATE = 0x5d + NL80211_ATTR_PUNCT_BITMAP = 0x142 NL80211_ATTR_QOS_MAP = 0xc7 NL80211_ATTR_RADAR_BACKGROUND = 0x134 NL80211_ATTR_RADAR_EVENT = 0xa8 @@ -4943,7 +5048,9 @@ const ( NL80211_ATTR_WIPHY_FREQ = 0x26 NL80211_ATTR_WIPHY_FREQ_HINT = 0xc9 NL80211_ATTR_WIPHY_FREQ_OFFSET = 0x122 + NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS = 0x14c NL80211_ATTR_WIPHY_NAME = 0x2 + NL80211_ATTR_WIPHY_RADIOS = 0x14b NL80211_ATTR_WIPHY_RETRY_LONG = 0x3e NL80211_ATTR_WIPHY_RETRY_SHORT = 0x3d NL80211_ATTR_WIPHY_RTS_THRESHOLD = 0x40 @@ -4978,6 +5085,8 @@ const ( NL80211_BAND_ATTR_IFTYPE_DATA = 0x9 NL80211_BAND_ATTR_MAX = 0xd NL80211_BAND_ATTR_RATES = 0x2 + NL80211_BAND_ATTR_S1G_CAPA = 0xd + NL80211_BAND_ATTR_S1G_MCS_NSS_SET = 0xc NL80211_BAND_ATTR_VHT_CAPA = 0x8 NL80211_BAND_ATTR_VHT_MCS_SET = 0x7 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC = 0x8 @@ -5001,6 +5110,10 @@ const ( NL80211_BSS_BEACON_INTERVAL = 0x4 NL80211_BSS_BEACON_TSF = 0xd NL80211_BSS_BSSID = 0x1 + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 0x2 + NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 0x1 + NL80211_BSS_CANNOT_USE_REASONS = 0x18 + NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 0x2 NL80211_BSS_CAPABILITY = 0x5 NL80211_BSS_CHAIN_SIGNAL = 0x13 NL80211_BSS_CHAN_WIDTH_10 = 0x1 @@ -5032,6 +5145,9 @@ const ( NL80211_BSS_STATUS = 0x9 NL80211_BSS_STATUS_IBSS_JOINED = 0x2 NL80211_BSS_TSF = 0x3 + NL80211_BSS_USE_FOR = 0x17 + NL80211_BSS_USE_FOR_MLD_LINK = 0x2 + NL80211_BSS_USE_FOR_NORMAL = 0x1 NL80211_CHAN_HT20 = 0x1 NL80211_CHAN_HT40MINUS = 0x2 NL80211_CHAN_HT40PLUS = 0x3 @@ -5117,7 +5233,8 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x9b + NL80211_CMD_LINKS_REMOVED = 0x9a + NL80211_CMD_MAX = 0x9d NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5161,6 +5278,7 @@ const ( NL80211_CMD_SET_COALESCE = 0x65 NL80211_CMD_SET_CQM = 0x3f NL80211_CMD_SET_FILS_AAD = 0x92 + NL80211_CMD_SET_HW_TIMESTAMP = 0x99 NL80211_CMD_SET_INTERFACE = 0x6 NL80211_CMD_SET_KEY = 0xa NL80211_CMD_SET_MAC_ACL = 0x5d @@ -5180,6 +5298,7 @@ const ( NL80211_CMD_SET_SAR_SPECS = 0x8c NL80211_CMD_SET_STATION = 0x12 NL80211_CMD_SET_TID_CONFIG = 0x89 + NL80211_CMD_SET_TID_TO_LINK_MAPPING = 0x9b NL80211_CMD_SET_TX_BITRATE_MASK = 0x39 NL80211_CMD_SET_WDS_PEER = 0x42 NL80211_CMD_SET_WIPHY = 0x2 @@ -5247,6 +5366,7 @@ const ( NL80211_EXT_FEATURE_AIRTIME_FAIRNESS = 0x21 NL80211_EXT_FEATURE_AP_PMKSA_CACHING = 0x22 NL80211_EXT_FEATURE_AQL = 0x28 + NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA = 0x40 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT = 0x2e NL80211_EXT_FEATURE_BEACON_PROTECTION = 0x29 NL80211_EXT_FEATURE_BEACON_RATE_HE = 0x36 @@ -5262,6 +5382,7 @@ const ( NL80211_EXT_FEATURE_CQM_RSSI_LIST = 0xd NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = 0x1b NL80211_EXT_FEATURE_DEL_IBSS_STA = 0x2c + NL80211_EXT_FEATURE_DFS_CONCURRENT = 0x43 NL80211_EXT_FEATURE_DFS_OFFLOAD = 0x19 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 0x20 NL80211_EXT_FEATURE_EXT_KEY_ID = 0x24 @@ -5281,9 +5402,12 @@ const ( NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 0x14 NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE = 0x13 NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION = 0x31 + NL80211_EXT_FEATURE_OWE_OFFLOAD_AP = 0x42 + NL80211_EXT_FEATURE_OWE_OFFLOAD = 0x41 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE = 0x3d NL80211_EXT_FEATURE_PROTECTED_TWT = 0x2b NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE = 0x39 + NL80211_EXT_FEATURE_PUNCT = 0x3e NL80211_EXT_FEATURE_RADAR_BACKGROUND = 0x3c NL80211_EXT_FEATURE_RRM = 0x1 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP = 0x33 @@ -5295,8 +5419,10 @@ const ( NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD = 0x23 NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI = 0xc NL80211_EXT_FEATURE_SECURE_LTF = 0x37 + NL80211_EXT_FEATURE_SECURE_NAN = 0x3f NL80211_EXT_FEATURE_SECURE_RTT = 0x38 NL80211_EXT_FEATURE_SET_SCAN_DWELL = 0x5 + NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT = 0x44 NL80211_EXT_FEATURE_STA_TX_PWR = 0x25 NL80211_EXT_FEATURE_TXQS = 0x1c NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP = 0x35 @@ -5343,7 +5469,10 @@ const ( NL80211_FREQUENCY_ATTR_2MHZ = 0x16 NL80211_FREQUENCY_ATTR_4MHZ = 0x17 NL80211_FREQUENCY_ATTR_8MHZ = 0x18 + NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP = 0x21 + NL80211_FREQUENCY_ATTR_CAN_MONITOR = 0x20 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME = 0xd + NL80211_FREQUENCY_ATTR_DFS_CONCURRENT = 0x1d NL80211_FREQUENCY_ATTR_DFS_STATE = 0x7 NL80211_FREQUENCY_ATTR_DFS_TIME = 0x8 NL80211_FREQUENCY_ATTR_DISABLED = 0x2 @@ -5351,12 +5480,14 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x21 + NL80211_FREQUENCY_ATTR_MAX = 0x22 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc NL80211_FREQUENCY_ATTR_NO_20MHZ = 0x10 NL80211_FREQUENCY_ATTR_NO_320MHZ = 0x1a + NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_NO_80MHZ = 0xb NL80211_FREQUENCY_ATTR_NO_EHT = 0x1b NL80211_FREQUENCY_ATTR_NO_HE = 0x13 @@ -5364,8 +5495,11 @@ const ( NL80211_FREQUENCY_ATTR_NO_HT40_PLUS = 0xa NL80211_FREQUENCY_ATTR_NO_IBSS = 0x3 NL80211_FREQUENCY_ATTR_NO_IR = 0x3 + NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_OFFSET = 0x14 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN = 0x3 + NL80211_FREQUENCY_ATTR_PSD = 0x1c NL80211_FREQUENCY_ATTR_RADAR = 0x5 NL80211_FREQUENCY_ATTR_WMM = 0x12 NL80211_FTM_RESP_ATTR_CIVICLOC = 0x3 @@ -5430,6 +5564,7 @@ const ( NL80211_IFTYPE_STATION = 0x2 NL80211_IFTYPE_UNSPECIFIED = 0x0 NL80211_IFTYPE_WDS = 0x5 + NL80211_KCK_EXT_LEN_32 = 0x20 NL80211_KCK_EXT_LEN = 0x18 NL80211_KCK_LEN = 0x10 NL80211_KEK_EXT_LEN = 0x20 @@ -5458,9 +5593,10 @@ const ( NL80211_MAX_SUPP_HT_RATES = 0x4d NL80211_MAX_SUPP_RATES = 0x20 NL80211_MAX_SUPP_REG_RULES = 0x80 + NL80211_MAX_SUPP_SELECTORS = 0x80 NL80211_MBSSID_CONFIG_ATTR_EMA = 0x5 NL80211_MBSSID_CONFIG_ATTR_INDEX = 0x3 - NL80211_MBSSID_CONFIG_ATTR_MAX = 0x5 + NL80211_MBSSID_CONFIG_ATTR_MAX = 0x6 NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY = 0x2 NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES = 0x1 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX = 0x4 @@ -5703,11 +5839,16 @@ const ( NL80211_RADAR_PRE_CAC_EXPIRED = 0x4 NL80211_RATE_INFO_10_MHZ_WIDTH = 0xb NL80211_RATE_INFO_160_MHZ_WIDTH = 0xa + NL80211_RATE_INFO_16_MHZ_WIDTH = 0x1d + NL80211_RATE_INFO_1_MHZ_WIDTH = 0x19 + NL80211_RATE_INFO_2_MHZ_WIDTH = 0x1a NL80211_RATE_INFO_320_MHZ_WIDTH = 0x12 NL80211_RATE_INFO_40_MHZ_WIDTH = 0x3 + NL80211_RATE_INFO_4_MHZ_WIDTH = 0x1b NL80211_RATE_INFO_5_MHZ_WIDTH = 0xc NL80211_RATE_INFO_80_MHZ_WIDTH = 0x8 NL80211_RATE_INFO_80P80_MHZ_WIDTH = 0x9 + NL80211_RATE_INFO_8_MHZ_WIDTH = 0x1c NL80211_RATE_INFO_BITRATE32 = 0x5 NL80211_RATE_INFO_BITRATE = 0x1 NL80211_RATE_INFO_EHT_GI_0_8 = 0x0 @@ -5753,6 +5894,8 @@ const ( NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 NL80211_RATE_INFO_MAX = 0x1d NL80211_RATE_INFO_MCS = 0x2 + NL80211_RATE_INFO_S1G_MCS = 0x17 + NL80211_RATE_INFO_S1G_NSS = 0x18 NL80211_RATE_INFO_SHORT_GI = 0x4 NL80211_RATE_INFO_VHT_MCS = 0x6 NL80211_RATE_INFO_VHT_NSS = 0x7 @@ -5770,14 +5913,19 @@ const ( NL80211_REKEY_DATA_KEK = 0x1 NL80211_REKEY_DATA_REPLAY_CTR = 0x3 NL80211_REPLAY_CTR_LEN = 0x8 + NL80211_RRF_ALLOW_6GHZ_VLP_AP = 0x1000000 NL80211_RRF_AUTO_BW = 0x800 NL80211_RRF_DFS = 0x10 + NL80211_RRF_DFS_CONCURRENT = 0x200000 NL80211_RRF_GO_CONCURRENT = 0x1000 NL80211_RRF_IR_CONCURRENT = 0x1000 NL80211_RRF_NO_160MHZ = 0x10000 NL80211_RRF_NO_320MHZ = 0x40000 + NL80211_RRF_NO_6GHZ_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_6GHZ_VLP_CLIENT = 0x400000 NL80211_RRF_NO_80MHZ = 0x8000 NL80211_RRF_NO_CCK = 0x2 + NL80211_RRF_NO_EHT = 0x80000 NL80211_RRF_NO_HE = 0x20000 NL80211_RRF_NO_HT40 = 0x6000 NL80211_RRF_NO_HT40MINUS = 0x2000 @@ -5788,7 +5936,10 @@ const ( NL80211_RRF_NO_IR = 0x80 NL80211_RRF_NO_OFDM = 0x1 NL80211_RRF_NO_OUTDOOR = 0x8 + NL80211_RRF_NO_UHB_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_UHB_VLP_CLIENT = 0x400000 NL80211_RRF_PASSIVE_SCAN = 0x80 + NL80211_RRF_PSD = 0x100000 NL80211_RRF_PTMP_ONLY = 0x40 NL80211_RRF_PTP_ONLY = 0x20 NL80211_RXMGMT_FLAG_ANSWERED = 0x1 @@ -5849,6 +6000,7 @@ const ( NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 + NL80211_STA_FLAG_SPP_AMSDU = 0x8 NL80211_STA_FLAG_TDLS_PEER = 0x6 NL80211_STA_FLAG_WME = 0x3 NL80211_STA_INFO_ACK_SIGNAL_AVG = 0x23 @@ -6007,6 +6159,13 @@ const ( NL80211_VHT_CAPABILITY_LEN = 0xc NL80211_VHT_NSS_MAX = 0x8 NL80211_WIPHY_NAME_MAXLEN = 0x40 + NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 + NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 + NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 + NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 + NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 NL80211_WMMR_AIFSN = 0x3 NL80211_WMMR_CW_MAX = 0x2 NL80211_WMMR_CW_MIN = 0x1 @@ -6038,6 +6197,7 @@ const ( NL80211_WOWLAN_TRIG_PKT_PATTERN = 0x4 NL80211_WOWLAN_TRIG_RFKILL_RELEASE = 0x9 NL80211_WOWLAN_TRIG_TCP_CONNECTION = 0xe + NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC = 0x14 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 = 0xa NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN = 0xb NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 = 0xc @@ -6176,3 +6336,30 @@ type SockDiagReq struct { } const RTM_NEWNVLAN = 0x70 + +const ( + MPOL_BIND = 0x2 + MPOL_DEFAULT = 0x0 + MPOL_F_ADDR = 0x2 + MPOL_F_MEMS_ALLOWED = 0x4 + MPOL_F_MOF = 0x8 + MPOL_F_MORON = 0x10 + MPOL_F_NODE = 0x1 + MPOL_F_NUMA_BALANCING = 0x2000 + MPOL_F_RELATIVE_NODES = 0x4000 + MPOL_F_SHARED = 0x1 + MPOL_F_STATIC_NODES = 0x8000 + MPOL_INTERLEAVE = 0x3 + MPOL_LOCAL = 0x4 + MPOL_MAX = 0x7 + MPOL_MF_INTERNAL = 0x10 + MPOL_MF_LAZY = 0x8 + MPOL_MF_MOVE_ALL = 0x4 + MPOL_MF_MOVE = 0x2 + MPOL_MF_STRICT = 0x1 + MPOL_MF_VALID = 0x7 + MPOL_MODE_FLAGS = 0xe000 + MPOL_PREFERRED = 0x1 + MPOL_PREFERRED_MANY = 0x5 + MPOL_WEIGHTED_INTERLEAVE = 0x6 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fd402da43..485f2d3a1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -282,7 +282,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -338,6 +338,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index eb7a5e186..ecbd1ad8b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -351,6 +351,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index d78ac108b..02f0463a4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -91,7 +91,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -273,7 +273,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -329,6 +329,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index cd06d47f1..6f4d400d2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -330,6 +330,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 2f28fe26c..cd532cfa5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -331,6 +331,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 71d6cac2f..413362085 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -278,7 +278,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -334,6 +334,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 8596d4535..eaa37eb71 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -333,6 +333,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index cd60ea186..98ae6a1e4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -333,6 +333,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index b0ae420c4..cae196159 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -278,7 +278,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -334,6 +334,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 835972875..6ce3b4e02 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -90,7 +90,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -285,7 +285,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -341,6 +341,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 69eb6a5c6..c7429c6a1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -340,6 +340,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 5f583cb62..4bf4baf4c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -340,6 +340,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index ad05b51a6..e9709d70a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -358,6 +358,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index cf3ce9003..fb44268ca 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -353,6 +353,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 590b56739..9c38265c7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -335,6 +335,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index b6e1ab76f..a8b0364c7 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1303,7 +1303,10 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DE return nil, err } if absoluteSDSize > 0 { - absoluteSD = (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&make([]byte, absoluteSDSize)[0])) + absoluteSD = new(SECURITY_DESCRIPTOR) + if unsafe.Sizeof(*absoluteSD) < uintptr(absoluteSDSize) { + panic("sizeof(SECURITY_DESCRIPTOR) too small") + } } var ( dacl *ACL @@ -1312,19 +1315,55 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DE group *SID ) if daclSize > 0 { - dacl = (*ACL)(unsafe.Pointer(&make([]byte, daclSize)[0])) + dacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, daclSize)))) } if saclSize > 0 { - sacl = (*ACL)(unsafe.Pointer(&make([]byte, saclSize)[0])) + sacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, saclSize)))) } if ownerSize > 0 { - owner = (*SID)(unsafe.Pointer(&make([]byte, ownerSize)[0])) + owner = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, ownerSize)))) } if groupSize > 0 { - group = (*SID)(unsafe.Pointer(&make([]byte, groupSize)[0])) + group = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, groupSize)))) } + // We call into Windows via makeAbsoluteSD, which sets up + // pointers within absoluteSD that point to other chunks of memory + // we pass into makeAbsoluteSD, and that happens outside the view of the GC. + // We therefore take some care here to then verify the pointers are as we expect + // and set them explicitly in view of the GC. See https://go.dev/issue/73199. + // TODO: consider weak pointers once Go 1.24 is appropriate. See suggestion in https://go.dev/cl/663575. err = makeAbsoluteSD(selfRelativeSD, absoluteSD, &absoluteSDSize, dacl, &daclSize, sacl, &saclSize, owner, &ownerSize, group, &groupSize) + if err != nil { + // Don't return absoluteSD, which might be partially initialized. + return nil, err + } + // Before using any fields, verify absoluteSD is in the format we expect according to Windows. + // See https://learn.microsoft.com/en-us/windows/win32/secauthz/absolute-and-self-relative-security-descriptors + absControl, _, err := absoluteSD.Control() + if err != nil { + panic("absoluteSD: " + err.Error()) + } + if absControl&SE_SELF_RELATIVE != 0 { + panic("absoluteSD not in absolute format") + } + if absoluteSD.dacl != dacl { + panic("dacl pointer mismatch") + } + if absoluteSD.sacl != sacl { + panic("sacl pointer mismatch") + } + if absoluteSD.owner != owner { + panic("owner pointer mismatch") + } + if absoluteSD.group != group { + panic("group pointer mismatch") + } + absoluteSD.dacl = dacl + absoluteSD.sacl = sacl + absoluteSD.owner = owner + absoluteSD.group = group + return } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 4a3254386..69439df2a 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -321,6 +321,8 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP //sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW //sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW +//sys GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) = kernel32.GetNumberOfConsoleInputEvents +//sys FlushConsoleInputBuffer(console Handle) (err error) = kernel32.FlushConsoleInputBuffer //sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole //sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot //sys Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32FirstW @@ -870,6 +872,7 @@ const socket_error = uintptr(^uint32(0)) //sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom //sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo //sys WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.WSASocketW +//sys WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) [failretval!=0] = ws2_32.WSADuplicateSocketW //sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname //sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname //sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs @@ -889,8 +892,12 @@ const socket_error = uintptr(^uint32(0)) //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx //sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex +//sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2 +//sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2 //sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry +//sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable //sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange +//sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 //sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange //sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2 @@ -913,6 +920,17 @@ type RawSockaddrInet6 struct { Scope_id uint32 } +// RawSockaddrInet is a union that contains an IPv4, an IPv6 address, or an address family. See +// https://learn.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-sockaddr_inet. +// +// A [*RawSockaddrInet] may be converted to a [*RawSockaddrInet4] or [*RawSockaddrInet6] using +// unsafe, depending on the address family. +type RawSockaddrInet struct { + Family uint16 + Port uint16 + Data [6]uint32 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -1698,8 +1716,9 @@ func NewNTUnicodeString(s string) (*NTUnicodeString, error) { // Slice returns a uint16 slice that aliases the data in the NTUnicodeString. func (s *NTUnicodeString) Slice() []uint16 { - slice := unsafe.Slice(s.Buffer, s.MaximumLength) - return slice[:s.Length] + // Note: this rounds the length down, if it happens + // to (incorrectly) be odd. Probably safer than rounding up. + return unsafe.Slice(s.Buffer, s.MaximumLength/2)[:s.Length/2] } func (s *NTUnicodeString) String() string { diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index ad67df2fd..6e4f50eb4 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -65,6 +65,22 @@ var signals = [...]string{ 15: "terminated", } +// File flags for [os.OpenFile]. The O_ prefix is used to indicate +// that these flags are specific to the OpenFile function. +const ( + O_FILE_FLAG_OPEN_NO_RECALL = FILE_FLAG_OPEN_NO_RECALL + O_FILE_FLAG_OPEN_REPARSE_POINT = FILE_FLAG_OPEN_REPARSE_POINT + O_FILE_FLAG_SESSION_AWARE = FILE_FLAG_SESSION_AWARE + O_FILE_FLAG_POSIX_SEMANTICS = FILE_FLAG_POSIX_SEMANTICS + O_FILE_FLAG_BACKUP_SEMANTICS = FILE_FLAG_BACKUP_SEMANTICS + O_FILE_FLAG_DELETE_ON_CLOSE = FILE_FLAG_DELETE_ON_CLOSE + O_FILE_FLAG_SEQUENTIAL_SCAN = FILE_FLAG_SEQUENTIAL_SCAN + O_FILE_FLAG_RANDOM_ACCESS = FILE_FLAG_RANDOM_ACCESS + O_FILE_FLAG_NO_BUFFERING = FILE_FLAG_NO_BUFFERING + O_FILE_FLAG_OVERLAPPED = FILE_FLAG_OVERLAPPED + O_FILE_FLAG_WRITE_THROUGH = FILE_FLAG_WRITE_THROUGH +) + const ( FILE_READ_DATA = 0x00000001 FILE_READ_ATTRIBUTES = 0x00000080 @@ -1976,6 +1992,12 @@ const ( SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1 ) +// FILE_ZERO_DATA_INFORMATION from winioctl.h +type FileZeroDataInformation struct { + FileOffset int64 + BeyondFinalZero int64 +} + const ( ComputerNameNetBIOS = 0 ComputerNameDnsHostname = 1 @@ -2298,6 +2320,82 @@ type MibIfRow2 struct { OutQLen uint64 } +// IP_ADDRESS_PREFIX stores an IP address prefix. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix. +type IpAddressPrefix struct { + Prefix RawSockaddrInet + PrefixLength uint8 +} + +// NL_ROUTE_ORIGIN enumeration from nldef.h or +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_origin. +const ( + NlroManual = 0 + NlroWellKnown = 1 + NlroDHCP = 2 + NlroRouterAdvertisement = 3 + Nlro6to4 = 4 +) + +// NL_ROUTE_ORIGIN enumeration from nldef.h or +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_protocol. +const ( + MIB_IPPROTO_OTHER = 1 + MIB_IPPROTO_LOCAL = 2 + MIB_IPPROTO_NETMGMT = 3 + MIB_IPPROTO_ICMP = 4 + MIB_IPPROTO_EGP = 5 + MIB_IPPROTO_GGP = 6 + MIB_IPPROTO_HELLO = 7 + MIB_IPPROTO_RIP = 8 + MIB_IPPROTO_IS_IS = 9 + MIB_IPPROTO_ES_IS = 10 + MIB_IPPROTO_CISCO = 11 + MIB_IPPROTO_BBN = 12 + MIB_IPPROTO_OSPF = 13 + MIB_IPPROTO_BGP = 14 + MIB_IPPROTO_IDPR = 15 + MIB_IPPROTO_EIGRP = 16 + MIB_IPPROTO_DVMRP = 17 + MIB_IPPROTO_RPL = 18 + MIB_IPPROTO_DHCP = 19 + MIB_IPPROTO_NT_AUTOSTATIC = 10002 + MIB_IPPROTO_NT_STATIC = 10006 + MIB_IPPROTO_NT_STATIC_NON_DOD = 10007 +) + +// MIB_IPFORWARD_ROW2 stores information about an IP route entry. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2. +type MibIpForwardRow2 struct { + InterfaceLuid uint64 + InterfaceIndex uint32 + DestinationPrefix IpAddressPrefix + NextHop RawSockaddrInet + SitePrefixLength uint8 + ValidLifetime uint32 + PreferredLifetime uint32 + Metric uint32 + Protocol uint32 + Loopback uint8 + AutoconfigureAddress uint8 + Publish uint8 + Immortal uint8 + Age uint32 + Origin uint32 +} + +// MIB_IPFORWARD_TABLE2 contains a table of IP route entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_table2. +type MibIpForwardTable2 struct { + NumEntries uint32 + Table [1]MibIpForwardRow2 +} + +// Rows returns the IP route entries in the table. +func (t *MibIpForwardTable2) Rows() []MibIpForwardRow2 { + return unsafe.Slice(&t.Table[0], t.NumEntries) +} + // MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row. type MibUnicastIpAddressRow struct { @@ -2700,6 +2798,8 @@ type CommTimeouts struct { // NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING. type NTUnicodeString struct { + // Note: Length and MaximumLength are in *bytes*, not uint16s. + // They should always be even. Length uint16 MaximumLength uint16 Buffer *uint16 @@ -3628,3 +3728,213 @@ const ( KLF_NOTELLSHELL = 0x00000080 KLF_SETFORPROCESS = 0x00000100 ) + +// Virtual Key codes +// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes +const ( + VK_LBUTTON = 0x01 + VK_RBUTTON = 0x02 + VK_CANCEL = 0x03 + VK_MBUTTON = 0x04 + VK_XBUTTON1 = 0x05 + VK_XBUTTON2 = 0x06 + VK_BACK = 0x08 + VK_TAB = 0x09 + VK_CLEAR = 0x0C + VK_RETURN = 0x0D + VK_SHIFT = 0x10 + VK_CONTROL = 0x11 + VK_MENU = 0x12 + VK_PAUSE = 0x13 + VK_CAPITAL = 0x14 + VK_KANA = 0x15 + VK_HANGEUL = 0x15 + VK_HANGUL = 0x15 + VK_IME_ON = 0x16 + VK_JUNJA = 0x17 + VK_FINAL = 0x18 + VK_HANJA = 0x19 + VK_KANJI = 0x19 + VK_IME_OFF = 0x1A + VK_ESCAPE = 0x1B + VK_CONVERT = 0x1C + VK_NONCONVERT = 0x1D + VK_ACCEPT = 0x1E + VK_MODECHANGE = 0x1F + VK_SPACE = 0x20 + VK_PRIOR = 0x21 + VK_NEXT = 0x22 + VK_END = 0x23 + VK_HOME = 0x24 + VK_LEFT = 0x25 + VK_UP = 0x26 + VK_RIGHT = 0x27 + VK_DOWN = 0x28 + VK_SELECT = 0x29 + VK_PRINT = 0x2A + VK_EXECUTE = 0x2B + VK_SNAPSHOT = 0x2C + VK_INSERT = 0x2D + VK_DELETE = 0x2E + VK_HELP = 0x2F + VK_LWIN = 0x5B + VK_RWIN = 0x5C + VK_APPS = 0x5D + VK_SLEEP = 0x5F + VK_NUMPAD0 = 0x60 + VK_NUMPAD1 = 0x61 + VK_NUMPAD2 = 0x62 + VK_NUMPAD3 = 0x63 + VK_NUMPAD4 = 0x64 + VK_NUMPAD5 = 0x65 + VK_NUMPAD6 = 0x66 + VK_NUMPAD7 = 0x67 + VK_NUMPAD8 = 0x68 + VK_NUMPAD9 = 0x69 + VK_MULTIPLY = 0x6A + VK_ADD = 0x6B + VK_SEPARATOR = 0x6C + VK_SUBTRACT = 0x6D + VK_DECIMAL = 0x6E + VK_DIVIDE = 0x6F + VK_F1 = 0x70 + VK_F2 = 0x71 + VK_F3 = 0x72 + VK_F4 = 0x73 + VK_F5 = 0x74 + VK_F6 = 0x75 + VK_F7 = 0x76 + VK_F8 = 0x77 + VK_F9 = 0x78 + VK_F10 = 0x79 + VK_F11 = 0x7A + VK_F12 = 0x7B + VK_F13 = 0x7C + VK_F14 = 0x7D + VK_F15 = 0x7E + VK_F16 = 0x7F + VK_F17 = 0x80 + VK_F18 = 0x81 + VK_F19 = 0x82 + VK_F20 = 0x83 + VK_F21 = 0x84 + VK_F22 = 0x85 + VK_F23 = 0x86 + VK_F24 = 0x87 + VK_NUMLOCK = 0x90 + VK_SCROLL = 0x91 + VK_OEM_NEC_EQUAL = 0x92 + VK_OEM_FJ_JISHO = 0x92 + VK_OEM_FJ_MASSHOU = 0x93 + VK_OEM_FJ_TOUROKU = 0x94 + VK_OEM_FJ_LOYA = 0x95 + VK_OEM_FJ_ROYA = 0x96 + VK_LSHIFT = 0xA0 + VK_RSHIFT = 0xA1 + VK_LCONTROL = 0xA2 + VK_RCONTROL = 0xA3 + VK_LMENU = 0xA4 + VK_RMENU = 0xA5 + VK_BROWSER_BACK = 0xA6 + VK_BROWSER_FORWARD = 0xA7 + VK_BROWSER_REFRESH = 0xA8 + VK_BROWSER_STOP = 0xA9 + VK_BROWSER_SEARCH = 0xAA + VK_BROWSER_FAVORITES = 0xAB + VK_BROWSER_HOME = 0xAC + VK_VOLUME_MUTE = 0xAD + VK_VOLUME_DOWN = 0xAE + VK_VOLUME_UP = 0xAF + VK_MEDIA_NEXT_TRACK = 0xB0 + VK_MEDIA_PREV_TRACK = 0xB1 + VK_MEDIA_STOP = 0xB2 + VK_MEDIA_PLAY_PAUSE = 0xB3 + VK_LAUNCH_MAIL = 0xB4 + VK_LAUNCH_MEDIA_SELECT = 0xB5 + VK_LAUNCH_APP1 = 0xB6 + VK_LAUNCH_APP2 = 0xB7 + VK_OEM_1 = 0xBA + VK_OEM_PLUS = 0xBB + VK_OEM_COMMA = 0xBC + VK_OEM_MINUS = 0xBD + VK_OEM_PERIOD = 0xBE + VK_OEM_2 = 0xBF + VK_OEM_3 = 0xC0 + VK_OEM_4 = 0xDB + VK_OEM_5 = 0xDC + VK_OEM_6 = 0xDD + VK_OEM_7 = 0xDE + VK_OEM_8 = 0xDF + VK_OEM_AX = 0xE1 + VK_OEM_102 = 0xE2 + VK_ICO_HELP = 0xE3 + VK_ICO_00 = 0xE4 + VK_PROCESSKEY = 0xE5 + VK_ICO_CLEAR = 0xE6 + VK_OEM_RESET = 0xE9 + VK_OEM_JUMP = 0xEA + VK_OEM_PA1 = 0xEB + VK_OEM_PA2 = 0xEC + VK_OEM_PA3 = 0xED + VK_OEM_WSCTRL = 0xEE + VK_OEM_CUSEL = 0xEF + VK_OEM_ATTN = 0xF0 + VK_OEM_FINISH = 0xF1 + VK_OEM_COPY = 0xF2 + VK_OEM_AUTO = 0xF3 + VK_OEM_ENLW = 0xF4 + VK_OEM_BACKTAB = 0xF5 + VK_ATTN = 0xF6 + VK_CRSEL = 0xF7 + VK_EXSEL = 0xF8 + VK_EREOF = 0xF9 + VK_PLAY = 0xFA + VK_ZOOM = 0xFB + VK_NONAME = 0xFC + VK_PA1 = 0xFD + VK_OEM_CLEAR = 0xFE +) + +// Mouse button constants. +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + FROM_LEFT_1ST_BUTTON_PRESSED = 0x0001 + RIGHTMOST_BUTTON_PRESSED = 0x0002 + FROM_LEFT_2ND_BUTTON_PRESSED = 0x0004 + FROM_LEFT_3RD_BUTTON_PRESSED = 0x0008 + FROM_LEFT_4TH_BUTTON_PRESSED = 0x0010 +) + +// Control key state constaints. +// https://docs.microsoft.com/en-us/windows/console/key-event-record-str +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + CAPSLOCK_ON = 0x0080 + ENHANCED_KEY = 0x0100 + LEFT_ALT_PRESSED = 0x0002 + LEFT_CTRL_PRESSED = 0x0008 + NUMLOCK_ON = 0x0020 + RIGHT_ALT_PRESSED = 0x0001 + RIGHT_CTRL_PRESSED = 0x0004 + SCROLLLOCK_ON = 0x0040 + SHIFT_PRESSED = 0x0010 +) + +// Mouse event record event flags. +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + MOUSE_MOVED = 0x0001 + DOUBLE_CLICK = 0x0002 + MOUSE_WHEELED = 0x0004 + MOUSE_HWHEELED = 0x0008 +) + +// Input Record Event Types +// https://learn.microsoft.com/en-us/windows/console/input-record-str +const ( + FOCUS_EVENT = 0x0010 + KEY_EVENT = 0x0001 + MENU_EVENT = 0x0008 + MOUSE_EVENT = 0x0002 + WINDOW_BUFFER_SIZE_EVENT = 0x0004 +) diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 01c0716c2..f25b7308a 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -182,13 +182,17 @@ var ( procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute") procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute") procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2") + procFreeMibTable = modiphlpapi.NewProc("FreeMibTable") procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") + procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") + procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") + procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") @@ -238,6 +242,7 @@ var ( procFindResourceW = modkernel32.NewProc("FindResourceW") procFindVolumeClose = modkernel32.NewProc("FindVolumeClose") procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose") + procFlushConsoleInputBuffer = modkernel32.NewProc("FlushConsoleInputBuffer") procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile") procFormatMessageW = modkernel32.NewProc("FormatMessageW") @@ -284,6 +289,7 @@ var ( procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") procGetNamedPipeServerProcessId = modkernel32.NewProc("GetNamedPipeServerProcessId") + procGetNumberOfConsoleInputEvents = modkernel32.NewProc("GetNumberOfConsoleInputEvents") procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult") procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") procGetProcAddress = modkernel32.NewProc("GetProcAddress") @@ -511,6 +517,7 @@ var ( procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") procWSACleanup = modws2_32.NewProc("WSACleanup") + procWSADuplicateSocketW = modws2_32.NewProc("WSADuplicateSocketW") procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") procWSAIoctl = modws2_32.NewProc("WSAIoctl") @@ -545,25 +552,25 @@ var ( ) func cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_DevNode_Status.Addr(), 4, uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags), 0, 0) + r0, _, _ := syscall.SyscallN(procCM_Get_DevNode_Status.Addr(), uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_ListW.Addr(), 5, uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags), 0) + r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_ListW.Addr(), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_List_SizeW.Addr(), 4, uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags), 0, 0) + r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_List_SizeW.Addr(), uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) { - r0, _, _ := syscall.Syscall(procCM_MapCrToWin32Err.Addr(), 2, uintptr(configRet), uintptr(defaultWin32Error), 0) + r0, _, _ := syscall.SyscallN(procCM_MapCrToWin32Err.Addr(), uintptr(configRet), uintptr(defaultWin32Error)) ret = Errno(r0) return } @@ -573,7 +580,7 @@ func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, if resetToDefault { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procAdjustTokenGroups.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) + r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } @@ -585,7 +592,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok if disableAllPrivileges { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) + r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } @@ -593,7 +600,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok } func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0) + r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } @@ -601,7 +608,7 @@ func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, s } func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procBuildSecurityDescriptorW.Addr(), 9, uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) + r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -609,7 +616,7 @@ func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries } func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) + r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -617,7 +624,7 @@ func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err err } func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) { - r1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0) + r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName))) if r1 == 0 { err = errnoErr(e1) } @@ -625,7 +632,7 @@ func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, e } func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { - r1, _, e1 := syscall.Syscall(procCheckTokenMembership.Addr(), 3, uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) + r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) if r1 == 0 { err = errnoErr(e1) } @@ -633,7 +640,7 @@ func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) ( } func CloseServiceHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -641,7 +648,7 @@ func CloseServiceHandle(handle Handle) (err error) { } func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) + r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -649,7 +656,7 @@ func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err } func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen)), 0) + r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen))) if r1 == 0 { err = errnoErr(e1) } @@ -657,7 +664,7 @@ func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR } func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0) + r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid))) if r1 == 0 { err = errnoErr(e1) } @@ -674,7 +681,7 @@ func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision ui } func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -682,7 +689,7 @@ func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision } func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0) + r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } @@ -690,7 +697,7 @@ func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { } func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) + r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) if r1 == 0 { err = errnoErr(e1) } @@ -702,7 +709,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc if inheritHandles { _p0 = 1 } - r1, _, e1 := syscall.Syscall12(procCreateProcessAsUserW.Addr(), 11, uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0) + r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) if r1 == 0 { err = errnoErr(e1) } @@ -710,7 +717,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc } func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -719,7 +726,7 @@ func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access } func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCreateWellKnownSid.Addr(), 4, uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid))) if r1 == 0 { err = errnoErr(e1) } @@ -727,7 +734,7 @@ func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, s } func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -735,7 +742,7 @@ func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16 } func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { - r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) + r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) if r1 == 0 { err = errnoErr(e1) } @@ -743,7 +750,7 @@ func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { } func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -751,7 +758,7 @@ func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { } func DeleteService(service Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service)) if r1 == 0 { err = errnoErr(e1) } @@ -759,7 +766,7 @@ func DeleteService(service Handle) (err error) { } func DeregisterEventSource(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -767,7 +774,7 @@ func DeregisterEventSource(handle Handle) (err error) { } func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) { - r1, _, e1 := syscall.Syscall6(procDuplicateTokenEx.Addr(), 6, uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) + r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) if r1 == 0 { err = errnoErr(e1) } @@ -775,7 +782,7 @@ func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes } func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumDependentServicesW.Addr(), 6, uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) + r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) if r1 == 0 { err = errnoErr(e1) } @@ -783,7 +790,7 @@ func EnumDependentServices(service Handle, activityState uint32, services *ENUM_ } func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { - r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)), 0, 0) + r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName))) if r1 == 0 { err = errnoErr(e1) } @@ -791,13 +798,13 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv } func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { - r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0) + r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2))) isEqual = r0 != 0 return } func FreeSid(sid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeSid.Addr(), uintptr(unsafe.Pointer(sid))) if r1 != 0 { err = errnoErr(e1) } @@ -805,7 +812,7 @@ func FreeSid(sid *SID) (err error) { } func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { - r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) if r1 == 0 { err = errnoErr(e1) } @@ -813,7 +820,7 @@ func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { } func GetLengthSid(sid *SID) (len uint32) { - r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetLengthSid.Addr(), uintptr(unsafe.Pointer(sid))) len = uint32(r0) return } @@ -828,7 +835,7 @@ func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security } func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procGetNamedSecurityInfoW.Addr(), 8, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0) + r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -836,7 +843,7 @@ func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi } func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) if r1 == 0 { err = errnoErr(e1) } @@ -852,7 +859,7 @@ func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl if *daclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1))) *daclPresent = _p0 != 0 *daclDefaulted = _p1 != 0 if r1 == 0 { @@ -866,7 +873,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau if *groupDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) *groupDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -875,7 +882,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau } func getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorLength.Addr(), uintptr(unsafe.Pointer(sd))) len = uint32(r0) return } @@ -885,7 +892,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau if *ownerDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) *ownerDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -894,7 +901,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau } func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0) + r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -910,7 +917,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl if *saclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1))) *saclPresent = _p0 != 0 *saclDefaulted = _p1 != 0 if r1 == 0 { @@ -920,7 +927,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl } func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0) + r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -928,25 +935,25 @@ func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) { - r0, _, _ := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSidIdentifierAuthority.Addr(), uintptr(unsafe.Pointer(sid))) authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0)) return } func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) { - r0, _, _ := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(index), 0) + r0, _, _ := syscall.SyscallN(procGetSidSubAuthority.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(index)) subAuthority = (*uint32)(unsafe.Pointer(r0)) return } func getSidSubAuthorityCount(sid *SID) (count *uint8) { - r0, _, _ := syscall.Syscall(procGetSidSubAuthorityCount.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSidSubAuthorityCount.Addr(), uintptr(unsafe.Pointer(sid))) count = (*uint8)(unsafe.Pointer(r0)) return } func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0) + r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen))) if r1 == 0 { err = errnoErr(e1) } @@ -954,7 +961,7 @@ func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint } func ImpersonateSelf(impersonationlevel uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(impersonationlevel), 0, 0) + r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel)) if r1 == 0 { err = errnoErr(e1) } @@ -962,7 +969,7 @@ func ImpersonateSelf(impersonationlevel uint32) (err error) { } func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) { - r1, _, e1 := syscall.Syscall(procInitializeSecurityDescriptor.Addr(), 2, uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision), 0) + r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision)) if r1 == 0 { err = errnoErr(e1) } @@ -978,7 +985,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint if rebootAfterShutdown { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procInitiateSystemShutdownExW.Addr(), 6, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) + r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } @@ -986,7 +993,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint } func isTokenRestricted(tokenHandle Token) (ret bool, err error) { - r0, _, e1 := syscall.Syscall(procIsTokenRestricted.Addr(), 1, uintptr(tokenHandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle)) ret = r0 != 0 if !ret { err = errnoErr(e1) @@ -995,25 +1002,25 @@ func isTokenRestricted(tokenHandle Token) (ret bool, err error) { } func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) { - r0, _, _ := syscall.Syscall(procIsValidSecurityDescriptor.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0) + r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd))) isValid = r0 != 0 return } func isValidSid(sid *SID) (isValid bool) { - r0, _, _ := syscall.Syscall(procIsValidSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid))) isValid = r0 != 0 return } func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { - r0, _, _ := syscall.Syscall(procIsWellKnownSid.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(sidType), 0) + r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType)) isWellKnown = r0 != 0 return } func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) if r1 == 0 { err = errnoErr(e1) } @@ -1021,7 +1028,7 @@ func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen } func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) if r1 == 0 { err = errnoErr(e1) } @@ -1029,7 +1036,7 @@ func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint3 } func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) + r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } @@ -1037,7 +1044,7 @@ func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err err } func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall12(procMakeAbsoluteSD.Addr(), 11, uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize)), 0) + r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize))) if r1 == 0 { err = errnoErr(e1) } @@ -1045,7 +1052,7 @@ func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DE } func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procMakeSelfRelativeSD.Addr(), 3, uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) + r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) if r1 == 0 { err = errnoErr(e1) } @@ -1053,7 +1060,7 @@ func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURIT } func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { - r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) + r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1061,7 +1068,7 @@ func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERV } func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { - r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) + r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } @@ -1069,7 +1076,7 @@ func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { } func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) + r0, _, e1 := syscall.SyscallN(procOpenSCManagerW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1078,7 +1085,7 @@ func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (ha } func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) + r0, _, e1 := syscall.SyscallN(procOpenServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1091,7 +1098,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token if openAsSelf { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) + r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } @@ -1099,7 +1106,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token } func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1107,7 +1114,7 @@ func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize } func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1119,7 +1126,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf if err != nil { return } - r1, _, e1 := syscall.Syscall(procQueryServiceDynamicInformation.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) + r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) if r1 == 0 { err = errnoErr(e1) } @@ -1127,7 +1134,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf } func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceLockStatusW.Addr(), 4, uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1135,7 +1142,7 @@ func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, b } func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -1143,7 +1150,7 @@ func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { } func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceStatusEx.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1151,7 +1158,7 @@ func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize } func RegCloseKey(key Handle) (regerrno error) { - r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0) + r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key)) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1159,7 +1166,7 @@ func RegCloseKey(key Handle) (regerrno error) { } func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0) + r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1175,7 +1182,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, if asynchronous { _p1 = 1 } - r0, _, _ := syscall.Syscall6(procRegNotifyChangeKeyValue.Addr(), 5, uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1), 0) + r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1)) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1183,7 +1190,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, } func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0) + r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1191,7 +1198,7 @@ func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint } func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) + r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1199,7 +1206,7 @@ func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint } func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) + r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1207,7 +1214,7 @@ func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32 } func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0) + r0, _, e1 := syscall.SyscallN(procRegisterEventSourceW.Addr(), uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1216,7 +1223,7 @@ func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Hand } func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procRegisterServiceCtrlHandlerExW.Addr(), 3, uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) + r0, _, e1 := syscall.SyscallN(procRegisterServiceCtrlHandlerExW.Addr(), uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1225,7 +1232,7 @@ func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, cont } func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) + r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) if r1 == 0 { err = errnoErr(e1) } @@ -1233,7 +1240,7 @@ func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrS } func RevertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) + r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) if r1 == 0 { err = errnoErr(e1) } @@ -1241,7 +1248,7 @@ func RevertToSelf() (err error) { } func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) { - r0, _, _ := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1249,7 +1256,7 @@ func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCE } func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { - r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) + r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { err = errnoErr(e1) } @@ -1266,7 +1273,7 @@ func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security } func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { - r0, _, _ := syscall.Syscall9(procSetNamedSecurityInfoW.Addr(), 7, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1274,7 +1281,7 @@ func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi } func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) { - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) if r1 == 0 { err = errnoErr(e1) } @@ -1290,7 +1297,7 @@ func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl * if daclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } @@ -1302,7 +1309,7 @@ func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaul if groupDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -1314,7 +1321,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul if ownerDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -1322,7 +1329,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul } func setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) { - syscall.Syscall(procSetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0) + syscall.SyscallN(procSetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) return } @@ -1335,7 +1342,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * if saclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } @@ -1343,7 +1350,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * } func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { - r0, _, _ := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1351,7 +1358,7 @@ func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0) + r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus))) if r1 == 0 { err = errnoErr(e1) } @@ -1359,7 +1366,7 @@ func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) } func SetThreadToken(thread *Handle, token Token) (err error) { - r1, _, e1 := syscall.Syscall(procSetThreadToken.Addr(), 2, uintptr(unsafe.Pointer(thread)), uintptr(token), 0) + r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token)) if r1 == 0 { err = errnoErr(e1) } @@ -1367,7 +1374,7 @@ func SetThreadToken(thread *Handle, token Token) (err error) { } func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetTokenInformation.Addr(), 4, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen)) if r1 == 0 { err = errnoErr(e1) } @@ -1375,7 +1382,7 @@ func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint } func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0) + r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable))) if r1 == 0 { err = errnoErr(e1) } @@ -1383,7 +1390,7 @@ func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { } func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) + r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) if r1 == 0 { err = errnoErr(e1) } @@ -1391,7 +1398,7 @@ func StartService(service Handle, numArgs uint32, argVectors **uint16) (err erro } func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { - r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext))) if r1 == 0 { err = errnoErr(e1) } @@ -1399,7 +1406,7 @@ func CertAddCertificateContextToStore(store Handle, certContext *CertContext, ad } func CertCloseStore(store Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -1407,7 +1414,7 @@ func CertCloseStore(store Handle, flags uint32) (err error) { } func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) + r0, _, e1 := syscall.SyscallN(procCertCreateCertificateContext.Addr(), uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) @@ -1416,7 +1423,7 @@ func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, en } func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { - r1, _, e1 := syscall.Syscall(procCertDeleteCertificateFromStore.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext))) if r1 == 0 { err = errnoErr(e1) } @@ -1424,13 +1431,13 @@ func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { } func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) { - r0, _, _ := syscall.Syscall(procCertDuplicateCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0) + r0, _, _ := syscall.SyscallN(procCertDuplicateCertificateContext.Addr(), uintptr(unsafe.Pointer(certContext))) dupContext = (*CertContext)(unsafe.Pointer(r0)) return } func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0) + r0, _, e1 := syscall.SyscallN(procCertEnumCertificatesInStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(prevContext))) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) @@ -1439,7 +1446,7 @@ func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (contex } func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) { - r0, _, e1 := syscall.Syscall6(procCertFindCertificateInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) + r0, _, e1 := syscall.SyscallN(procCertFindCertificateInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) cert = (*CertContext)(unsafe.Pointer(r0)) if cert == nil { err = errnoErr(e1) @@ -1448,7 +1455,7 @@ func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags } func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) { - r0, _, e1 := syscall.Syscall6(procCertFindChainInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) + r0, _, e1 := syscall.SyscallN(procCertFindChainInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) certchain = (*CertChainContext)(unsafe.Pointer(r0)) if certchain == nil { err = errnoErr(e1) @@ -1457,18 +1464,18 @@ func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint3 } func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) { - r0, _, _ := syscall.Syscall(procCertFindExtension.Addr(), 3, uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) + r0, _, _ := syscall.SyscallN(procCertFindExtension.Addr(), uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) ret = (*CertExtension)(unsafe.Pointer(r0)) return } func CertFreeCertificateChain(ctx *CertChainContext) { - syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) + syscall.SyscallN(procCertFreeCertificateChain.Addr(), uintptr(unsafe.Pointer(ctx))) return } func CertFreeCertificateContext(ctx *CertContext) (err error) { - r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx))) if r1 == 0 { err = errnoErr(e1) } @@ -1476,7 +1483,7 @@ func CertFreeCertificateContext(ctx *CertContext) (err error) { } func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { - r1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0) + r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx))) if r1 == 0 { err = errnoErr(e1) } @@ -1484,13 +1491,13 @@ func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, a } func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) { - r0, _, _ := syscall.Syscall6(procCertGetNameStringW.Addr(), 6, uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) + r0, _, _ := syscall.SyscallN(procCertGetNameStringW.Addr(), uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) chars = uint32(r0) return } func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0) + r0, _, e1 := syscall.SyscallN(procCertOpenStore.Addr(), uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1499,7 +1506,7 @@ func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptPr } func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { - r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0) + r0, _, e1 := syscall.SyscallN(procCertOpenSystemStoreW.Addr(), uintptr(hprov), uintptr(unsafe.Pointer(name))) store = Handle(r0) if store == 0 { err = errnoErr(e1) @@ -1508,7 +1515,7 @@ func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { } func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { - r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -1520,7 +1527,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete if *callerFreeProvOrNCryptKey { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procCryptAcquireCertificatePrivateKey.Addr(), 6, uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) *callerFreeProvOrNCryptKey = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -1529,7 +1536,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete } func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptDecodeObject.Addr(), 7, uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen))) if r1 == 0 { err = errnoErr(e1) } @@ -1537,7 +1544,7 @@ func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte } func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptProtectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } @@ -1545,7 +1552,7 @@ func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, } func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall12(procCryptQueryObject.Addr(), 11, uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context)), 0) + r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } @@ -1553,7 +1560,7 @@ func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentT } func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptUnprotectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } @@ -1561,7 +1568,7 @@ func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBl } func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) { - r0, _, e1 := syscall.Syscall(procPFXImportCertStore.Addr(), 3, uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procPFXImportCertStore.Addr(), uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) store = Handle(r0) if store == 0 { err = errnoErr(e1) @@ -1570,7 +1577,7 @@ func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (sto } func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { - r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0) + r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2))) same = r0 != 0 return } @@ -1585,7 +1592,7 @@ func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSR } func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { - r0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) + r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) if r0 != 0 { status = syscall.Errno(r0) } @@ -1593,12 +1600,12 @@ func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DN } func DnsRecordListFree(rl *DNSRecord, freetype uint32) { - syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0) + syscall.SyscallN(procDnsRecordListFree.Addr(), uintptr(unsafe.Pointer(rl)), uintptr(freetype)) return } func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { - r0, _, _ := syscall.Syscall6(procDwmGetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0) + r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1606,7 +1613,7 @@ func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si } func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { - r0, _, _ := syscall.Syscall6(procDwmSetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0) + r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1614,15 +1621,20 @@ func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si } func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { - r0, _, _ := syscall.Syscall(procCancelMibChangeNotify2.Addr(), 1, uintptr(notificationHandle), 0, 0) + r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle)) if r0 != 0 { errcode = syscall.Errno(r0) } return } +func FreeMibTable(memory unsafe.Pointer) { + syscall.SyscallN(procFreeMibTable.Addr(), uintptr(memory)) + return +} + func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { - r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0) + r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1630,7 +1642,7 @@ func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapter } func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { - r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0) + r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1638,7 +1650,7 @@ func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { } func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) { - r0, _, _ := syscall.Syscall(procGetBestInterfaceEx.Addr(), 2, uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex)), 0) + r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1646,7 +1658,7 @@ func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcod } func GetIfEntry(pIfRow *MibIfRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1654,7 +1666,23 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) { } func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry2Ex.Addr(), 2, uintptr(level), uintptr(unsafe.Pointer(row)), 0) + r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1662,7 +1690,7 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { } func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1674,7 +1702,19 @@ func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsa if initialNotification { _p0 = 1 } - r0, _, _ := syscall.Syscall6(procNotifyIpInterfaceChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) + r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { + var _p0 uint32 + if initialNotification { + _p0 = 1 + } + r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1686,7 +1726,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext if initialNotification { _p0 = 1 } - r0, _, _ := syscall.Syscall6(procNotifyUnicastIpAddressChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) + r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1694,7 +1734,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext } func AddDllDirectory(path *uint16) (cookie uintptr, err error) { - r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r0, _, e1 := syscall.SyscallN(procAddDllDirectory.Addr(), uintptr(unsafe.Pointer(path))) cookie = uintptr(r0) if cookie == 0 { err = errnoErr(e1) @@ -1703,7 +1743,7 @@ func AddDllDirectory(path *uint16) (cookie uintptr, err error) { } func AssignProcessToJobObject(job Handle, process Handle) (err error) { - r1, _, e1 := syscall.Syscall(procAssignProcessToJobObject.Addr(), 2, uintptr(job), uintptr(process), 0) + r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process)) if r1 == 0 { err = errnoErr(e1) } @@ -1711,7 +1751,7 @@ func AssignProcessToJobObject(job Handle, process Handle) (err error) { } func CancelIo(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0) + r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s)) if r1 == 0 { err = errnoErr(e1) } @@ -1719,7 +1759,7 @@ func CancelIo(s Handle) (err error) { } func CancelIoEx(s Handle, o *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0) + r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } @@ -1727,7 +1767,7 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) { } func ClearCommBreak(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procClearCommBreak.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1735,7 +1775,7 @@ func ClearCommBreak(handle Handle) (err error) { } func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { - r1, _, e1 := syscall.Syscall(procClearCommError.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) + r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) if r1 == 0 { err = errnoErr(e1) } @@ -1743,7 +1783,7 @@ func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error } func CloseHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1751,12 +1791,12 @@ func CloseHandle(handle Handle) (err error) { } func ClosePseudoConsole(console Handle) { - syscall.Syscall(procClosePseudoConsole.Addr(), 1, uintptr(console), 0, 0) + syscall.SyscallN(procClosePseudoConsole.Addr(), uintptr(console)) return } func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -1764,7 +1804,7 @@ func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { } func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { - r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0) + r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa))) if r1 == 0 { err = errnoErr(e1) } @@ -1772,7 +1812,7 @@ func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { } func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateEventExW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateEventExW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1781,7 +1821,7 @@ func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, d } func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateEventW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1790,7 +1830,7 @@ func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialStat } func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procCreateFileMappingW.Addr(), uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1799,7 +1839,7 @@ func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxS } func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1808,7 +1848,7 @@ func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes } func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procCreateHardLinkW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) if r1&0xff == 0 { err = errnoErr(e1) } @@ -1816,7 +1856,7 @@ func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr } func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1825,7 +1865,7 @@ func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, thr } func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procCreateJobObjectW.Addr(), 2, uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name)), 0) + r0, _, e1 := syscall.SyscallN(procCreateJobObjectW.Addr(), uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1834,7 +1874,7 @@ func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, } func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateMutexExW.Addr(), 4, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateMutexExW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1847,7 +1887,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16 if initialOwner { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procCreateMutexW.Addr(), 3, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procCreateMutexW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1856,7 +1896,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16 } func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) + r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1865,7 +1905,7 @@ func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances u } func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -1877,7 +1917,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA if inheritHandles { _p0 = 1 } - r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) if r1 == 0 { err = errnoErr(e1) } @@ -1885,7 +1925,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA } func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) { - r0, _, _ := syscall.Syscall6(procCreatePseudoConsole.Addr(), 5, uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole)), 0) + r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole))) if r0 != 0 { hr = syscall.Errno(r0) } @@ -1893,7 +1933,7 @@ func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pcons } func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procCreateSymbolicLinkW.Addr(), uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) if r1&0xff == 0 { err = errnoErr(e1) } @@ -1901,7 +1941,7 @@ func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags u } func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0) + r0, _, e1 := syscall.SyscallN(procCreateToolhelp32Snapshot.Addr(), uintptr(flags), uintptr(processId)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1910,7 +1950,7 @@ func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, er } func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDefineDosDeviceW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) + r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) if r1 == 0 { err = errnoErr(e1) } @@ -1918,7 +1958,7 @@ func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err } func DeleteFile(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -1926,12 +1966,12 @@ func DeleteFile(path *uint16) (err error) { } func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { - syscall.Syscall(procDeleteProcThreadAttributeList.Addr(), 1, uintptr(unsafe.Pointer(attrlist)), 0, 0) + syscall.SyscallN(procDeleteProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist))) return } func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteVolumeMountPointW.Addr(), 1, uintptr(unsafe.Pointer(volumeMountPoint)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint))) if r1 == 0 { err = errnoErr(e1) } @@ -1939,7 +1979,7 @@ func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { } func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -1947,7 +1987,7 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff } func DisconnectNamedPipe(pipe Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDisconnectNamedPipe.Addr(), 1, uintptr(pipe), 0, 0) + r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) if r1 == 0 { err = errnoErr(e1) } @@ -1959,7 +1999,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP if bInheritHandle { _p0 = 1 } - r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0) + r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions)) if r1 == 0 { err = errnoErr(e1) } @@ -1967,7 +2007,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP } func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { - r1, _, e1 := syscall.Syscall(procEscapeCommFunction.Addr(), 2, uintptr(handle), uintptr(dwFunc), 0) + r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc)) if r1 == 0 { err = errnoErr(e1) } @@ -1975,12 +2015,12 @@ func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { } func ExitProcess(exitcode uint32) { - syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0) + syscall.SyscallN(procExitProcess.Addr(), uintptr(exitcode)) return } func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -1989,7 +2029,7 @@ func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, } func FindClose(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1997,7 +2037,7 @@ func FindClose(handle Handle) (err error) { } func FindCloseChangeNotification(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindCloseChangeNotification.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2018,7 +2058,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter if watchSubtree { _p1 = 1 } - r0, _, e1 := syscall.Syscall(procFindFirstChangeNotificationW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) + r0, _, e1 := syscall.SyscallN(procFindFirstChangeNotificationW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2027,7 +2067,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter } func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0) + r0, _, e1 := syscall.SyscallN(procFindFirstFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2036,7 +2076,7 @@ func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err erro } func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) + r0, _, e1 := syscall.SyscallN(procFindFirstVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2045,7 +2085,7 @@ func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, b } func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstVolumeW.Addr(), 2, uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength), 0) + r0, _, e1 := syscall.SyscallN(procFindFirstVolumeW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2054,7 +2094,7 @@ func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, er } func FindNextChangeNotification(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextChangeNotification.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2062,7 +2102,7 @@ func FindNextChangeNotification(handle Handle) (err error) { } func findNextFile1(handle Handle, data *win32finddata1) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) + r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } @@ -2070,7 +2110,7 @@ func findNextFile1(handle Handle, data *win32finddata1) (err error) { } func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextVolumeMountPointW.Addr(), 3, uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2078,7 +2118,7 @@ func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uin } func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextVolumeW.Addr(), 3, uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2086,7 +2126,7 @@ func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) } func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindResourceW.Addr(), 3, uintptr(module), uintptr(name), uintptr(resType)) + r0, _, e1 := syscall.SyscallN(procFindResourceW.Addr(), uintptr(module), uintptr(name), uintptr(resType)) resInfo = Handle(r0) if resInfo == 0 { err = errnoErr(e1) @@ -2095,7 +2135,7 @@ func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, } func FindVolumeClose(findVolume Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindVolumeClose.Addr(), 1, uintptr(findVolume), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume)) if r1 == 0 { err = errnoErr(e1) } @@ -2103,7 +2143,15 @@ func FindVolumeClose(findVolume Handle) (err error) { } func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindVolumeMountPointClose.Addr(), 1, uintptr(findVolumeMountPoint), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint)) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func FlushConsoleInputBuffer(console Handle) (err error) { + r1, _, e1 := syscall.SyscallN(procFlushConsoleInputBuffer.Addr(), uintptr(console)) if r1 == 0 { err = errnoErr(e1) } @@ -2111,7 +2159,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { } func FlushFileBuffers(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2119,7 +2167,7 @@ func FlushFileBuffers(handle Handle) (err error) { } func FlushViewOfFile(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -2131,7 +2179,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu if len(buf) > 0 { _p0 = &buf[0] } - r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0) + r0, _, e1 := syscall.SyscallN(procFormatMessageW.Addr(), uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2140,7 +2188,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu } func FreeEnvironmentStrings(envs *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs))) if r1 == 0 { err = errnoErr(e1) } @@ -2148,7 +2196,7 @@ func FreeEnvironmentStrings(envs *uint16) (err error) { } func FreeLibrary(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2156,7 +2204,7 @@ func FreeLibrary(handle Handle) (err error) { } func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGenerateConsoleCtrlEvent.Addr(), 2, uintptr(ctrlEvent), uintptr(processGroupID), 0) + r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID)) if r1 == 0 { err = errnoErr(e1) } @@ -2164,19 +2212,19 @@ func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err erro } func GetACP() (acp uint32) { - r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetACP.Addr()) acp = uint32(r0) return } func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { - r0, _, _ := syscall.Syscall(procGetActiveProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) + r0, _, _ := syscall.SyscallN(procGetActiveProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommModemStatus.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat))) if r1 == 0 { err = errnoErr(e1) } @@ -2184,7 +2232,7 @@ func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { } func GetCommState(handle Handle, lpDCB *DCB) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } @@ -2192,7 +2240,7 @@ func GetCommState(handle Handle, lpDCB *DCB) (err error) { } func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } @@ -2200,13 +2248,13 @@ func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { } func GetCommandLine() (cmd *uint16) { - r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCommandLineW.Addr()) cmd = (*uint16)(unsafe.Pointer(r0)) return } func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) + r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } @@ -2214,7 +2262,7 @@ func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { } func GetComputerName(buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0) + r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } @@ -2222,7 +2270,7 @@ func GetComputerName(buf *uint16, n *uint32) (err error) { } func GetConsoleCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetConsoleCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) @@ -2231,7 +2279,7 @@ func GetConsoleCP() (cp uint32, err error) { } func GetConsoleMode(console Handle, mode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0) + r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode))) if r1 == 0 { err = errnoErr(e1) } @@ -2239,7 +2287,7 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) { } func GetConsoleOutputCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetConsoleOutputCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) @@ -2248,7 +2296,7 @@ func GetConsoleOutputCP() (cp uint32, err error) { } func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { - r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0) + r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -2256,7 +2304,7 @@ func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) ( } func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) + r0, _, e1 := syscall.SyscallN(procGetCurrentDirectoryW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2265,19 +2313,19 @@ func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { } func GetCurrentProcessId() (pid uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCurrentProcessId.Addr()) pid = uint32(r0) return } func GetCurrentThreadId() (id uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCurrentThreadId.Addr()) id = uint32(r0) return } func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) { - r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes))) if r1 == 0 { err = errnoErr(e1) } @@ -2285,13 +2333,13 @@ func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint6 } func GetDriveType(rootPathName *uint16) (driveType uint32) { - r0, _, _ := syscall.Syscall(procGetDriveTypeW.Addr(), 1, uintptr(unsafe.Pointer(rootPathName)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetDriveTypeW.Addr(), uintptr(unsafe.Pointer(rootPathName))) driveType = uint32(r0) return } func GetEnvironmentStrings() (envs *uint16, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetEnvironmentStringsW.Addr()) envs = (*uint16)(unsafe.Pointer(r0)) if envs == nil { err = errnoErr(e1) @@ -2300,7 +2348,7 @@ func GetEnvironmentStrings() (envs *uint16, err error) { } func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procGetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2309,7 +2357,7 @@ func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32 } func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0) + r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode))) if r1 == 0 { err = errnoErr(e1) } @@ -2317,7 +2365,7 @@ func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { } func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) + r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -2325,7 +2373,7 @@ func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { } func GetFileAttributes(name *uint16) (attrs uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name))) attrs = uint32(r0) if attrs == INVALID_FILE_ATTRIBUTES { err = errnoErr(e1) @@ -2334,7 +2382,7 @@ func GetFileAttributes(name *uint16) (attrs uint32, err error) { } func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) + r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } @@ -2342,7 +2390,7 @@ func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (e } func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen)) if r1 == 0 { err = errnoErr(e1) } @@ -2350,7 +2398,7 @@ func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, } func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } @@ -2358,7 +2406,7 @@ func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim } func GetFileType(filehandle Handle) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFileType.Addr(), uintptr(filehandle)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2367,7 +2415,7 @@ func GetFileType(filehandle Handle) (n uint32, err error) { } func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall6(procGetFinalPathNameByHandleW.Addr(), 4, uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFinalPathNameByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2376,7 +2424,7 @@ func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32 } func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFullPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2385,13 +2433,13 @@ func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) ( } func GetLargePageMinimum() (size uintptr) { - r0, _, _ := syscall.Syscall(procGetLargePageMinimum.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetLargePageMinimum.Addr()) size = uintptr(r0) return } func GetLastError() (lasterr error) { - r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetLastError.Addr()) if r0 != 0 { lasterr = syscall.Errno(r0) } @@ -2399,7 +2447,7 @@ func GetLastError() (lasterr error) { } func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLogicalDriveStringsW.Addr(), 2, uintptr(bufferLength), uintptr(unsafe.Pointer(buffer)), 0) + r0, _, e1 := syscall.SyscallN(procGetLogicalDriveStringsW.Addr(), uintptr(bufferLength), uintptr(unsafe.Pointer(buffer))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2408,7 +2456,7 @@ func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err } func GetLogicalDrives() (drivesBitMask uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLogicalDrives.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetLogicalDrives.Addr()) drivesBitMask = uint32(r0) if drivesBitMask == 0 { err = errnoErr(e1) @@ -2417,7 +2465,7 @@ func GetLogicalDrives() (drivesBitMask uint32, err error) { } func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) + r0, _, e1 := syscall.SyscallN(procGetLongPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2426,13 +2474,13 @@ func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err er } func GetMaximumProcessorCount(groupNumber uint16) (ret uint32) { - r0, _, _ := syscall.Syscall(procGetMaximumProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) + r0, _, _ := syscall.SyscallN(procGetMaximumProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetModuleFileNameW.Addr(), 3, uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procGetModuleFileNameW.Addr(), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2441,7 +2489,7 @@ func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, } func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) { - r1, _, e1 := syscall.Syscall(procGetModuleHandleExW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) + r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) if r1 == 0 { err = errnoErr(e1) } @@ -2449,7 +2497,7 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er } func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeClientProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID))) if r1 == 0 { err = errnoErr(e1) } @@ -2457,7 +2505,7 @@ func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err erro } func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2465,7 +2513,7 @@ func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, m } func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) if r1 == 0 { err = errnoErr(e1) } @@ -2473,7 +2521,15 @@ func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint3 } func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeServerProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) { + r1, _, e1 := syscall.SyscallN(procGetNumberOfConsoleInputEvents.Addr(), uintptr(console), uintptr(unsafe.Pointer(numevents))) if r1 == 0 { err = errnoErr(e1) } @@ -2485,7 +2541,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa if wait { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procGetOverlappedResult.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -2493,7 +2549,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa } func GetPriorityClass(process Handle) (ret uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetPriorityClass.Addr(), 1, uintptr(process), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetPriorityClass.Addr(), uintptr(process)) ret = uint32(r0) if ret == 0 { err = errnoErr(e1) @@ -2511,7 +2567,7 @@ func GetProcAddress(module Handle, procname string) (proc uintptr, err error) { } func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { - r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0) + r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), uintptr(unsafe.Pointer(procname))) proc = uintptr(r0) if proc == 0 { err = errnoErr(e1) @@ -2520,7 +2576,7 @@ func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { } func GetProcessId(process Handle) (id uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetProcessId.Addr(), 1, uintptr(process), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetProcessId.Addr(), uintptr(process)) id = uint32(r0) if id == 0 { err = errnoErr(e1) @@ -2529,7 +2585,7 @@ func GetProcessId(process Handle) (id uint32, err error) { } func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetProcessPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2537,7 +2593,7 @@ func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uin } func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetProcessShutdownParameters.Addr(), 2, uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags)), 0) + r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } @@ -2545,7 +2601,7 @@ func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { } func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0) + r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime))) if r1 == 0 { err = errnoErr(e1) } @@ -2553,12 +2609,12 @@ func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, } func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) { - syscall.Syscall6(procGetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags)), 0, 0) + syscall.SyscallN(procGetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags))) return } func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0) + r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout)) if r1 == 0 { err = errnoErr(e1) } @@ -2566,7 +2622,7 @@ func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overl } func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) + r0, _, e1 := syscall.SyscallN(procGetShortPathNameW.Addr(), uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2575,12 +2631,12 @@ func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uin } func getStartupInfo(startupInfo *StartupInfo) { - syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0) + syscall.SyscallN(procGetStartupInfoW.Addr(), uintptr(unsafe.Pointer(startupInfo))) return } func GetStdHandle(stdhandle uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetStdHandle.Addr(), uintptr(stdhandle)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2589,7 +2645,7 @@ func GetStdHandle(stdhandle uint32) (handle Handle, err error) { } func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetSystemDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetSystemDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2598,7 +2654,7 @@ func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { } func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetSystemPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2606,17 +2662,17 @@ func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint } func GetSystemTimeAsFileTime(time *Filetime) { - syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0) + syscall.SyscallN(procGetSystemTimeAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func GetSystemTimePreciseAsFileTime(time *Filetime) { - syscall.Syscall(procGetSystemTimePreciseAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0) + syscall.SyscallN(procGetSystemTimePreciseAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetSystemWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetSystemWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2625,7 +2681,7 @@ func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err erro } func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) + r0, _, e1 := syscall.SyscallN(procGetTempPathW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2634,7 +2690,7 @@ func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { } func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetThreadPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2642,13 +2698,13 @@ func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint } func getTickCount64() (ms uint64) { - r0, _, _ := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetTickCount64.Addr()) ms = uint64(r0) return } func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetTimeZoneInformation.Addr(), uintptr(unsafe.Pointer(tzi))) rc = uint32(r0) if rc == 0xffffffff { err = errnoErr(e1) @@ -2657,7 +2713,7 @@ func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { } func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetUserPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2665,7 +2721,7 @@ func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16 } func GetVersion() (ver uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetVersion.Addr()) ver = uint32(r0) if ver == 0 { err = errnoErr(e1) @@ -2674,7 +2730,7 @@ func GetVersion() (ver uint32, err error) { } func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetVolumeInformationByHandleW.Addr(), 8, uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0) + r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2682,7 +2738,7 @@ func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeN } func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetVolumeInformationW.Addr(), 8, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0) + r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2690,7 +2746,7 @@ func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volume } func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetVolumeNameForVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) + r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) if r1 == 0 { err = errnoErr(e1) } @@ -2698,7 +2754,7 @@ func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint } func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetVolumePathNameW.Addr(), 3, uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2706,7 +2762,7 @@ func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength ui } func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetVolumePathNamesForVolumeNameW.Addr(), 4, uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength))) if r1 == 0 { err = errnoErr(e1) } @@ -2714,7 +2770,7 @@ func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16 } func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2723,7 +2779,7 @@ func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { } func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -2735,7 +2791,7 @@ func IsWow64Process(handle Handle, isWow64 *bool) (err error) { if *isWow64 { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(&_p0)), 0) + r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0))) *isWow64 = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -2748,7 +2804,7 @@ func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint1 if err != nil { return } - r1, _, e1 := syscall.Syscall(procIsWow64Process2.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) + r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) if r1 == 0 { err = errnoErr(e1) } @@ -2765,7 +2821,7 @@ func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, e } func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadLibraryExW.Addr(), 3, uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procLoadLibraryExW.Addr(), uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2783,7 +2839,7 @@ func LoadLibrary(libname string) (handle Handle, err error) { } func _LoadLibrary(libname *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0) + r0, _, e1 := syscall.SyscallN(procLoadLibraryW.Addr(), uintptr(unsafe.Pointer(libname))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2792,7 +2848,7 @@ func _LoadLibrary(libname *uint16) (handle Handle, err error) { } func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + r0, _, e1 := syscall.SyscallN(procLoadResource.Addr(), uintptr(module), uintptr(resInfo)) resData = Handle(r0) if resData == 0 { err = errnoErr(e1) @@ -2801,7 +2857,7 @@ func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { } func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { - r0, _, e1 := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(length), 0) + r0, _, e1 := syscall.SyscallN(procLocalAlloc.Addr(), uintptr(flags), uintptr(length)) ptr = uintptr(r0) if ptr == 0 { err = errnoErr(e1) @@ -2810,7 +2866,7 @@ func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { } func LocalFree(hmem Handle) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0) + r0, _, e1 := syscall.SyscallN(procLocalFree.Addr(), uintptr(hmem)) handle = Handle(r0) if handle != 0 { err = errnoErr(e1) @@ -2819,7 +2875,7 @@ func LocalFree(hmem Handle) (handle Handle, err error) { } func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) + r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -2827,7 +2883,7 @@ func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, byt } func LockResource(resData Handle) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall(procLockResource.Addr(), 1, uintptr(resData), 0, 0) + r0, _, e1 := syscall.SyscallN(procLockResource.Addr(), uintptr(resData)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) @@ -2836,7 +2892,7 @@ func LockResource(resData Handle) (addr uintptr, err error) { } func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0) + r0, _, e1 := syscall.SyscallN(procMapViewOfFile.Addr(), uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) @@ -2845,7 +2901,7 @@ func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow ui } func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procModule32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) + r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2853,7 +2909,7 @@ func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { } func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procModule32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) + r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2861,7 +2917,7 @@ func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { } func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -2869,7 +2925,7 @@ func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { } func MoveFile(from *uint16, to *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0) + r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to))) if r1 == 0 { err = errnoErr(e1) } @@ -2877,7 +2933,7 @@ func MoveFile(from *uint16, to *uint16) (err error) { } func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { - r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) + r0, _, e1 := syscall.SyscallN(procMultiByteToWideChar.Addr(), uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) nwrite = int32(r0) if nwrite == 0 { err = errnoErr(e1) @@ -2890,7 +2946,7 @@ func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenEventW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procOpenEventW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2903,7 +2959,7 @@ func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenMutexW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procOpenMutexW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2916,7 +2972,7 @@ func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (ha if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) + r0, _, e1 := syscall.SyscallN(procOpenProcess.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2929,7 +2985,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenThread.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) + r0, _, e1 := syscall.SyscallN(procOpenThread.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2938,7 +2994,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand } func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0) + r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -2946,7 +3002,7 @@ func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overla } func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) + r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2954,7 +3010,7 @@ func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { } func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) + r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2962,7 +3018,7 @@ func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { } func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procProcessIdToSessionId.Addr(), 2, uintptr(pid), uintptr(unsafe.Pointer(sessionid)), 0) + r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid))) if r1 == 0 { err = errnoErr(e1) } @@ -2970,7 +3026,7 @@ func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { } func PulseEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procPulseEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -2978,7 +3034,7 @@ func PulseEvent(event Handle) (err error) { } func PurgeComm(handle Handle, dwFlags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procPurgeComm.Addr(), 2, uintptr(handle), uintptr(dwFlags), 0) + r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags)) if r1 == 0 { err = errnoErr(e1) } @@ -2986,7 +3042,7 @@ func PurgeComm(handle Handle, dwFlags uint32) (err error) { } func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procQueryDosDeviceW.Addr(), 3, uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) + r0, _, e1 := syscall.SyscallN(procQueryDosDeviceW.Addr(), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2995,7 +3051,7 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3 } func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryFullProcessImageNameW.Addr(), 4, uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -3003,7 +3059,7 @@ func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size } func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0) + r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen))) if r1 == 0 { err = errnoErr(e1) } @@ -3011,7 +3067,7 @@ func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobO } func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0) + r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl))) if r1 == 0 { err = errnoErr(e1) } @@ -3023,7 +3079,7 @@ func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree if watchSubTree { _p0 = 1 } - r1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0) + r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == 0 { err = errnoErr(e1) } @@ -3035,7 +3091,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3043,7 +3099,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( } func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procReadProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead)), 0) + r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead))) if r1 == 0 { err = errnoErr(e1) } @@ -3051,7 +3107,7 @@ func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size u } func ReleaseMutex(mutex Handle) (err error) { - r1, _, e1 := syscall.Syscall(procReleaseMutex.Addr(), 1, uintptr(mutex), 0, 0) + r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex)) if r1 == 0 { err = errnoErr(e1) } @@ -3059,7 +3115,7 @@ func ReleaseMutex(mutex Handle) (err error) { } func RemoveDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3067,7 +3123,7 @@ func RemoveDirectory(path *uint16) (err error) { } func RemoveDllDirectory(cookie uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procRemoveDllDirectory.Addr(), 1, uintptr(cookie), 0, 0) + r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie)) if r1 == 0 { err = errnoErr(e1) } @@ -3075,7 +3131,7 @@ func RemoveDllDirectory(cookie uintptr) (err error) { } func ResetEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procResetEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -3083,7 +3139,7 @@ func ResetEvent(event Handle) (err error) { } func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { - r0, _, _ := syscall.Syscall(procResizePseudoConsole.Addr(), 2, uintptr(pconsole), uintptr(size), 0) + r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size)) if r0 != 0 { hr = syscall.Errno(r0) } @@ -3091,7 +3147,7 @@ func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { } func ResumeThread(thread Handle) (ret uint32, err error) { - r0, _, e1 := syscall.Syscall(procResumeThread.Addr(), 1, uintptr(thread), 0, 0) + r0, _, e1 := syscall.SyscallN(procResumeThread.Addr(), uintptr(thread)) ret = uint32(r0) if ret == 0xffffffff { err = errnoErr(e1) @@ -3100,7 +3156,7 @@ func ResumeThread(thread Handle) (ret uint32, err error) { } func SetCommBreak(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommBreak.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3108,7 +3164,7 @@ func SetCommBreak(handle Handle) (err error) { } func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommMask.Addr(), 2, uintptr(handle), uintptr(dwEvtMask), 0) + r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask)) if r1 == 0 { err = errnoErr(e1) } @@ -3116,7 +3172,7 @@ func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { } func SetCommState(handle Handle, lpDCB *DCB) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } @@ -3124,7 +3180,7 @@ func SetCommState(handle Handle, lpDCB *DCB) (err error) { } func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } @@ -3132,7 +3188,7 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { } func SetConsoleCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } @@ -3140,7 +3196,7 @@ func SetConsoleCP(cp uint32) (err error) { } func setConsoleCursorPosition(console Handle, position uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position)) if r1 == 0 { err = errnoErr(e1) } @@ -3148,7 +3204,7 @@ func setConsoleCursorPosition(console Handle, position uint32) (err error) { } func SetConsoleMode(console Handle, mode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(console), uintptr(mode), 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode)) if r1 == 0 { err = errnoErr(e1) } @@ -3156,7 +3212,7 @@ func SetConsoleMode(console Handle, mode uint32) (err error) { } func SetConsoleOutputCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } @@ -3164,7 +3220,7 @@ func SetConsoleOutputCP(cp uint32) (err error) { } func SetCurrentDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3172,7 +3228,7 @@ func SetCurrentDirectory(path *uint16) (err error) { } func SetDefaultDllDirectories(directoryFlags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetDefaultDllDirectories.Addr(), 1, uintptr(directoryFlags), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags)) if r1 == 0 { err = errnoErr(e1) } @@ -3189,7 +3245,7 @@ func SetDllDirectory(path string) (err error) { } func _SetDllDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetDllDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3197,7 +3253,7 @@ func _SetDllDirectory(path *uint16) (err error) { } func SetEndOfFile(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3205,7 +3261,7 @@ func SetEndOfFile(handle Handle) (err error) { } func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) + r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value))) if r1 == 0 { err = errnoErr(e1) } @@ -3213,13 +3269,13 @@ func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { } func SetErrorMode(mode uint32) (ret uint32) { - r0, _, _ := syscall.Syscall(procSetErrorMode.Addr(), 1, uintptr(mode), 0, 0) + r0, _, _ := syscall.SyscallN(procSetErrorMode.Addr(), uintptr(mode)) ret = uint32(r0) return } func SetEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -3227,7 +3283,7 @@ func SetEvent(event Handle) (err error) { } func SetFileAttributes(name *uint16, attrs uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0) + r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs)) if r1 == 0 { err = errnoErr(e1) } @@ -3235,7 +3291,7 @@ func SetFileAttributes(name *uint16, attrs uint32) (err error) { } func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3243,7 +3299,7 @@ func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) } func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) if r1 == 0 { err = errnoErr(e1) } @@ -3251,7 +3307,7 @@ func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inB } func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) { - r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetFilePointer.Addr(), uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence)) newlowoffset = uint32(r0) if newlowoffset == 0xffffffff { err = errnoErr(e1) @@ -3260,7 +3316,7 @@ func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence } func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } @@ -3268,7 +3324,7 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim } func SetFileValidData(handle Handle, validDataLength int64) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength)) if r1 == 0 { err = errnoErr(e1) } @@ -3276,7 +3332,7 @@ func SetFileValidData(handle Handle, validDataLength int64) (err error) { } func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3284,7 +3340,7 @@ func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) } func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { - r0, _, e1 := syscall.Syscall6(procSetInformationJobObject.Addr(), 4, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength)) ret = int(r0) if ret == 0 { err = errnoErr(e1) @@ -3293,7 +3349,7 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb } func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetNamedPipeHandleState.Addr(), 4, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout))) if r1 == 0 { err = errnoErr(e1) } @@ -3301,7 +3357,7 @@ func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uin } func SetPriorityClass(process Handle, priorityClass uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0) + r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass)) if r1 == 0 { err = errnoErr(e1) } @@ -3313,7 +3369,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { if disable { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetProcessPriorityBoost.Addr(), 2, uintptr(process), uintptr(_p0), 0) + r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -3321,7 +3377,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { } func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetProcessShutdownParameters.Addr(), 2, uintptr(level), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3329,7 +3385,7 @@ func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { } func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3337,7 +3393,7 @@ func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr } func SetStdHandle(stdhandle uint32, handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0) + r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3345,7 +3401,7 @@ func SetStdHandle(stdhandle uint32, handle Handle) (err error) { } func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetVolumeLabelW.Addr(), 2, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName)), 0) + r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } @@ -3353,7 +3409,7 @@ func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { } func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetVolumeMountPointW.Addr(), 2, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), 0) + r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } @@ -3361,7 +3417,7 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro } func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetupComm.Addr(), 3, uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) + r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) if r1 == 0 { err = errnoErr(e1) } @@ -3369,7 +3425,7 @@ func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { } func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { - r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + r0, _, e1 := syscall.SyscallN(procSizeofResource.Addr(), uintptr(module), uintptr(resInfo)) size = uint32(r0) if size == 0 { err = errnoErr(e1) @@ -3382,13 +3438,13 @@ func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { if alertable { _p0 = 1 } - r0, _, _ := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(milliseconds), uintptr(_p0), 0) + r0, _, _ := syscall.SyscallN(procSleepEx.Addr(), uintptr(milliseconds), uintptr(_p0)) ret = uint32(r0) return } func TerminateJobObject(job Handle, exitCode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procTerminateJobObject.Addr(), 2, uintptr(job), uintptr(exitCode), 0) + r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode)) if r1 == 0 { err = errnoErr(e1) } @@ -3396,7 +3452,7 @@ func TerminateJobObject(job Handle, exitCode uint32) (err error) { } func TerminateProcess(handle Handle, exitcode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0) + r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode)) if r1 == 0 { err = errnoErr(e1) } @@ -3404,7 +3460,7 @@ func TerminateProcess(handle Handle, exitcode uint32) (err error) { } func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procThread32First.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -3412,7 +3468,7 @@ func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { } func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procThread32Next.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -3420,7 +3476,7 @@ func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { } func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procUnlockFileEx.Addr(), 5, uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3428,7 +3484,7 @@ func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint3 } func UnmapViewOfFile(addr uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0) + r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr)) if r1 == 0 { err = errnoErr(e1) } @@ -3436,7 +3492,7 @@ func UnmapViewOfFile(addr uintptr) (err error) { } func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { - r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize))) if r1 == 0 { err = errnoErr(e1) } @@ -3444,7 +3500,7 @@ func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, } func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) { - r0, _, e1 := syscall.Syscall6(procVirtualAlloc.Addr(), 4, uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect), 0, 0) + r0, _, e1 := syscall.SyscallN(procVirtualAlloc.Addr(), uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect)) value = uintptr(r0) if value == 0 { err = errnoErr(e1) @@ -3453,7 +3509,7 @@ func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint3 } func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualFree.Addr(), 3, uintptr(address), uintptr(size), uintptr(freetype)) + r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype)) if r1 == 0 { err = errnoErr(e1) } @@ -3461,7 +3517,7 @@ func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { } func VirtualLock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3469,7 +3525,7 @@ func VirtualLock(addr uintptr, length uintptr) (err error) { } func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualProtect.Addr(), 4, uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect)), 0, 0) + r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect))) if r1 == 0 { err = errnoErr(e1) } @@ -3477,7 +3533,7 @@ func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect } func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualProtectEx.Addr(), 5, uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect)), 0) + r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect))) if r1 == 0 { err = errnoErr(e1) } @@ -3485,7 +3541,7 @@ func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect } func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualQuery.Addr(), 3, uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) + r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3493,7 +3549,7 @@ func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintpt } func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualQueryEx.Addr(), 4, uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length), 0, 0) + r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3501,7 +3557,7 @@ func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformat } func VirtualUnlock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3509,13 +3565,13 @@ func VirtualUnlock(addr uintptr, length uintptr) (err error) { } func WTSGetActiveConsoleSessionId() (sessionID uint32) { - r0, _, _ := syscall.Syscall(procWTSGetActiveConsoleSessionId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procWTSGetActiveConsoleSessionId.Addr()) sessionID = uint32(r0) return } func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procWaitCommEvent.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) + r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3527,7 +3583,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil if waitAll { _p0 = 1 } - r0, _, e1 := syscall.Syscall6(procWaitForMultipleObjects.Addr(), 4, uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds), 0, 0) + r0, _, e1 := syscall.SyscallN(procWaitForMultipleObjects.Addr(), uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) @@ -3536,7 +3592,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil } func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) { - r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0) + r0, _, e1 := syscall.SyscallN(procWaitForSingleObject.Addr(), uintptr(handle), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) @@ -3545,7 +3601,7 @@ func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, } func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0) + r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved))) if r1 == 0 { err = errnoErr(e1) } @@ -3557,7 +3613,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3565,7 +3621,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) } func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procWriteProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten)), 0) + r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten))) if r1 == 0 { err = errnoErr(e1) } @@ -3573,7 +3629,7 @@ func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size } func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3581,12 +3637,12 @@ func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32 } func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) { - syscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0) + syscall.SyscallN(procGetAcceptExSockaddrs.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen))) return } func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0) + r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3594,7 +3650,7 @@ func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint } func NetApiBufferFree(buf *byte) (neterr error) { - r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0) + r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3602,7 +3658,7 @@ func NetApiBufferFree(buf *byte) (neterr error) { } func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { - r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) + r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3610,7 +3666,7 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete } func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { - r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) + r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3618,7 +3674,7 @@ func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, pr } func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { - r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) + r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3626,7 +3682,7 @@ func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **by } func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall12(procNtCreateFile.Addr(), 11, uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength), 0) + r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3634,7 +3690,7 @@ func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO } func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) + r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3642,7 +3698,7 @@ func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, i } func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtQueryInformationProcess.Addr(), 5, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen)), 0) + r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3650,7 +3706,7 @@ func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe } func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtQuerySystemInformation.Addr(), 4, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen)), 0, 0) + r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3658,7 +3714,7 @@ func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInf } func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtSetInformationFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class), 0) + r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3666,7 +3722,7 @@ func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, } func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtSetInformationProcess.Addr(), 4, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), 0, 0) + r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3674,7 +3730,7 @@ func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.P } func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall(procNtSetSystemInformation.Addr(), 3, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) + r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3682,13 +3738,13 @@ func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoL } func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { - r0, _, _ := syscall.Syscall(procRtlAddFunctionTable.Addr(), 3, uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) + r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) ret = r0 != 0 return } func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(acl)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3696,13 +3752,13 @@ func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { } func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { - r0, _, _ := syscall.Syscall(procRtlDeleteFunctionTable.Addr(), 1, uintptr(unsafe.Pointer(functionTable)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable))) ret = r0 != 0 return } func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3710,7 +3766,7 @@ func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFile } func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3718,18 +3774,18 @@ func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString } func RtlGetCurrentPeb() (peb *PEB) { - r0, _, _ := syscall.Syscall(procRtlGetCurrentPeb.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procRtlGetCurrentPeb.Addr()) peb = (*PEB)(unsafe.Pointer(r0)) return } func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) { - syscall.Syscall(procRtlGetNtVersionNumbers.Addr(), 3, uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) + syscall.SyscallN(procRtlGetNtVersionNumbers.Addr(), uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) return } func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { - r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3737,23 +3793,23 @@ func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { } func RtlInitString(destinationString *NTString, sourceString *byte) { - syscall.Syscall(procRtlInitString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + syscall.SyscallN(procRtlInitString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) { - syscall.Syscall(procRtlInitUnicodeString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + syscall.SyscallN(procRtlInitUnicodeString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(ntstatus), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(ntstatus)) ret = syscall.Errno(r0) return } func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { - r0, _, _ := syscall.Syscall(procCLSIDFromString.Addr(), 2, uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)), 0) + r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3761,7 +3817,7 @@ func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { } func coCreateGuid(pguid *GUID) (ret error) { - r0, _, _ := syscall.Syscall(procCoCreateGuid.Addr(), 1, uintptr(unsafe.Pointer(pguid)), 0, 0) + r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3769,7 +3825,7 @@ func coCreateGuid(pguid *GUID) (ret error) { } func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { - r0, _, _ := syscall.Syscall6(procCoGetObject.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)), 0, 0) + r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3777,7 +3833,7 @@ func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable * } func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { - r0, _, _ := syscall.Syscall(procCoInitializeEx.Addr(), 2, uintptr(reserved), uintptr(coInit), 0) + r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3785,23 +3841,23 @@ func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { } func CoTaskMemFree(address unsafe.Pointer) { - syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0) + syscall.SyscallN(procCoTaskMemFree.Addr(), uintptr(address)) return } func CoUninitialize() { - syscall.Syscall(procCoUninitialize.Addr(), 0, 0, 0, 0) + syscall.SyscallN(procCoUninitialize.Addr()) return } func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { - r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) + r0, _, _ := syscall.SyscallN(procStringFromGUID2.Addr(), uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) chars = int32(r0) return } func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumProcessModules.Addr(), 4, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -3809,7 +3865,7 @@ func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uin } func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumProcessModulesEx.Addr(), 5, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag), 0) + r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag)) if r1 == 0 { err = errnoErr(e1) } @@ -3817,7 +3873,7 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u } func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) + r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) if r1 == 0 { err = errnoErr(e1) } @@ -3825,7 +3881,7 @@ func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err } func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleBaseNameW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -3833,7 +3889,7 @@ func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uin } func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleFileNameExW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -3841,7 +3897,7 @@ func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size u } func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleInformation.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } @@ -3849,7 +3905,7 @@ func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb } func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) { - r1, _, e1 := syscall.Syscall(procQueryWorkingSetEx.Addr(), 3, uintptr(process), uintptr(pv), uintptr(cb)) + r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } @@ -3861,7 +3917,7 @@ func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callb if ret != nil { return } - r0, _, _ := syscall.Syscall6(procSubscribeServiceChangeNotifications.Addr(), 5, uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription)), 0) + r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3873,12 +3929,12 @@ func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error) { if err != nil { return } - syscall.Syscall(procUnsubscribeServiceChangeNotifications.Addr(), 1, uintptr(subscription), 0, 0) + syscall.SyscallN(procUnsubscribeServiceChangeNotifications.Addr(), uintptr(subscription)) return } func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) + r1, _, e1 := syscall.SyscallN(procGetUserNameExW.Addr(), uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } @@ -3886,7 +3942,7 @@ func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err er } func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0) + r1, _, e1 := syscall.SyscallN(procTranslateNameW.Addr(), uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } @@ -3894,7 +3950,7 @@ func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint } func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiBuildDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) + r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } @@ -3902,7 +3958,7 @@ func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiCallClassInstaller.Addr(), 3, uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3910,7 +3966,7 @@ func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInf } func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiCancelDriverInfoSearch.Addr(), 1, uintptr(deviceInfoSet), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } @@ -3918,7 +3974,7 @@ func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { } func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiClassGuidsFromNameExW.Addr(), 6, uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -3926,7 +3982,7 @@ func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGu } func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiClassNameFromGuidExW.Addr(), 6, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -3934,7 +3990,7 @@ func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSiz } func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { - r0, _, e1 := syscall.Syscall6(procSetupDiCreateDeviceInfoListExW.Addr(), 4, uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoListExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) @@ -3943,7 +3999,7 @@ func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineN } func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiCreateDeviceInfoW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3951,7 +4007,7 @@ func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUI } func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiDestroyDeviceInfoList.Addr(), 1, uintptr(deviceInfoSet), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } @@ -3959,7 +4015,7 @@ func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { } func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiDestroyDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) + r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } @@ -3967,7 +4023,7 @@ func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiEnumDeviceInfo.Addr(), 3, uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3975,7 +4031,7 @@ func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfo } func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiEnumDriverInfoW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3983,7 +4039,7 @@ func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, d } func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { - r0, _, e1 := syscall.Syscall9(procSetupDiGetClassDevsExW.Addr(), 7, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetupDiGetClassDevsExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) @@ -3992,7 +4048,7 @@ func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintp } func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetClassInstallParamsW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4000,7 +4056,7 @@ func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInfoListDetailW.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData))) if r1 == 0 { err = errnoErr(e1) } @@ -4008,7 +4064,7 @@ func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailDa } func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } @@ -4016,7 +4072,7 @@ func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf } func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetDeviceInstanceIdW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4024,7 +4080,7 @@ func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiGetDevicePropertyW.Addr(), 8, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -4032,7 +4088,7 @@ func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiGetDeviceRegistryPropertyW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4040,7 +4096,7 @@ func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev } func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetDriverInfoDetailW.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4048,7 +4104,7 @@ func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4056,7 +4112,7 @@ func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4064,7 +4120,7 @@ func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) { - r0, _, e1 := syscall.Syscall6(procSetupDiOpenDevRegKey.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) + r0, _, e1 := syscall.SyscallN(procSetupDiOpenDevRegKey.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) key = Handle(r0) if key == InvalidHandle { err = errnoErr(e1) @@ -4073,7 +4129,7 @@ func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Sc } func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiSetClassInstallParamsW.Addr(), 4, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize)) if r1 == 0 { err = errnoErr(e1) } @@ -4081,7 +4137,7 @@ func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) + r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } @@ -4089,7 +4145,7 @@ func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf } func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiSetDeviceRegistryPropertyW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize)) if r1 == 0 { err = errnoErr(e1) } @@ -4097,7 +4153,7 @@ func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev } func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4105,7 +4161,7 @@ func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4113,7 +4169,7 @@ func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procSetupUninstallOEMInfW.Addr(), 3, uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -4121,7 +4177,7 @@ func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (er } func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { - r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0) + r0, _, e1 := syscall.SyscallN(procCommandLineToArgvW.Addr(), uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc))) argv = (**uint16)(unsafe.Pointer(r0)) if argv == nil { err = errnoErr(e1) @@ -4130,7 +4186,7 @@ func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { } func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { - r0, _, _ := syscall.Syscall6(procSHGetKnownFolderPath.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path)), 0, 0) + r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -4138,7 +4194,7 @@ func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **u } func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) { - r1, _, e1 := syscall.Syscall6(procShellExecuteW.Addr(), 6, uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) + r1, _, e1 := syscall.SyscallN(procShellExecuteW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) if r1 <= 32 { err = errnoErr(e1) } @@ -4146,12 +4202,12 @@ func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *ui } func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) { - syscall.Syscall(procEnumChildWindows.Addr(), 3, uintptr(hwnd), uintptr(enumFunc), uintptr(param)) + syscall.SyscallN(procEnumChildWindows.Addr(), uintptr(hwnd), uintptr(enumFunc), uintptr(param)) return } func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall(procEnumWindows.Addr(), 2, uintptr(enumFunc), uintptr(param), 0) + r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param)) if r1 == 0 { err = errnoErr(e1) } @@ -4159,7 +4215,7 @@ func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { } func ExitWindowsEx(flags uint32, reason uint32) (err error) { - r1, _, e1 := syscall.Syscall(procExitWindowsEx.Addr(), 2, uintptr(flags), uintptr(reason), 0) + r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } @@ -4167,7 +4223,7 @@ func ExitWindowsEx(flags uint32, reason uint32) (err error) { } func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) { - r0, _, e1 := syscall.Syscall(procGetClassNameW.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) + r0, _, e1 := syscall.SyscallN(procGetClassNameW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) copied = int32(r0) if copied == 0 { err = errnoErr(e1) @@ -4176,19 +4232,19 @@ func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, e } func GetDesktopWindow() (hwnd HWND) { - r0, _, _ := syscall.Syscall(procGetDesktopWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetDesktopWindow.Addr()) hwnd = HWND(r0) return } func GetForegroundWindow() (hwnd HWND) { - r0, _, _ := syscall.Syscall(procGetForegroundWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetForegroundWindow.Addr()) hwnd = HWND(r0) return } func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { - r1, _, e1 := syscall.Syscall(procGetGUIThreadInfo.Addr(), 2, uintptr(thread), uintptr(unsafe.Pointer(info)), 0) + r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -4196,19 +4252,19 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { } func GetKeyboardLayout(tid uint32) (hkl Handle) { - r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) + r0, _, _ := syscall.SyscallN(procGetKeyboardLayout.Addr(), uintptr(tid)) hkl = Handle(r0) return } func GetShellWindow() (shellWindow HWND) { - r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetShellWindow.Addr()) shellWindow = HWND(r0) return } func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetWindowThreadProcessId.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(pid)), 0) + r0, _, e1 := syscall.SyscallN(procGetWindowThreadProcessId.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(pid))) tid = uint32(r0) if tid == 0 { err = errnoErr(e1) @@ -4217,25 +4273,25 @@ func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { } func IsWindow(hwnd HWND) (isWindow bool) { - r0, _, _ := syscall.Syscall(procIsWindow.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd)) isWindow = r0 != 0 return } func IsWindowUnicode(hwnd HWND) (isUnicode bool) { - r0, _, _ := syscall.Syscall(procIsWindowUnicode.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd)) isUnicode = r0 != 0 return } func IsWindowVisible(hwnd HWND) (isVisible bool) { - r0, _, _ := syscall.Syscall(procIsWindowVisible.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd)) isVisible = r0 != 0 return } func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) + r0, _, e1 := syscall.SyscallN(procLoadKeyboardLayoutW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags)) hkl = Handle(r0) if hkl == 0 { err = errnoErr(e1) @@ -4244,7 +4300,7 @@ func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { } func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { - r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) + r0, _, e1 := syscall.SyscallN(procMessageBoxW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype)) ret = int32(r0) if ret == 0 { err = errnoErr(e1) @@ -4253,13 +4309,13 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i } func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { - r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) + r0, _, _ := syscall.SyscallN(procToUnicodeEx.Addr(), uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl)) ret = int32(r0) return } func UnloadKeyboardLayout(hkl Handle) (err error) { - r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) + r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl)) if r1 == 0 { err = errnoErr(e1) } @@ -4271,7 +4327,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( if inheritExisting { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procCreateEnvironmentBlock.Addr(), 3, uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -4279,7 +4335,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( } func DestroyEnvironmentBlock(block *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDestroyEnvironmentBlock.Addr(), 1, uintptr(unsafe.Pointer(block)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block))) if r1 == 0 { err = errnoErr(e1) } @@ -4287,7 +4343,7 @@ func DestroyEnvironmentBlock(block *uint16) (err error) { } func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) + r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) if r1 == 0 { err = errnoErr(e1) } @@ -4304,7 +4360,7 @@ func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32 } func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileVersionInfoSizeW.Addr(), 2, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle)), 0) + r0, _, e1 := syscall.SyscallN(procGetFileVersionInfoSizeW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle))) bufSize = uint32(r0) if bufSize == 0 { err = errnoErr(e1) @@ -4322,7 +4378,7 @@ func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer u } func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileVersionInfoW.Addr(), 4, uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer)) if r1 == 0 { err = errnoErr(e1) } @@ -4339,7 +4395,7 @@ func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer } func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVerQueryValueW.Addr(), 4, uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4347,7 +4403,7 @@ func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPoint } func TimeBeginPeriod(period uint32) (err error) { - r1, _, e1 := syscall.Syscall(proctimeBeginPeriod.Addr(), 1, uintptr(period), 0, 0) + r1, _, e1 := syscall.SyscallN(proctimeBeginPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } @@ -4355,7 +4411,7 @@ func TimeBeginPeriod(period uint32) (err error) { } func TimeEndPeriod(period uint32) (err error) { - r1, _, e1 := syscall.Syscall(proctimeEndPeriod.Addr(), 1, uintptr(period), 0, 0) + r1, _, e1 := syscall.SyscallN(proctimeEndPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } @@ -4363,7 +4419,7 @@ func TimeEndPeriod(period uint32) (err error) { } func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { - r0, _, _ := syscall.Syscall(procWinVerifyTrustEx.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) + r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -4371,12 +4427,12 @@ func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) } func FreeAddrInfoW(addrinfo *AddrinfoW) { - syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0) + syscall.SyscallN(procFreeAddrInfoW.Addr(), uintptr(unsafe.Pointer(addrinfo))) return } func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { - r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result))) if r0 != 0 { sockerr = syscall.Errno(r0) } @@ -4384,15 +4440,23 @@ func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, resul } func WSACleanup() (err error) { - r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0) + r1, _, e1 := syscall.SyscallN(procWSACleanup.Addr()) if r1 == socket_error { err = errnoErr(e1) } return } +func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) { + r1, _, e1 := syscall.SyscallN(procWSADuplicateSocketW.Addr(), uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info))) + if r1 != 0 { + err = errnoErr(e1) + } + return +} + func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) { - r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) + r0, _, e1 := syscall.SyscallN(procWSAEnumProtocolsW.Addr(), uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) n = int32(r0) if n == -1 { err = errnoErr(e1) @@ -4405,7 +4469,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f if wait { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) + r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } @@ -4413,7 +4477,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f } func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { - r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) + r1, _, e1 := syscall.SyscallN(procWSAIoctl.Addr(), uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == socket_error { err = errnoErr(e1) } @@ -4421,7 +4485,7 @@ func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbo } func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) { - r1, _, e1 := syscall.Syscall(procWSALookupServiceBeginW.Addr(), 3, uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceBeginW.Addr(), uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) if r1 == socket_error { err = errnoErr(e1) } @@ -4429,7 +4493,7 @@ func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) } func WSALookupServiceEnd(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procWSALookupServiceEnd.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceEnd.Addr(), uintptr(handle)) if r1 == socket_error { err = errnoErr(e1) } @@ -4437,7 +4501,7 @@ func WSALookupServiceEnd(handle Handle) (err error) { } func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) { - r1, _, e1 := syscall.Syscall6(procWSALookupServiceNextW.Addr(), 4, uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceNextW.Addr(), uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet))) if r1 == socket_error { err = errnoErr(e1) } @@ -4445,7 +4509,7 @@ func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WS } func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSARecv.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4453,7 +4517,7 @@ func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32 } func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) + r1, _, e1 := syscall.SyscallN(procWSARecvFrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4461,7 +4525,7 @@ func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *ui } func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSASend.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4469,7 +4533,7 @@ func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, } func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) + r1, _, e1 := syscall.SyscallN(procWSASendTo.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4477,7 +4541,7 @@ func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32 } func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procWSASocketW.Addr(), 6, uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procWSASocketW.Addr(), uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -4486,7 +4550,7 @@ func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, } func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { - r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) + r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data))) if r0 != 0 { sockerr = syscall.Errno(r0) } @@ -4494,7 +4558,7 @@ func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { } func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4502,7 +4566,7 @@ func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { } func Closesocket(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0) + r1, _, e1 := syscall.SyscallN(procclosesocket.Addr(), uintptr(s)) if r1 == socket_error { err = errnoErr(e1) } @@ -4510,7 +4574,7 @@ func Closesocket(s Handle) (err error) { } func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.SyscallN(procconnect.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4527,7 +4591,7 @@ func GetHostByName(name string) (h *Hostent, err error) { } func _GetHostByName(name *byte) (h *Hostent, err error) { - r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procgethostbyname.Addr(), uintptr(unsafe.Pointer(name))) h = (*Hostent)(unsafe.Pointer(r0)) if h == nil { err = errnoErr(e1) @@ -4536,7 +4600,7 @@ func _GetHostByName(name *byte) (h *Hostent, err error) { } func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4553,7 +4617,7 @@ func GetProtoByName(name string) (p *Protoent, err error) { } func _GetProtoByName(name *byte) (p *Protoent, err error) { - r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procgetprotobyname.Addr(), uintptr(unsafe.Pointer(name))) p = (*Protoent)(unsafe.Pointer(r0)) if p == nil { err = errnoErr(e1) @@ -4576,7 +4640,7 @@ func GetServByName(name string, proto string) (s *Servent, err error) { } func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { - r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0) + r0, _, e1 := syscall.SyscallN(procgetservbyname.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto))) s = (*Servent)(unsafe.Pointer(r0)) if s == nil { err = errnoErr(e1) @@ -4585,7 +4649,7 @@ func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { } func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4593,7 +4657,7 @@ func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { } func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) { - r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0) + r1, _, e1 := syscall.SyscallN(procgetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4601,7 +4665,7 @@ func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int3 } func listen(s Handle, backlog int32) (err error) { - r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0) + r1, _, e1 := syscall.SyscallN(proclisten.Addr(), uintptr(s), uintptr(backlog)) if r1 == socket_error { err = errnoErr(e1) } @@ -4609,7 +4673,7 @@ func listen(s Handle, backlog int32) (err error) { } func Ntohs(netshort uint16) (u uint16) { - r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0) + r0, _, _ := syscall.SyscallN(procntohs.Addr(), uintptr(netshort)) u = uint16(r0) return } @@ -4619,7 +4683,7 @@ func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen * if len(buf) > 0 { _p0 = &buf[0] } - r0, _, e1 := syscall.Syscall6(procrecvfrom.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall.SyscallN(procrecvfrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int32(r0) if n == -1 { err = errnoErr(e1) @@ -4632,7 +4696,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) ( if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procsendto.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) + r1, _, e1 := syscall.SyscallN(procsendto.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4640,7 +4704,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) ( } func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { - r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0) + r1, _, e1 := syscall.SyscallN(procsetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4648,7 +4712,7 @@ func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32 } func shutdown(s Handle, how int32) (err error) { - r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0) + r1, _, e1 := syscall.SyscallN(procshutdown.Addr(), uintptr(s), uintptr(how)) if r1 == socket_error { err = errnoErr(e1) } @@ -4656,7 +4720,7 @@ func shutdown(s Handle, how int32) (err error) { } func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol)) + r0, _, e1 := syscall.SyscallN(procsocket.Addr(), uintptr(af), uintptr(typ), uintptr(protocol)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -4665,7 +4729,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { } func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procWTSEnumerateSessionsW.Addr(), 5, uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count)), 0) + r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count))) if r1 == 0 { err = errnoErr(e1) } @@ -4673,12 +4737,12 @@ func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessio } func WTSFreeMemory(ptr uintptr) { - syscall.Syscall(procWTSFreeMemory.Addr(), 1, uintptr(ptr), 0, 0) + syscall.SyscallN(procWTSFreeMemory.Addr(), uintptr(ptr)) return } func WTSQueryUserToken(session uint32, token *Token) (err error) { - r1, _, e1 := syscall.Syscall(procWTSQueryUserToken.Addr(), 2, uintptr(session), uintptr(unsafe.Pointer(token)), 0) + r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/term/term_windows.go b/vendor/golang.org/x/term/term_windows.go index df6bf948e..0ddd81c02 100644 --- a/vendor/golang.org/x/term/term_windows.go +++ b/vendor/golang.org/x/term/term_windows.go @@ -20,12 +20,14 @@ func isTerminal(fd int) bool { return err == nil } +// This is intended to be used on a console input handle. +// See https://learn.microsoft.com/en-us/windows/console/setconsolemode func makeRaw(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } - raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) + raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT) raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { return nil, err diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index 14f89470a..9255449b9 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -6,6 +6,7 @@ package term import ( "bytes" + "fmt" "io" "runtime" "strconv" @@ -36,6 +37,26 @@ var vt100EscapeCodes = EscapeCodes{ Reset: []byte{keyEscape, '[', '0', 'm'}, } +// A History provides a (possibly bounded) queue of input lines read by [Terminal.ReadLine]. +type History interface { + // Add will be called by [Terminal.ReadLine] to add + // a new, most recent entry to the history. + // It is allowed to drop any entry, including + // the entry being added (e.g., if it's deemed an invalid entry), + // the least-recent entry (e.g., to keep the history bounded), + // or any other entry. + Add(entry string) + + // Len returns the number of entries in the history. + Len() int + + // At returns an entry from the history. + // Index 0 is the most-recently added entry and + // index Len()-1 is the least-recently added entry. + // If index is < 0 or >= Len(), it panics. + At(idx int) string +} + // Terminal contains the state for running a VT100 terminal that is capable of // reading lines of input. type Terminal struct { @@ -86,9 +107,14 @@ type Terminal struct { remainder []byte inBuf [256]byte - // history contains previously entered commands so that they can be - // accessed with the up and down keys. - history stRingBuffer + // History records and retrieves lines of input read by [ReadLine] which + // a user can retrieve and navigate using the up and down arrow keys. + // + // It is not safe to call ReadLine concurrently with any methods on History. + // + // [NewTerminal] sets this to a default implementation that records the + // last 100 lines of input. + History History // historyIndex stores the currently accessed history entry, where zero // means the immediately previous entry. historyIndex int @@ -111,6 +137,7 @@ func NewTerminal(c io.ReadWriter, prompt string) *Terminal { termHeight: 24, echo: true, historyIndex: -1, + History: &stRingBuffer{}, } } @@ -119,6 +146,7 @@ const ( keyCtrlD = 4 keyCtrlU = 21 keyEnter = '\r' + keyLF = '\n' keyEscape = 27 keyBackspace = 127 keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota @@ -385,7 +413,7 @@ func (t *Terminal) eraseNPreviousChars(n int) { } } -// countToLeftWord returns then number of characters from the cursor to the +// countToLeftWord returns the number of characters from the cursor to the // start of the previous word. func (t *Terminal) countToLeftWord() int { if t.pos == 0 { @@ -410,7 +438,7 @@ func (t *Terminal) countToLeftWord() int { return t.pos - pos } -// countToRightWord returns then number of characters from the cursor to the +// countToRightWord returns the number of characters from the cursor to the // start of the next word. func (t *Terminal) countToRightWord() int { pos := t.pos @@ -450,10 +478,27 @@ func visualLength(runes []rune) int { return length } +// historyAt unlocks the terminal and relocks it while calling History.At. +func (t *Terminal) historyAt(idx int) (string, bool) { + t.lock.Unlock() // Unlock to avoid deadlock if History methods use the output writer. + defer t.lock.Lock() // panic in At (or Len) protection. + if idx < 0 || idx >= t.History.Len() { + return "", false + } + return t.History.At(idx), true +} + +// historyAdd unlocks the terminal and relocks it while calling History.Add. +func (t *Terminal) historyAdd(entry string) { + t.lock.Unlock() // Unlock to avoid deadlock if History methods use the output writer. + defer t.lock.Lock() // panic in Add protection. + t.History.Add(entry) +} + // handleKey processes the given key and, optionally, returns a line of text // that the user has entered. func (t *Terminal) handleKey(key rune) (line string, ok bool) { - if t.pasteActive && key != keyEnter { + if t.pasteActive && key != keyEnter && key != keyLF { t.addKeyToLine(key) return } @@ -497,7 +542,7 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) { t.pos = len(t.line) t.moveCursorToPos(t.pos) case keyUp: - entry, ok := t.history.NthPreviousEntry(t.historyIndex + 1) + entry, ok := t.historyAt(t.historyIndex + 1) if !ok { return "", false } @@ -516,14 +561,14 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) { t.setLine(runes, len(runes)) t.historyIndex-- default: - entry, ok := t.history.NthPreviousEntry(t.historyIndex - 1) + entry, ok := t.historyAt(t.historyIndex - 1) if ok { t.historyIndex-- runes := []rune(entry) t.setLine(runes, len(runes)) } } - case keyEnter: + case keyEnter, keyLF: t.moveCursorToPos(len(t.line)) t.queue([]rune("\r\n")) line = string(t.line) @@ -768,6 +813,10 @@ func (t *Terminal) readLine() (line string, err error) { if !t.pasteActive { lineIsPasted = false } + // If we have CR, consume LF if present (CRLF sequence) to avoid returning an extra empty line. + if key == keyEnter && len(rest) > 0 && rest[0] == keyLF { + rest = rest[1:] + } line, lineOk = t.handleKey(key) } if len(rest) > 0 { @@ -781,7 +830,7 @@ func (t *Terminal) readLine() (line string, err error) { if lineOk { if t.echo { t.historyIndex = -1 - t.history.Add(line) + t.historyAdd(line) } if lineIsPasted { err = ErrPasteIndicator @@ -938,19 +987,23 @@ func (s *stRingBuffer) Add(a string) { } } -// NthPreviousEntry returns the value passed to the nth previous call to Add. +func (s *stRingBuffer) Len() int { + return s.size +} + +// At returns the value passed to the nth previous call to Add. // If n is zero then the immediately prior value is returned, if one, then the // next most recent, and so on. If such an element doesn't exist then ok is // false. -func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) { +func (s *stRingBuffer) At(n int) string { if n < 0 || n >= s.size { - return "", false + panic(fmt.Sprintf("term: history index [%d] out of range [0,%d)", n, s.size)) } index := s.head - n if index < 0 { index += s.max } - return s.entries[index], true + return s.entries[index] } // readPasswordLine reads from reader until it finds \n or io.EOF. diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/vendor/golang.org/x/text/unicode/bidi/core.go index 9d2ae547b..fb8273236 100644 --- a/vendor/golang.org/x/text/unicode/bidi/core.go +++ b/vendor/golang.org/x/text/unicode/bidi/core.go @@ -427,13 +427,6 @@ type isolatingRunSequence struct { func (i *isolatingRunSequence) Len() int { return len(i.indexes) } -func maxLevel(a, b level) level { - if a > b { - return a - } - return b -} - // Rule X10, second bullet: Determine the start-of-sequence (sos) and end-of-sequence (eos) types, // either L or R, for each isolating run sequence. func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence { @@ -474,8 +467,8 @@ func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence { indexes: indexes, types: types, level: level, - sos: typeForLevel(maxLevel(prevLevel, level)), - eos: typeForLevel(maxLevel(succLevel, level)), + sos: typeForLevel(max(prevLevel, level)), + eos: typeForLevel(max(succLevel, level)), } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 3a53e3554..2c02a7ca7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -83,8 +83,8 @@ github.com/go-openapi/validate # github.com/go-stack/stack v1.8.0 ## explicit github.com/go-stack/stack -# github.com/gofrs/flock v0.8.1 -## explicit +# github.com/gofrs/flock v0.10.0 +## explicit; go 1.21.0 github.com/gofrs/flock # github.com/golang/mock v1.4.4 ## explicit; go 1.11 @@ -127,8 +127,8 @@ github.com/mitchellh/go-homedir # github.com/mitchellh/mapstructure v1.3.2 ## explicit; go 1.14 github.com/mitchellh/mapstructure -# github.com/oracle/oci-go-sdk/v65 v65.41.1 -## explicit; go 1.13 +# github.com/oracle/oci-go-sdk/v65 v65.113.0 +## explicit; go 1.24.0 github.com/oracle/oci-go-sdk/v65/artifacts github.com/oracle/oci-go-sdk/v65/common github.com/oracle/oci-go-sdk/v65/common/auth @@ -183,6 +183,9 @@ github.com/xeipuuv/gojsonreference # github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f ## explicit github.com/xeipuuv/gojsonschema +# github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 +## explicit; go 1.17 +github.com/youmark/pkcs8 # go.mongodb.org/mongo-driver v1.5.1 ## explicit; go 1.10 go.mongodb.org/mongo-driver/bson @@ -192,23 +195,25 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# golang.org/x/crypto v0.37.0 -## explicit; go 1.23.0 +# golang.org/x/crypto v0.45.0 +## explicit; go 1.24.0 +golang.org/x/crypto/pbkdf2 +golang.org/x/crypto/scrypt golang.org/x/crypto/ssh/terminal -# golang.org/x/net v0.39.0 -## explicit; go 1.23.0 +# golang.org/x/net v0.47.0 +## explicit; go 1.24.0 golang.org/x/net/context golang.org/x/net/idna -# golang.org/x/sys v0.32.0 -## explicit; go 1.23.0 +# golang.org/x/sys v0.38.0 +## explicit; go 1.24.0 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.31.0 -## explicit; go 1.23.0 +# golang.org/x/term v0.37.0 +## explicit; go 1.24.0 golang.org/x/term -# golang.org/x/text v0.24.0 -## explicit; go 1.23.0 +# golang.org/x/text v0.31.0 +## explicit; go 1.24.0 golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi