Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
File Transfer Service
fts-rest
Commits
99b53d57
Commit
99b53d57
authored
Nov 02, 2016
by
Maria Arsuaga Rios
Browse files
FTS-784
:convert to UCT using calendar
parent
3889760e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fts3rest/fts3rest/lib/middleware/fts3auth/methods/http.py
View file @
99b53d57
...
...
@@ -17,8 +17,8 @@
import
re
import
time
import
calendar
import
dateutil.parser
import
calendar
import
logging
import
urllib
from
M2Crypto.X509
import
X509Error
...
...
@@ -69,8 +69,9 @@ def do_authentication(credentials, env):
except
(
TypeError
,
ValueError
):
log
.
info
(
"Cannot decode certificate, signature or timestamp"
)
raise
InvalidCredentials
(
"Cannot decode certificate, signature or timestamp"
)
td
=
abs
(
int
(
calendar
.
timegm
(
time
.
gmtime
()))
-
int
(
ts
))
if
td
>
600
:
log
.
info
(
"Authorization has expired by "
+
str
(
td
)
+
" seconds"
)
raise
InvalidCredentials
(
"Authorization has expired by "
+
str
(
td
)
+
" seconds"
)
...
...
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