def clientgetter(self, f):
"""Register a function as the client getter.
The function accepts one parameter `client_key`, and it returns
a client object with at least these information:
- client_key: A random string
- client_secret: A random string
- redirect_uris: A list of redirect uris
- default_realms: Default scopes of the client
The client may contain more information, which is suggested:
- default_redirect_uri: One of the redirect uris
Implement the client getter::
@oauth.clientgetter
def get_client(client_key):
client = get_client_model(client_key)
# Client is an object
return client
"""
self._clientgetter = f
return f
评论列表
文章目录