<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 06/02/2015 12:57 PM, Mikhail Fedosin
wrote:<br>
</div>
<blockquote
cite="mid:CAHPxGAXGaNF0HP7NDa=5NwMFbgNUUxs8ZWnTmjUvWEUqpBaWJw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>Hello! I think it's a good time to discuss implementation
of trusts in Glance v2 and v3 api.<br>
<br>
Currently we have two different situations during image
creation where our token may expire, which leads to
unsuccessful operation.<br>
<br>
First is connection between glance-api and glance-registry.
In this case we have a solution (<a moz-do-not-send="true"
href="https://review.openstack.org/#/c/29967/">https://review.openstack.org/#/c/29967/</a>)
- use_user_token parameter in glance-api.conf, but it is
True by default . If it's changed to False then glance-api
will use its own credentials to authorize in glance-registry
and it prevents many possible issues with user token
expiration. So, I'm interested if there are some performance
degradations if we change use_user_token to False and what
are the reasons against making it the default value.<br>
<br>
Second one is linked with Swift. Current implementation
uploads chunks one by one and requires authorization each
time. It may lead to problems: for example we have to upload
100 chunks, after 99th one, token expired and glance can't
upload the last one, catches an exception and tries to
remove stale chunks from storage. Of course it will fail,
because token is not valid anymore, and that's why there
will be 99 garbage objects in the storage.<br>
With Single-tenant mode glance uses its own credentials to
upload files, so it's possible to create new connection on
each chunk upload or catch Unauthorized exception and
recreate connections only in that cases. But with
Multi-tenant mode there is no way to do it, because user
credentials are required. So it seems that trusts is the
only one solution here.<br>
</div>
</div>
</div>
</blockquote>
The problem with using trusts is that it would need to be created
per-user, and that is going to be expensive. It would be possible,
as Heat does something of this nature:<br>
<br>
1. User calls glance,<br>
2. Glance creates a trust with some limitation, either time or
number of uses<br>
3. Trusts are used for all operations with swift.<br>
4. Glance should clean up the trust when it is complete.<br>
<br>
I don't love the solution, but I think it is the best we have.
Ideally the user would opt in to the trust, but in this case, it is
kindof implicit by them calling the API. <br>
<br>
<br>
We should limit the trust creation to only have those roles (or a
subset) on the token used to create the trust.<br>
<br>
<br>
<br>
<br>
<blockquote
cite="mid:CAHPxGAXGaNF0HP7NDa=5NwMFbgNUUxs8ZWnTmjUvWEUqpBaWJw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>I would be happy to hear your opinions on that matter. If
you know other situations where trusts are useful or some
other approaches please share.<br>
<br>
</div>
Best regards,<br>
</div>
Mike Fedosin<br>
<div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>