1
from piston_mini_client import PistonAPI, returns_json
2
from piston_mini_client.validators import oauth_protected
4
# These are factored out as constants for if you need to work against a
5
# server that doesn't support both schemes (like http-only dev servers)
6
PUBLIC_API_SCHEME = 'http'
7
AUTHENTICATED_API_SCHEME = 'https'
10
# this is only here because:
11
# a) ubuntu-sso-client does not support verifying if the credentials
13
# b) the restful client interface is not really needed because we just
14
# need this one single call
15
class UbuntuSsoAPI(PistonAPI):
16
default_service_root = 'http://localhost:8000/api/2.0'
20
def whoami(self, id=None):
21
# return self._get('accounts?ws.op=me',
22
# scheme=AUTHENTICATED_API_SCHEME)
23
return self._get('accounts?ws.op=me')