<div dir="ltr">Hi,<div>  Â It's missing README, but otherwise it looks good to me:</div><div><br></div><div>Reviewed-by: Mariusz Ceier <<a href="mailto:mceier%2Bwayland@gmail.com">mceier+wayland@gmail.com</a>></div><div><br></div><div>Mariusz Ceier<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 November 2015 at 15:10, Giulio Camuffo <span dir="ltr"><<a href="mailto:giuliocamuffo@gmail.com" target="_blank">giuliocamuffo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This new extension is used by clients wanting to execute priviledged<br>
actions such as taking a screenshot.<br>
The usual way of granting special priviledged to apps is to fork and<br>
exec them in the compositor, and then checking if the client is the<br>
known one when it binds the restricted global interface. This works<br>
but is quite limited, as it doesn't allow the compositor to ask the<br>
user if the app is trusted, because it can't wait for the answer in<br>
the bind function as that would block the compositor.<br>
This new protocol instead allows the answer to come after some time<br>
without blocking the compositor or the client.<br>
---<br>
<br>
v2: renamed to restricted_registry.<br>
  Â  It now replaces wl_registry entirely for the restricted interfaces<br>
  Â  and hence it makes it lets clients know for sure that the globals<br>
  Â  in wl_registry are not restricted, and which are the restricted<br>
  Â  ones.<br>
<br>
<br>
 Makefile.am  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  |  Â 1 +<br>
 .../restricted-registry/restricted-registry-v1.xml | 148 +++++++++++++++++++++<br>
 2 files changed, 149 insertions(+)<br>
 create mode 100644 unstable/restricted-registry/restricted-registry-v1.xml<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index a32e977..bfe9a6a 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -5,6 +5,7 @@ unstable_protocols =  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \<br>
  Â  Â  Â  unstable/text-input/text-input-unstable-v1.xml  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \<br>
  Â  Â  Â  unstable/input-method/input-method-unstable-v1.xml  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \<br>
  Â  Â  Â  unstable/xdg-shell/xdg-shell-unstable-v5.xml  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \<br>
+  Â  Â  Â unstable/authorizer/authorizer-unstable-v1.xml<br>
  Â  Â  Â  $(NULL)<br>
<br>
 nobase_dist_pkgdata_DATA =  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \<br>
