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
200b9bff
Commit
200b9bff
authored
Dec 10, 2013
by
Sofia Papagiannaki
Browse files
pithos: Fix view issue with unicode paths
parent
8d33eb7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/oa2/models.py
View file @
200b9bff
...
...
@@ -124,7 +124,7 @@ class AuthorizationCode(models.Model):
def
__repr__
(
self
):
return
(
"Authorization code: %s "
"(user: %
s
, client: %
s
, redirect_uri: %
s
, scope: %
s
)"
%
(
"(user: %
r
, client: %
r
, redirect_uri: %
r
, scope: %
r
)"
%
(
self
.
code
,
self
.
user
.
log_display
,
self
.
client
.
get_id
(),
...
...
@@ -152,7 +152,7 @@ class Token(models.Model):
state
=
models
.
TextField
(
null
=
True
,
default
=
None
)
def
__repr__
(
self
):
return
(
"Token: %
s
(token_type: %
s
, grant_type: %
s
, "
"user: %
s
, client: %
s
, scope: %
s
)"
%
(
return
(
"Token: %
r
(token_type: %
r
, grant_type: %
r
, "
"user: %
r
, client: %
r
, scope: %
r
)"
%
(
self
.
code
,
self
.
token_type
,
self
.
grant_type
,
self
.
user
.
log_display
,
self
.
client
.
get_id
(),
self
.
scope
))
snf-pithos-app/pithos/api/util.py
View file @
200b9bff
...
...
@@ -75,6 +75,7 @@ from pithos.backends.base import (NotAllowedError, QuotaError, ItemNotExists,
VersionNotExists
)
from
synnefo.lib
import
join_urls
from
synnefo.util
import
text
from
astakosclient
import
AstakosClient
from
astakosclient.errors
import
NoUserName
,
NoUUID
,
AstakosClientException
...
...
@@ -1173,7 +1174,8 @@ def view_method():
try
:
access_token
=
request
.
GET
.
get
(
'access_token'
)
requested_resource
=
request
.
path
.
split
(
VIEW_PREFIX
,
2
)[
-
1
]
requested_resource
=
text
.
uenc
(
request
.
path
.
split
(
VIEW_PREFIX
,
2
)[
-
1
])
astakos
=
AstakosClient
(
SERVICE_TOKEN
,
ASTAKOS_AUTH_URL
,
retry
=
2
,
use_pool
=
True
,
logger
=
logger
)
...
...
@@ -1205,7 +1207,7 @@ def view_method():
'redirect_uri'
:
request
.
build_absolute_uri
(
request
.
path
),
'state'
:
''
,
# TODO include state for security
'scope'
:
request
.
path
.
split
(
VIEW_PREFIX
,
2
)[
-
1
]
}
'scope'
:
request
ed_resource
}
return
HttpResponseRedirect
(
'%s?%s'
%
(
join_urls
(
astakos
.
oauth2_url
,
'auth'
),
...
...
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