126
137
ctxt = context.get_admin_context()
127
138
user = self.auth.get_user_from_access_key(key)
128
140
if user and user.name == username:
129
141
token_hash = hashlib.sha1('%s%s%f' % (username, key,
130
142
time.time())).hexdigest()
132
144
token_dict['token_hash'] = token_hash
133
145
token_dict['cdn_management_url'] = ''
136
148
token_dict['storage_url'] = ''
137
149
token_dict['user_id'] = user.id
138
150
token = self.db.auth_token_create(ctxt, token_dict)