
    	                         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   " S S\R(                  5      rg)z?Command to add a Cloud CDN Signed URL key to a backend service.    )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 service.

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

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                  R                  U 5        [        R                  " U SS9  [        R
                  " U SS9  g)z"Set up arguments for this command.T)requiredN)r
   GLOBAL_BACKEND_SERVICE_ARGAddArgumentr   AddCdnSignedUrlKeyNameAddCdnSignedUrlKeyFile)parsers    :lib/surface/compute/backend_services/add_signed_url_key.pyArgsAddSignedUrlKey.Args9   s8     
$$008++FTB++FTB    c           	      $   [         R                  " U R                  5       5      nUR                  R                  nUR                  R
                  nUR                  n[        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	R0                  SS9n
[2        R4                  " U5      n[6        R8                  " XSR;                  UR'                  5       5      5      $ )z?Issues the request to add Signed URL key to the backend bucket.)scope_lister)keyNamekeyValue)projectbackendServicesignedUrlKeyzcompute.globalOperations)
collectionz(Adding Cloud CDN Signed URL key to [{0}])r   ComputeApiHolderReleaseTrackclientapitools_clientmessagesbackendServicesr
   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   ReadFileContentskey_filerstrip,ComputeBackendServicesAddSignedUrlKeyRequestr   NameSignedUrlKeykey_namer   ParseselfLinkr   Pollerr   WaitForformat)selfargsholder
api_clientr'   servicebackend_service_ref	key_valuerequest	operationoperation_refoperation_pollers               r   RunAddSignedUrlKey.Run@   s_   **4+<+<+>?F..J}}%%H((G::LL"88G M I &&t}}5<<>ICC#++*//1**MMI + 7 D 8G ''0I$$**'A + CM }}W->>*DKK1668:; ;r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rD   __static_attributes__rF   r   r   r   r      s"    2 C C;r   r   N)rK   
__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   3googlecloudsdk.command_lib.compute.backend_servicesgooglecloudsdk.core.utilr   UpdateCommandr   rF   r   r   <module>rW      s>    F &  ' 7 < . ( E ? E *:;d(( :;r   