ó FRTc@s¦ddlZddlZddlZddlmZdefd„ƒYZdefd„ƒYZdefd„ƒYZ d efd „ƒYZ d efd „ƒYZ dS( iÿÿÿÿN(tjsont CredentialscBsheZdZd d„Zed„ƒZed„ƒZd„Zd„Z d„Z d„Z dd „Z RS( s' :ivar access_key: The AccessKeyID. :ivar secret_key: The SecretAccessKey. :ivar session_token: The session token that must be passed with requests to use the temporary credentials :ivar expiration: The timestamp for when the credentials will expire cCs:||_d|_d|_d|_d|_d|_dS(N(tparenttNonet access_keyt secret_keyt session_tokent expirationt request_id(tselfR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyt__init__'s      cCs,tj|ƒ}|ƒ}|jj|ƒ|S(sû Create and return a new Session Token based on the contents of a JSON document. :type json_doc: str :param json_doc: A string containing a JSON document with a previously saved Credentials object. (Rtloadst__dict__tupdate(tclstjson_doctdttoken((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyt from_json/s  cCs/t|ƒ}|jƒ}|jƒ|j|ƒS(s- Create and return a new Session Token based on the contents of a previously saved JSON-format file. :type file_path: str :param file_path: The fully qualified path to the JSON-format file containing the previously saved Session Token information. (topentreadtcloseR(Rt file_pathtfpR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pytload>s   cCsdS(N(R(R tnametattrst connection((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyt startElementMscCs||dkr||_n`|dkr0||_nH|dkrH||_n0|dkr`||_n|dkrx||_ndS(Nt AccessKeyIdtSecretAccessKeyt SessionTokent Expirationt RequestId(RRRRR(R RtvalueR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyt endElementPs          cCs6i|jd6|jd6|jd6|jd6|jd6S(sm Return a Python dict containing the important information about this Session Token. RRRRR(RRRRR(R ((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pytto_dict^s     cCsCt|dƒ}tj|jƒ|ƒ|jƒtj|dƒdS(s² Persist a Session Token to a file in JSON format. :type path: str :param path: The fully qualified path to the file where the the Session Token data should be written. Any previous data in the file will be overwritten. To help protect the credentials contained in the file, the permissions of the file will be set to readable/writable by owner only. twi€N(RRtdumpR$Rtostchmod(R RR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pytsaveis  icCs]tjjƒ}|r.|tjd|ƒ}ntjj|jƒ}||}|jƒdkS(sˆ Checks to see if the Session Token is expired or not. By default it will check to see if the Session Token is expired as of the moment the method is called. However, you can supply an optional parameter which is the number of seconds of offset into the future for the check. For example, if you supply a value of 5, this method will return a True if the Session Token will be expired 5 seconds from this moment. :type time_offset_seconds: int :param time_offset_seconds: The number of seconds into the future to test the Session Token for expiration. tsecondsi(tdatetimetutcnowt timedeltatbototutilstparse_tsRt total_seconds(R ttime_offset_secondstnowttstdelta((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyt is_expiredys  N( t__name__t __module__t__doc__RR t classmethodRRRR#R$R)R6(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRs    tFederationTokencBs,eZdZdd„Zd„Zd„ZRS(sh :ivar credentials: A Credentials object containing the credentials. :ivar federated_user_arn: ARN specifying federated user using credentials. :ivar federated_user_id: The ID of the federated user using credentials. :ivar packed_policy_size: A percentage value indicating the size of the policy in packed form cCs:||_d|_d|_d|_d|_d|_dS(N(RRt credentialstfederated_user_arntfederated_user_idtpacked_policy_sizeR(R R((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR ˜s      cCs'|dkrtƒ|_|jSdSdS(NR(RR<R(R RRR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR s  cCsj|dkr||_nN|dkr0||_n6|dkrNt|ƒ|_n|dkrf||_ndS(NtArntFederatedUserIdtPackedPolicySizeR!(R=R>tintR?R(R RR"R((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR#§s       N(R7R8R9RR RR#(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR;s  t AssumedRolecBs2eZdZdddd„Zd„Zd„ZRS(st :ivar user: The assumed role user. :ivar credentials: A Credentials object containing the credentials. cCs||_||_||_dS(N(t _connectionR<tuser(R RR<RF((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR ¹s  cCsB|dkrtƒ|_|jS|dkr>tƒ|_|jSdS(NRtAssumedRoleUser(RR<tUserRF(R RRR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR¾s     cCsdS(N((R RR"R((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR#ÆsN(R7R8R9RR RR#(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRD´s RHcBs/eZdZddd„Zd„Zd„ZRS(sy :ivar arn: The arn of the user assuming the role. :ivar assume_role_id: The identifier of the assumed role. cCs||_||_dS(N(tarntassume_role_id(R RIRJ((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR Ïs cCsdS(N((R RRR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRÓscCs4|dkr||_n|dkr0||_ndS(NR@t AssumedRoleId(RIRJ(R RR"R((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR#Ös   N(R7R8R9RR RR#(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRHÊs tDecodeAuthorizationMessagecBs/eZdZddd„Zd„Zd„ZRS(sw :ivar request_id: The request ID. :ivar decoded_message: The decoded authorization message (may be JSON). cCs||_||_dS(N(Rtdecoded_message(R RRM((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR âs cCsdS(N((R RRR((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRæscCs4|dkr||_n|dkr0||_ndS(Nt requestIdtDecodedMessage(RRM(R RR"R((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyR#és   N(R7R8R9RR RR#(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyRLÝs ( R'R+t boto.utilsR.t boto.compatRtobjectRR;RDRHRL(((sA/opt/freeware/lib/python2.7/site-packages/boto/sts/credentials.pyts   q%