From edeab4afe79b8a20c2a6405bee32afa34e959753 Mon Sep 17 00:00:00 2001 From: anup-21 Date: Mon, 17 Jun 2024 09:04:16 +0000 Subject: [PATCH] Releasing version 3.43.2 Co-authored-by: Hamada Ibrahim Co-authored-by: Harsh Kumar Co-authored-by: Kanvi Pasricha Co-authored-by: Alex Le Co-authored-by: Nupur Gupta Co-authored-by: Karthik Kamath Co-authored-by: Mandy Tsai Co-authored-by: Pankaj Joshi Co-authored-by: Anup Singh --- CHANGELOG.rst | 28 +++++++++++++++++++ requirements.txt | 2 +- .../generated/aiservicedocument_cli.py | 8 +++--- .../tests/util/generated/command_to_api.py | 1 + setup.py | 2 +- src/oci_cli/cli_setup.py | 23 ++++++++++++++- src/oci_cli/version.py | 2 +- 7 files changed, 58 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3a5c44f4c..f5ee29ad9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,34 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__. +3.43.2 - 2024-06-18 +-------------------- +Added +~~~~~ +* OCI AI Document Service + + * Support for new document type ``INSURANCE_CLAIM`` as shown: + + * ``oci ai-document analyze-document-result analyze-document --document-type INSURANCE_CLAIM`` + * ``oci ai-document analyze-document-result analyze-document-inline-document-details --document-type INSURANCE_CLAIM`` + * ``oci ai-document analyze-document-result analyze-document-object-storage-document-details --document-type INSURANCE_CLAIM`` + * ``oci ai-document processor-job create-processor-job-general-processor-config --processor-config-document-type INSURANCE_CLAIM`` + +* OCI Database Service + + * Support for adding whitelisted ips for private endpoint enabled databases. + + * ``oci db autonomous-database create --whitelisted-ips`` + * ``oci db autonomous-database update --whitelisted-ips`` + +* OCI Stack Monitoring Service + + * Support for Microsoft IIS resource type when declaring discovery details. + + * ``oci stack-monitoring discovery-job create --discovery-details`` + +* Security Enhancement: Improved security for API key management. + 3.43.1 - 2024-06-11 -------------------- Added diff --git a/requirements.txt b/requirements.txt index 16df702cb..de95f72e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ Jinja2==3.0.3 jmespath==0.10.0 ndg-httpsclient==0.4.2 mock==2.0.0 -oci==2.128.1 +oci==2.128.2 packaging==20.2 pluggy==0.13.0 py==1.11.0 diff --git a/services/ai_document/src/oci_cli_ai_service_document/generated/aiservicedocument_cli.py b/services/ai_document/src/oci_cli_ai_service_document/generated/aiservicedocument_cli.py index bc31acdd4..852b252bb 100644 --- a/services/ai_document/src/oci_cli_ai_service_document/generated/aiservicedocument_cli.py +++ b/services/ai_document/src/oci_cli_ai_service_document/generated/aiservicedocument_cli.py @@ -79,7 +79,7 @@ def processor_job_group(): @cli_util.option('--compartment-id', help=u"""The compartment identifier.""") @cli_util.option('--output-location', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--language', help=u"""The document language, abbreviated according to the BCP 47 syntax.""") -@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS"]), help=u"""The document type.""") +@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS", "INSURANCE_CLAIM"]), help=u"""The document type.""") @cli_util.option('--ocr-data', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""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.""") @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_document', 'class': 'list[DocumentFeature]'}, 'document': {'module': 'ai_document', 'class': 'DocumentDetails'}, 'output-location': {'module': 'ai_document', 'class': 'OutputLocation'}, 'ocr-data': {'module': 'ai_document', 'class': 'AnalyzeDocumentResult'}}) @@ -129,7 +129,7 @@ def analyze_document(ctx, from_json, features, document, compartment_id, output_ @cli_util.option('--compartment-id', help=u"""The compartment identifier.""") @cli_util.option('--output-location', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--language', help=u"""The document language, abbreviated according to the BCP 47 syntax.""") -@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS"]), help=u"""The document type.""") +@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS", "INSURANCE_CLAIM"]), help=u"""The document type.""") @cli_util.option('--ocr-data', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""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.""") @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_document', 'class': 'list[DocumentFeature]'}, 'output-location': {'module': 'ai_document', 'class': 'OutputLocation'}, 'ocr-data': {'module': 'ai_document', 'class': 'AnalyzeDocumentResult'}}) @@ -182,7 +182,7 @@ def analyze_document_object_storage_document_details(ctx, from_json, features, d @cli_util.option('--compartment-id', help=u"""The compartment identifier.""") @cli_util.option('--output-location', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--language', help=u"""The document language, abbreviated according to the BCP 47 syntax.""") -@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS"]), help=u"""The document type.""") +@cli_util.option('--document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS", "INSURANCE_CLAIM"]), help=u"""The document type.""") @cli_util.option('--ocr-data', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""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.""") @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_document', 'class': 'list[DocumentFeature]'}, 'output-location': {'module': 'ai_document', 'class': 'OutputLocation'}, 'ocr-data': {'module': 'ai_document', 'class': 'AnalyzeDocumentResult'}}) @@ -636,7 +636,7 @@ def create_processor_job_object_storage_locations(ctx, from_json, wait_for_state @cli_util.option('--compartment-id', required=True, help=u"""The compartment identifier.""") @cli_util.option('--processor-config-features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The types of document analysis requested.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--display-name', help=u"""The display name of the processor job.""") -@cli_util.option('--processor-config-document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS"]), help=u"""The document type.""") +@cli_util.option('--processor-config-document-type', type=custom_types.CliCaseInsensitiveChoice(["INVOICE", "RECEIPT", "RESUME", "TAX_FORM", "DRIVER_LICENSE", "PASSPORT", "BANK_STATEMENT", "CHECK", "PAYSLIP", "OTHERS", "INSURANCE_CLAIM"]), help=u"""The document type.""") @cli_util.option('--processor-config-is-zip-output-enabled', type=click.BOOL, help=u"""Whether or not to generate a ZIP file containing the results.""") @cli_util.option('--processor-config-language', help=u"""The document language, abbreviated according to the BCP 47 Language-Tag syntax.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["SUCCEEDED", "FAILED", "ACCEPTED", "CANCELED", "IN_PROGRESS", "CANCELING"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") diff --git a/services/apm_config/tests/util/generated/command_to_api.py b/services/apm_config/tests/util/generated/command_to_api.py index 7c533d3d7..a181c739a 100644 --- a/services/apm_config/tests/util/generated/command_to_api.py +++ b/services/apm_config/tests/util/generated/command_to_api.py @@ -8,6 +8,7 @@ "apm_config.list_configs": "oci.apm_config.ConfigClient.list_configs", "apm_config.retrieve_namespace_metrics": "oci.apm_config.ConfigClient.retrieve_namespace_metrics", "apm_config.retrieve_namespaces": "oci.apm_config.ConfigClient.retrieve_namespaces", + "apm_config.test": "oci.apm_config.ConfigClient.test", "apm_config.update_config": "oci.apm_config.ConfigClient.update_config", "apm_config.validate_span_filter_pattern": "oci.apm_config.ConfigClient.validate_span_filter_pattern", } diff --git a/setup.py b/setup.py index 956cf453c..c7b19c7be 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def open_relative(*path): readme = f.read() requires = [ - 'oci==2.128.1', + 'oci==2.128.2', 'arrow>=1.0.0', 'certifi', 'click==8.0.4', diff --git a/src/oci_cli/cli_setup.py b/src/oci_cli/cli_setup.py index 405a79af1..dd4819b17 100644 --- a/src/oci_cli/cli_setup.py +++ b/src/oci_cli/cli_setup.py @@ -193,10 +193,10 @@ --ingress-rules = --ingress-security-rules """ - NO_PASSPHRASE = 'N/A' PUBLIC_KEY_FILENAME_SUFFIX = '_public.pem' PRIVATE_KEY_FILENAME_SUFFIX = '.pem' +PRIVATE_KEY_LABEL = "OCI_API_KEY" config_generation_canceled_message = "Config creation canceled." @@ -292,6 +292,14 @@ def generate_oci_config(): private_key_file, has_passphrase, private_key = click.prompt(text='Enter the location of your API Signing private key file', value_proc=validate_private_key_file) private_key_file = os.path.abspath(private_key_file) + if not validate_label_private_key(private_key_file): + private_label_message = ( + f"To increase security of your API key located at {private_key_file}, " + "append an extra line with 'OCI_API_KEY' at the end. For more information, " + "refer to https://docs.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm" + ) + click.echo(click.style(f"Warning: {private_label_message}", fg='yellow')) + key_passphrase = None if has_passphrase: key_passphrase, private_key = click.prompt(text='Enter the passphrase for your private key', hide_input=True, value_proc=lambda passphrase: validate_private_key_passphrase(private_key_file, passphrase)) @@ -705,6 +713,11 @@ def write_private_key_to_file(filename, private_key, passphrase, overwrite=False with open(filename, "wb") as f: f.write(cli_util.serialize_key(private_key=private_key, passphrase=passphrase)) + # Open a file in append mode + with open(filename, 'a') as file: + # add the static label + file.write(PRIVATE_KEY_LABEL) + # only user has R/W permissions to the key file cli_util.apply_user_only_access_permissions(filename) @@ -723,6 +736,14 @@ def validate_private_key_passphrase(filename, passphrase): raise click.BadParameter("Incorrect passphrase, could not decrypt private key") +def validate_label_private_key(file_path): + + with open(file_path, "r") as file: + content = file.read() + + return content.endswith(PRIVATE_KEY_LABEL) + + def validate_private_key_file(filename): filename = os.path.expanduser(filename) if not os.path.isfile(filename): diff --git a/src/oci_cli/version.py b/src/oci_cli/version.py index 2cef573ea..6545586dd 100644 --- a/src/oci_cli/version.py +++ b/src/oci_cli/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -__version__ = '3.43.1' +__version__ = '3.43.2'