๓ FRTc@s0defd„ƒYZdefd„ƒYZdS(tCORSRulecBsMeZdZddddddd„Zd„Zd„Zd„Zd„ZRS(sŸ CORS rule for a bucket. :ivar id: A unique identifier for the rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration. :ivar allowed_methods: An HTTP method that you want to allow the origin to execute. Each CORSRule must identify at least one origin and one method. Valid values are: GET|PUT|HEAD|POST|DELETE :ivar allowed_origin: An origin that you want to allow cross-domain requests from. This can contain at most one * wild character. Each CORSRule must identify at least one origin and one method. The origin value can include at most one '*' wild character. For example, "http://*.example.com". You can also specify only * as the origin value allowing all origins cross-domain access. :ivar allowed_header: Specifies which headers are allowed in a pre-flight OPTIONS request via the Access-Control-Request-Headers header. Each header name specified in the Access-Control-Request-Headers header must have a corresponding entry in the rule. Amazon S3 will send only the allowed headers in a response that were requested. This can contain at most one * wild character. :ivar max_age_seconds: The time in seconds that your browser is to cache the preflight response for the specified resource. :ivar expose_header: One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). You add one ExposeHeader element in the rule for each header. cCsŽ|dkrg}n||_|dkr3g}n||_||_|dkrZg}n||_||_|dkrg}n||_dS(N(tNonetallowed_methodtallowed_origintidtallowed_headertmax_age_secondst expose_header(tselfRRRRRR((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyt__init__>s             cCs d|jS(Ns (R(R((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyt__repr__PscCsdS(N(R(Rtnametattrst connection((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyt startElementSscCsฦ|dkr||_nช|dkr7|jj|ƒn‹|dkrV|jj|ƒnl|dkru|jj|ƒnM|dkr“t|ƒ|_n/|dkrฒ|jj|ƒnt|||ƒdS(NtIDt AllowedMethodt AllowedOrigint AllowedHeadert MaxAgeSecondst ExposeHeader( RRtappendRRtintRRtsetattr(RR tvalueR ((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyt endElementVs       cCsึd}x|jD]}|d|7}qWx|jD]}|d|7}q2Wx|jD]}|d|7}qTWx|jD]}|d|7}qvW|jrซ|d|j7}n|jrศ|d|j7}n|d7}|S( Ns s!%ss!%ss!%ss%ss!%ds %ss (RRRRRR(RtsRRRR((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pytto_xmlfs   N( t__name__t __module__t__doc__RR R RRR(((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyRs#     tCORSConfigurationcBs>eZdZd„Zd„Zd„Zddddd„ZRS(sI A container for the rules associated with a CORS configuration. cCs*|dkr&tƒ}|j|ƒ|SdS(NR(RRR(RR R R trule((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyR}s    cCst|||ƒdS(N(R(RR RR ((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyR„scCs5d}x|D]}||jƒ7}q W|d7}|S(sv Returns a string containing the XML version of the Lifecycle configuration as defined by S3. ss(R(RRR ((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyR‡s   cCsฺt|ttfƒs!|g}nt|ttfƒsB|g}nt|ttfƒsx|dkrlg}qx|g}nt|ttfƒsฎ|dkrขg}qฎ|g}nt||||||ƒ}|j|ƒdS(sา Add a rule to this CORS configuration. This only adds the rule to the local copy. To install the new rule(s) on the bucket, you need to pass this CORS config object to the set_cors method of the Bucket object. :type allowed_methods: list of str :param allowed_methods: An HTTP method that you want to allow the origin to execute. Each CORSRule must identify at least one origin and one method. Valid values are: GET|PUT|HEAD|POST|DELETE :type allowed_origin: list of str :param allowed_origin: An origin that you want to allow cross-domain requests from. This can contain at most one * wild character. Each CORSRule must identify at least one origin and one method. The origin value can include at most one '*' wild character. For example, "http://*.example.com". You can also specify only * as the origin value allowing all origins cross-domain access. :type id: str :param id: A unique identifier for the rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration. :type allowed_header: list of str :param allowed_header: Specifies which headers are allowed in a pre-flight OPTIONS request via the Access-Control-Request-Headers header. Each header name specified in the Access-Control-Request-Headers header must have a corresponding entry in the rule. Amazon S3 will send only the allowed headers in a response that were requested. This can contain at most one * wild character. :type max_age_seconds: int :param max_age_seconds: The time in seconds that your browser is to cache the preflight response for the specified resource. :type expose_header: list of str :param expose_header: One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). You add one ExposeHeader element in the rule for each header. N(t isinstancetlistttupleRRR(RRRRRRRR ((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pytadd_rule’s0         N(RRRRRRRR$(((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyRxs    N(tobjectRR"R(((s9/opt/freeware/lib/python2.7/site-packages/boto/s3/cors.pyts_