Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dm-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hammonds
dm-docs
Commits
095e4ec5
Commit
095e4ec5
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
added SSO interfaces
parent
44d003cb
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/dm/ds_web_service/service/authSessionController.py
+28
-0
28 additions, 0 deletions
...python/dm/ds_web_service/service/authSessionController.py
with
28 additions
and
0 deletions
src/python/dm/ds_web_service/service/authSessionController.py
+
28
−
0
View file @
095e4ec5
#authenticateUser!/usr/bin/env python
import
json
import
cherrypy
from
dm.common.utility.encoder
import
Encoder
from
dm.common.exceptions.invalidRequest
import
InvalidRequest
from
dm.common.service.dmSessionController
import
DmSessionController
from
dm.ds_web_service.service.impl.authSessionControllerImpl
import
AuthSessionControllerImpl
...
...
@@ -20,3 +24,27 @@ class AuthSessionController(DmSessionController):
self
.
logger
.
debug
(
'
Returning authorization principal for %s
'
%
(
username
))
return
response
@cherrypy.expose
@DmSessionController.require
(
DmSessionController
.
isAdministrator
())
@DmSessionController.execute
def
addSession
(
self
,
sessionId
,
**
kwargs
):
if
not
len
(
sessionId
):
raise
InvalidRequest
(
'
Invalid session id provided.
'
)
sessionInfo
=
kwargs
.
get
(
'
sessionInfo
'
)
if
not
sessionInfo
:
raise
InvalidRequest
(
'
Missing session object.
'
)
sessionInfo
=
json
.
loads
(
Encoder
.
decode
(
sessionInfo
))
response
=
self
.
authSessionControllerImpl
.
addSession
(
sessionId
,
sessionInfo
).
getFullJsonRep
()
self
.
logger
.
debug
(
'
Session %s added to cache
'
%
(
sessionInfo
))
return
response
@cherrypy.expose
@DmSessionController.require
(
DmSessionController
.
isAdministrator
())
@DmSessionController.execute
def
checkSession
(
self
,
sessionId
,
**
kwargs
):
if
not
len
(
sessionId
):
raise
InvalidRequest
(
'
Invalid session id provided.
'
)
response
=
self
.
authSessionControllerImpl
.
checkSession
(
sessionId
).
getFullJsonRep
()
self
.
logger
.
debug
(
'
Verified session %s
'
%
(
sessionId
))
return
response
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment