MCPcopy Index your code
hub / github.com/diffgram/diffgram / set_s3_credentials

Method set_s3_credentials

install.py:382–431  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

380 is_valid = True
381
382 def set_s3_credentials(self):
383
384 # Ask For Access Key ID
385 is_valid = False
386 while not is_valid:
387 s3_access_id = bcolors.inputcolor('Please provide the AWS Access Key ID: ')
388 if s3_access_id == '':
389 bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING)
390 continue
391 else:
392 self.s3_access_id = s3_access_id
393 is_valid = True
394
395 # Ask For Access Key Secret
396 is_valid = False
397
398 while not is_valid:
399 s3_access_secret = bcolors.inputcolor('Please provide the AWS Access Key Secret: ')
400 if s3_access_secret == '':
401 bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING)
402 continue
403 else:
404 self.s3_access_secret = s3_access_secret
405 is_valid = True
406
407 # Ask for bucket name
408 bucket_name = bcolors.inputcolor('Please provide the AWS S3 Bucket Name [Default is diffgram-storage]: ')
409 if bucket_name == '':
410 self.bucket_name = 'diffgram-storage'
411 else:
412 self.bucket_name = bucket_name
413
414 # Ask for bucket region
415 is_valid = False
416
417 while not is_valid:
418 bucket_region = bcolors.inputcolor('Please provide the AWS S3 Bucket Region: ')
419 if bucket_region == '':
420 bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING)
421 continue
422 else:
423 self.bucket_region = bucket_region
424 is_valid = True
425
426 # Ask for aws signature version 4
427 is_aws_signature_v4 = bcolors.inputcolor('Use AWS Signature Version 4?[Y/n] ')
428 if is_aws_signature_v4.lower() == 'y' or is_aws_signature_v4.lower() == 'yes':
429 self.is_aws_signature_v4 = True
430 else:
431 self.is_aws_signature_v4 = False
432
433 def set_azure_credentials(self):
434 # Ask For Access Key ID

Callers 1

installMethod · 0.95

Calls 2

inputcolorMethod · 0.80
printcolorMethod · 0.80

Tested by

no test coverage detected