MCPcopy Create free account
hub / github.com/aws/aws-cli / _run_main

Method _run_main

awscli/customizations/cloudfront.py:276–300  ·  view source on GitHub ↗
(self, args, parsed_globals)

Source from the content-addressed store, hash-verified

274 ]
275
276 def _run_main(self, args, parsed_globals):
277 signer = CloudFrontSigner(
278 args.key_pair_id, RSASigner(args.private_key).sign
279 )
280 date_less_than = parse_to_aware_datetime(args.date_less_than)
281 date_greater_than = args.date_greater_than
282 if date_greater_than is not None:
283 date_greater_than = parse_to_aware_datetime(date_greater_than)
284 if date_greater_than is not None or args.ip_address is not None:
285 policy = signer.build_policy(
286 args.url,
287 date_less_than,
288 date_greater_than=date_greater_than,
289 ip_address=args.ip_address,
290 )
291 sys.stdout.write(
292 signer.generate_presigned_url(args.url, policy=policy)
293 )
294 else:
295 sys.stdout.write(
296 signer.generate_presigned_url(
297 args.url, date_less_than=date_less_than
298 )
299 )
300 return 0
301
302
303class RSASigner:

Callers

nothing calls this directly

Calls 6

build_policyMethod · 0.95
CloudFrontSignerClass · 0.90
parse_to_aware_datetimeFunction · 0.90
RSASignerClass · 0.85
writeMethod · 0.45

Tested by

no test coverage detected