(self, args, parsed_globals)
| 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 | |
| 303 | class RSASigner: |
nothing calls this directly
no test coverage detected