Skip to content

Commit

Permalink
Releasing version 3.43.2
Browse files Browse the repository at this point in the history
Releasing version 3.43.2
  • Loading branch information
anup-21 authored Jun 18, 2024
2 parents 1c04e5e + edeab4a commit d51c6bd
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 8 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`__.

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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'}})
Expand Down Expand Up @@ -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'}})
Expand Down Expand Up @@ -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'}})
Expand Down Expand Up @@ -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.""")
Expand Down
1 change: 1 addition & 0 deletions services/apm_config/tests/util/generated/command_to_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
23 changes: 22 additions & 1 deletion src/oci_cli/cli_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)

Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/oci_cli/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit d51c6bd

Please sign in to comment.