
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SS	KJr  SSKJr  \R(                   " S S\R*                  5      5       rg)z>Command to add a Cloud CDN Signed URL key to a backend bucket.    )absolute_import)division)unicode_literals)base_classes)poller)waiter)base)flags)signed_url_flags)filesc                   .    \ rS rSrSr\S 5       rS rSrg)AddSignedUrlKey   a  Add Cloud CDN Signed URL key to a backend bucket.

*{command}* is used to add a new Cloud CDN Signed URL key to a backend bucket.

Cloud CDN Signed URLs give you a way to serve responses from the
globally distributed CDN cache, even if the request needs to be
authorized.

Signed URLs are a mechanism to temporarily give a client access to a
private resource without requiring additional authorization. To achieve
this, the full request URL that should be allowed is hashed
and cryptographically signed. By using the signed URL you give it, that
one request will be considered authorized to receive the requested
content.

Generally, a signed URL can be used by anyone who has it. However, it
is usually only intended to be used by the client that was directly
given the URL. To mitigate this, they expire at a time chosen by the
issuer. To minimize the risk of a signed URL being shared, it is recommended
that the signed URL be set to expire as soon as possible.

A 128-bit secret key is used for signing the URLs.
c                     [         R                  " 5       [        l        [        R                  R	                  U SS9  [
        R                  " U SS9  [
        R                  " U SS9  g)z"Set up arguments for this command.zadd CDN signed URL key to)operation_typeT)requiredN)r
   BackendBucketArgumentr   BACKEND_BUCKET_ARGAddArgumentr   AddCdnSignedUrlKeyNameAddCdnSignedUrlKeyFile)parsers    9lib/surface/compute/backend_buckets/add_signed_url_key.pyArgsAddSignedUrlKey.Args9   sT     */)D)D)FO&&&22: 3 <++FTB++FTB    c           	         [         R                  " U R                  5       5      nUR                  R                  nUR                  R
                  nUR                  nU R                  R                  UUR                  [        R                  " UR                  5      S9n[        R                  " UR                  5      R                  5       nUR!                  UR"                  UR%                  5       UR'                  UR(                  US9S9nUR+                  U5      n	UR                  R-                  U	R.                  SS9n
[0        R2                  " U5      n[4        R6                  " XSR9                  UR%                  5       5      5      $ )z@Issues the request to add Signed URL key to the backend service.)scope_lister)keyNamekeyValue)projectbackendBucketsignedUrlKeyzcompute.globalOperations)
collectionz(Adding Cloud CDN Signed URL key to [{0}])r   ComputeApiHolderReleaseTrackclientapitools_clientmessagesbackendBucketsr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   ReadFileContentskey_filerstrip+ComputeBackendBucketsAddSignedUrlKeyRequestr!   NameSignedUrlKeykey_namer   ParseselfLinkr   Pollerr   WaitForformat)selfargsholder
api_clientr)   servicebackend_bucket_ref	key_valuerequest	operationoperation_refoperation_pollers               r   RunAddSignedUrlKey.RunB   s_   **4+<+<+>?F..J}}%%H''G00BB"88G C I &&t}}5<<>IBB"**(--/**MMI + 7 C 8G ''0I$$**'A + CM }}W->>*DKK05579: :r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rF   __static_attributes__rH   r   r   r   r      s"    0 C C:r   r   N)rM   
__future__r   r   r   googlecloudsdk.api_lib.computer   )googlecloudsdk.api_lib.compute.operationsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r-   r   2googlecloudsdk.command_lib.compute.backend_bucketsgooglecloudsdk.core.utilr   UniverseCompatibleUpdateCommandr   rH   r   r   <module>rZ      sS    E &  ' 7 < . ( E ? D * ;:d(( ;: ;:r   