Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
b65e7a3b
Commit
b65e7a3b
authored
Nov 19, 2013
by
Sofia Papagiannaki
Browse files
astakosclient: Provide call for validating a temporary oa2 token
parent
dad198ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
astakosclient/astakosclient/__init__.py
View file @
b65e7a3b
...
...
@@ -497,6 +497,29 @@ class AstakosClient(object):
self
.
_fill_endpoints
(
r
)
return
r
# --------------------------------------
# do a GET to ``API_TOKENS`` with a token
def
validate_token
(
self
,
token_id
,
belongsTo
=
None
):
""" Validate a temporary access token (oath2)
Keyword arguments:
belongsTo -- confirm that token belongs to tenant
It returns back the token as well as information about the token
holder.
The belongsTo is optional and if it is given it must be inside the
token's scope.
In case of error raise an AstakosClientException.
"""
path
=
join_urls
(
self
.
api_tokens
,
str
(
token_id
))
if
belongsTo
is
not
None
:
params
=
{
'belongsTo'
:
belongsTo
}
path
=
'%s?%s'
%
(
path
,
urllib
.
urlencode
(
params
))
return
self
.
_call_astakos
(
path
,
method
=
"GET"
,
log_body
=
False
)
# ----------------------------------
# do a GET to ``API_QUOTAS``
def
get_quotas
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment