Revision b39ca571 astakosclient/astakosclient/__init__.py
b/astakosclient/astakosclient/__init__.py | ||
---|---|---|
497 | 497 |
self._fill_endpoints(r) |
498 | 498 |
return r |
499 | 499 |
|
500 |
# -------------------------------------- |
|
501 |
# do a GET to ``API_TOKENS`` with a token |
|
502 |
def validate_token(self, token_id, belongsTo=None): |
|
503 |
""" Validate a temporary access token (oath2) |
|
504 |
|
|
505 |
Keyword arguments: |
|
506 |
belongsTo -- confirm that token belongs to tenant |
|
507 |
|
|
508 |
It returns back the token as well as information about the token |
|
509 |
holder. |
|
510 |
|
|
511 |
The belongsTo is optional and if it is given it must be inside the |
|
512 |
token's scope. |
|
513 |
|
|
514 |
In case of error raise an AstakosClientException. |
|
515 |
|
|
516 |
""" |
|
517 |
path = join_urls(self.api_tokens, str(token_id)) |
|
518 |
if belongsTo is not None: |
|
519 |
params = {'belongsTo': belongsTo} |
|
520 |
path = '%s?%s' % (path, urllib.urlencode(params)) |
|
521 |
return self._call_astakos(path, method="GET", log_body=False) |
|
522 |
|
|
500 | 523 |
# ---------------------------------- |
501 | 524 |
# do a GET to ``API_QUOTAS`` |
502 | 525 |
def get_quotas(self): |
Also available in: Unified diff