Re: [Touch-packages] [Bug 1465675] Re: API needed to determine if App ID is a scope

2015-06-19 Thread Ted Gould
Yes, we could get the information from click. But, then we wouldn't get
things like the scopes that are installed on the image. I think it'd be
better if the scope system provided a function instead of each of the
services implementing it's own opinion of what is a scope.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1465675

Title:
  API needed to determine if App ID is a scope

Status in unity-scopes-api package in Ubuntu:
  New

Bug description:
  
  There are a few cases where we'd like it if a higher level service could 
determine if a particular AppID is connected to a scope. This mostly deals with 
requests that relate to trusted session prompts as they need to be overlayed on 
top of the dash instead of the calling process. Another is so that URL 
dispatcher can return better errors on the scope:// URL namespace. I don't 
think that it needs to be complex, roughly something like this:

  bool isScope (const char * appid);

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1465675/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


Re: [Touch-packages] [Bug 1465675] Re: API needed to determine if App ID is a scope

2015-06-18 Thread Ted Gould
I feel like your two points conflict ☺

If looking for a file on the filesystem won't work, then I can't ask
click for the information as if it knew there was a scope there it'd be
writing a file to the filesystem. That's basically what the scope click
hook does. (symbolic link, but whatevs)

Worst case if I had to spin up a full connection that wouldn't be the
end of the world, in these use cases we're talking about long running
processes that could keep the connection open.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1465675

Title:
  API needed to determine if App ID is a scope

Status in unity-scopes-api package in Ubuntu:
  New

Bug description:
  
  There are a few cases where we'd like it if a higher level service could 
determine if a particular AppID is connected to a scope. This mostly deals with 
requests that relate to trusted session prompts as they need to be overlayed on 
top of the dash instead of the calling process. Another is so that URL 
dispatcher can return better errors on the scope:// URL namespace. I don't 
think that it needs to be complex, roughly something like this:

  bool isScope (const char * appid);

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1465675/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


Re: [Touch-packages] [Bug 1465675] Re: API needed to determine if App ID is a scope

2015-06-18 Thread Ted Gould
The URL dispatcher case is that it gets a URL that looks like this:

 scope://com.foo_bar

I want to know whether to return an error on that URL because it is a
scope that doesn't exist, or to pass it onto the dash. So it is really
just testing that string to see if it is something that the dash will
understand.

What I want is to be able to ask the Scope system whether it considers
the ID valid. If that involves connecting to service or checking a file
is really an implementation detail. I just want to know if that ID (or
one with the version in it) are considered valid.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1465675

Title:
  API needed to determine if App ID is a scope

Status in unity-scopes-api package in Ubuntu:
  New

Bug description:
  
  There are a few cases where we'd like it if a higher level service could 
determine if a particular AppID is connected to a scope. This mostly deals with 
requests that relate to trusted session prompts as they need to be overlayed on 
top of the dash instead of the calling process. Another is so that URL 
dispatcher can return better errors on the scope:// URL namespace. I don't 
think that it needs to be complex, roughly something like this:

  bool isScope (const char * appid);

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1465675/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


Re: [Touch-packages] [Bug 1465675] Re: API needed to determine if App ID is a scope

2015-06-16 Thread Ted Gould
On Tue, 2015-06-16 at 23:50 +, Michi Henning wrote:

 We currently don't have any concept of an app ID in the scopes run time,
 except for one place, where we check whether a scope ID looks like
 scope_id_app_id. That's the case for scopes that are bundled with an
 app into the same click.
 
 Is this what you mean?


Well AppID is a concept in Click and the system more than scopes. It is
the name of the package and the hook ID. It is, for instance, what the
name of the apparmor profiles are. But, yes, the same thing.

$(package)_$(hookname)_$(version)

For instance, you can get this value if someone talks to you and you ask
AppArmor what profile the connector is using.


 The easiest way to implement this would be to write a little scopes
 client that gets the list of scopes from the registry and then iterates
 over the scope ID to check whether there is a scope with an ID that
 looks like some-string_app_id.


At some level, I don't really care about the implementation, but in
other situations I've found just checking to see if a file exists in a
cache'd path is fast any easy to implement things like this. For
instance:

if [ -e ~/.local/share/unity-scopes/$(appid) ||
-e /usr/lib/*/unity-scopes/$(appid) ] 

Would probably work well enough.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1465675

Title:
  API needed to determine if App ID is a scope

Status in unity-scopes-api package in Ubuntu:
  New

Bug description:
  
  There are a few cases where we'd like it if a higher level service could 
determine if a particular AppID is connected to a scope. This mostly deals with 
requests that relate to trusted session prompts as they need to be overlayed on 
top of the dash instead of the calling process. Another is so that URL 
dispatcher can return better errors on the scope:// URL namespace. I don't 
think that it needs to be complex, roughly something like this:

  bool isScope (const char * appid);

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1465675/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp