View source on GitHub |
Trivial implementation of the UserService
.
Inherits From: APIProxyStub
, expected_type
google.appengine.api.user_service_stub.UserServiceStub(
login_url=_DEFAULT_LOGIN_URL,
logout_url=_DEFAULT_LOGOUT_URL,
service_name='user',
auth_domain=_DEFAULT_AUTH_DOMAIN,
request_data=None
)
Args | |
---|---|
login_url
|
String containing the URL to use for logging in. |
logout_url
|
String containing the URL to use for logging out. |
service_name
|
Service name expected for all calls. |
auth_domain
|
The authentication domain for the service (e.g. "gmail.com"). |
request_data
|
A apiproxy_stub.RequestData instance used to look up state
associated with the request that generated an API call.
|
Methods
CreateRPC
CreateRPC()
Creates RPC object instance.
Returns | |
---|---|
An instance of RPC. |
MakeSyncCall
MakeSyncCall(
service, call, request, response, request_id=None
)
The main RPC entry point.
Args | |
---|---|
service
|
Must be name as provided to service_name of constructor.
|
call
|
A string representing the rpc to make. Must be part of
the underlying services methods and impemented by _Dynamic_<call> .
|
request
|
A protocol buffer of the type corresponding to call .
|
response
|
A protocol buffer of the type corresponding to call .
|
request_id
|
A unique string identifying the request associated with the API call. |
SetError
SetError(
error, method=None, error_rate=1
)
Set an error condition that may be raised when calls made to stub.
If a method is specified, the error will only apply to that call. The error rate is applied to the method specified or all calls if method is not set.
Args | |
---|---|
error
|
An instance of apiproxy_errors.Error or None for no error.
|
method
|
A string representing the method that the error will affect. |
error_rate
|
a number from [0, 1] that sets the chance of the error,
defaults to 1 .
|
SetOAuthUser
SetOAuthUser(
email=_OAUTH_EMAIL,
domain=_OAUTH_AUTH_DOMAIN,
user_id=_OAUTH_USER_ID,
is_admin=False,
scopes=None,
client_id=_OAUTH_CLIENT_ID
)
Set test OAuth user.
Determines what user is returned by requests to GetOAuthUser
.
Args | |
---|---|
email
|
Email address of OAuth user. None indicates that no oauth user is authenticated. |
domain
|
Domain of OAuth user. |
user_id
|
User ID of OAuth user. |
is_admin
|
Whether the user is an admin. |
scopes
|
List of scopes that user is authenticated against. |
client_id
|
Client ID of the OAuth2 request |
Class Variables | |
---|---|
THREADSAFE |
True
|