diff --git a/unstable/restricted-registry/restricted-registry-v1.xml b/unstable/restricted-registry/restricted-registry-v1.xml<br>
new file mode 100644<br>
index 0000000..8c9224f<br>
--- /dev/null<br>
+++ b/unstable/restricted-registry/restricted-registry-v1.xml<br>
@@ -0,0 +1,148 @@<br>
+<?xml version="1.0" encoding="UTF-8"?><br>
+<protocol name="restricted_registry_v1"><br>
+<br>
+  <copyright><br>
+  Â  Copyright Â© 2015 Giulio Camuffo.<br>
+<br>
+  Â  Permission to use, copy, modify, distribute, and sell this<br>
+  Â  software and its documentation for any purpose is hereby granted<br>
+  Â  without fee, provided that the above copyright notice appear in<br>
+  Â  all copies and that both that copyright notice and this permission<br>
+  Â  notice appear in supporting documentation, and that the name of<br>
+  Â  the copyright holders not be used in advertising or publicity<br>
+  Â  pertaining to distribution of the software without specific,<br>
+  Â  written prior permission.  The copyright holders make no<br>
+  Â  representations about the suitability of this software for any<br>
+  Â  purpose.  It is provided "as is" without express or implied<br>
+  Â  warranty.<br>
+<br>
+  Â  THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS<br>
+  Â  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND<br>
+  Â  FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY<br>
+  Â  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES<br>
+  Â  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN<br>
+  Â  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+  Â  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF<br>
+  Â  THIS SOFTWARE.<br>
+  </copyright><br>
+<br>
+  <interface name="zwp_restricted_registry_v1" version="1"><br>
+  Â  <description summary="authorize clients to use certain interfaces"><br>
+  Â  Â  This global interface acts as a wl_registry for restricted interfaces.<br>
+<br>
+  Â  Â  The globals advertized through this extension are not available<br>
+  Â  Â  through the normal wl_registry, and are not bindable by all the<br>
+  Â  Â  clients.<br>
+  Â  Â  When the clients creates a new zwp_restricted_registry_v1 object,<br>
+  Â  Â  it will advertize the existing restricted globals through the global<br>
+  Â  Â  event. These globals are not immediately bindable, but the client<br>
+  Â  Â  needs to be authorized first. To do so, the clients should send<br>
+  Â  Â  the authorize request for each global it whishes to bind, and then<br>
+  Â  Â  notify the compositor it whishes to be authorized by using the<br>
+  Â  Â  commit_authorization request. The compositor will then process the<br>
+  Â  Â  request and then send the list of authorized globals with the<br>
+  Â  Â  global_authorized event, followed by the authorization_done event.<br>
+  Â  Â  The client can bind the authorized globals when they are advertized<br>
+  Â  Â  but trying to bind any other will trigger a protocol error killing<br>
+  Â  Â  the client.<br>
+<br>
+  Â  Â  The list of restricted interfaces is compositor dependant, but must<br>
+  Â  Â  not include the core interfaces defined in wayland.xml.<br>
+  Â  </description><br>
+<br>
+  Â  <enum name="error"><br>
+  Â  Â  <description summary="zwp_restricted_registry_v1 error codes"><br>
+  Â  Â  Â  These errors can be emitted in response of zwp_restricted_registry_v1<br>
+  Â  Â  Â  requests.<br>
+  Â  Â  </description><br>
+  Â  Â  <entry name="unauthorized" value="0"<br>
+  Â  Â  Â  Â  Â  Â summary="the client is not authorized to bind the specified global"/><br>
+  Â  </enum><br>
+<br>
+  Â  <request name="destroy" type="destructor"><br>
+  Â  Â  <description summary="destroy this zwp_restricted_registry_v1 object"><br>
+  Â  Â  Â  Destroy this object. Any bound object will continue to live.<br>
+  Â  Â  </description><br>
+  Â  </request><br>
+<br>
+  Â  <request name="bind"><br>
+  Â  Â  <description summary="bind an object to the display"><br>
+  Â  Â  Â  Binds a new, client-created object to the server using the<br>
+  Â  Â  Â  specified name as the identifier.<br>
+  Â  Â  Â  The global must have been authorized prior to binding it<br>
+  Â  Â  Â  by using the authorize request, otherwise the server will<br>
+  Â  Â  Â  send a protocol error.<br>
+  Â  Â  </description><br>
+  Â  Â  <arg name="name" type="uint" summary="unique name for the object"/><br>
+  Â  Â  <arg name="id" type="new_id"/><br>
+  Â  </request><br>
+<br>
+  Â  <request name="authorize"><br>
+  Â  Â  <description summary="authorize a global interface"><br>
+  Â  Â  Â  The authorize request allows the client to ask the compositor for<br>
+  Â  Â  Â  authorization to bind a restricted global interface.<br>
+  Â  Â  </description><br>
+  Â  Â  <arg name="name" type="uint"/><br>
+  Â  </request><br>
+<br>
+  Â  <request name="commit_authorization"><br>
+  Â  Â  <description summary="issue the authorization requests"><br>
+  Â  Â  Â  This request notifies the compositor that the client has requested<br>
+  Â  Â  Â  all the authorizations for the globals it wants to bind. No other<br>
+  Â  Â  Â  authorize request can be sent after this.<br>
+  Â  Â  Â  The compositor will decide which globals the client is authorized<br>
+  Â  Â  Â  to bind and send them out using the global_authorized event, followed<br>
+  Â  Â  Â  by the authorization_done event.<br>
+  Â  Â  </description><br>
+  Â  </request><br>
+<br>
+  Â  <event name="global"><br>
+  Â  Â  <description summary="announce global object"><br>
+  Â  Â  Â  Notify the client of global objects.<br>
+<br>
+  Â  Â  Â  The event notifies the client that a global object with<br>
+  Â  Â  Â  the given name is now available, and it implements the<br>
+  Â  Â  Â  given version of the given interface.<br>
+  Â  Â  </description><br>
+  Â  Â  <arg name="name" type="uint"/><br>
+  Â  Â  <arg name="interface" type="string"/><br>
+  Â  Â  <arg name="version" type="uint"/><br>
+  Â  </event><br>
+<br>
+  Â  <event name="global_remove"><br>
+  Â  Â  <description summary="announce removal of global object"><br>
+  Â  Â  Â  Notify the client of removed global objects.<br>
+<br>
+  Â  Â  Â  This event notifies the client that the global identified<br>
+  Â  Â  Â  by name is no longer available.  If the client bound to<br>
+  Â  Â  Â  the global using the bind request, the client should now<br>
+  Â  Â  Â  destroy that object.<br>
+<br>
+  Â  Â  Â  The object remains valid and requests to the object will be<br>
+  Â  Â  Â  ignored until the client destroys it, to avoid races between<br>
+  Â  Â  Â  the global going away and a client sending a request to it.<br>
+  Â  Â  </description><br>
+  Â  Â  <arg name="name" type="uint"/><br>
+  Â  </event><br>
+<br>
+  Â  <event name="global_authorized"><br>
+  Â  Â  <description summary="the client can bind this global object"><br>
+  Â  Â  Â  Notify the client that it was authorized to bind this global.<br>
+  Â  Â  Â  Only now can the client bind it succesfully.<br>
+  Â  Â  </description><br>
+  Â  Â  <arg name="name" type="uint"/><br>
+  Â  Â  <arg name="interface" type="string"/><br>
+  Â  Â  <arg name="version" type="uint"/><br>
+  Â  </event><br>
+<br>
+  Â  <event name="authorization_done"><br>
+  Â  Â  <description summary="the authorization process is completed"><br>
+  Â  Â  Â  This event notifies the client that the authorization process<br>
+  Â  Â  Â  is done. Any authorized global was advertized through the<br>
+  Â  Â  Â  global_authorized event, and any other global the client binds<br>
+  Â  Â  Â  will trigger a protocol error.<br>
+  Â  Â  </description><br>
+  Â  </event><br>
+<br>
+  </interface><br>
+</protocol><br>
<span class="HOEnZb"><font color="#888888">--<br>
2.6.2<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div>