示例#1
0
	def token(self):
		token = dict(
			scope = self.scope,
			deadline = int(time.time()) + self.expires,
		)

		if self.callbackUrl is not None:
			token["callbackUrl"] = self.callbackUrl

		if self.callbackBodyType is not None:
			token["callbackBodyType"] = self.callbackBodyType

		if self.customer is not None:
			token["customer"] = self.customer

		if self.asyncOps is not None:
			token["asyncOps"] = self.asyncOps

		if self.escape is not None:
			token["escape"] = self.escape

		if self.detectMime is not None:
			token["detectMime"] = self.detectMime
		
		return rpc.sign_json(config.ACCESS_KEY, config.SECRET_KEY, token)
示例#2
0
    def token(self):
        token = dict(
            scope=self.scope,
            deadline=int(time.time()) + self.expires,
        )

        if self.callbackUrl is not None:
            token["callbackUrl"] = self.callbackUrl

        if self.callbackBodyType is not None:
            token["callbackBodyType"] = self.callbackBodyType

        if self.customer is not None:
            token["customer"] = self.customer

        if self.asyncOps is not None:
            token["asyncOps"] = self.asyncOps

        if self.escape is not None:
            token["escape"] = self.escape

        if self.detectMime is not None:
            token["detectMime"] = self.detectMime

        return rpc.sign_json(config.ACCESS_KEY, config.SECRET_KEY, token)
示例#3
0
	def token(self):
		token = dict(
			S = self.scope,
			E = self.expires + int(time.time())
		)
		return rpc.sign_json(config.ACCESS_KEY, config.SECRET_KEY, token)
示例#4
0
 def token(self):
     token = dict(S=self.scope, E=self.expires + int(time.time()))
     return rpc.sign_json(config.ACCESS_KEY, config.SECRET_KEY, token)