@@ -559,21 +559,25 @@ def cli_auto_prompt_env():
559
559
560
560
561
561
def check_key_for_security (auth , config_file , profile ):
562
-
562
+
563
563
# put a condition to check this only for api based authentication
564
564
if auth is None or auth == 'api_key' :
565
565
key_file = get_key_file (config_file , profile )
566
566
if cli_constants .OCI_CLI_KEY_FILE_ENV_VAR in os .environ :
567
567
key_file = os .environ [cli_constants .OCI_CLI_KEY_FILE_ENV_VAR ]
568
- if os .getenv ('SUPPRESS_LABEL_WARNING' ) is None :
569
- if key_file and not validate_label_private_key (key_file ):
570
- private_label_message = (
571
- f"To increase security of your API key located at { key_file } , "
572
- "append an extra line with 'OCI_API_KEY' at the end. For more information, "
573
- "refer to https://docs.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm"
574
- ". To supress the warning, set the env variable SUPPRESS_LABEL_WARNING=True"
575
- )
576
- click .echo (click .style (f"Warning: { private_label_message } " , fg = 'yellow' ), err = True )
568
+
569
+ suppress_warning = os .getenv ('SUPPRESS_LABEL_WARNING' )
570
+ if suppress_warning == 'True' :
571
+ return
572
+
573
+ if key_file and not validate_label_private_key (key_file ):
574
+ private_label_message = (
575
+ f"To increase security of your API key located at { key_file } , "
576
+ "append an extra line with 'OCI_API_KEY' at the end. For more information, "
577
+ "refer to https://docs.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm"
578
+ ". To suppress the warning, set the env variable SUPPRESS_LABEL_WARNING=True"
579
+ )
580
+ click .echo (click .style (f"Warning: { private_label_message } " , fg = 'yellow' ), err = True )
577
581
578
582
579
583
def validate_label_private_key (file_path ):
0 commit comments