Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
711b677a
Commit
711b677a
authored
Apr 26, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
authentication
parent
9253dd67
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
olapy/core/mdx/tools/config_file_parser.py
olapy/core/mdx/tools/config_file_parser.py
+12
-0
olapy/core/services/xmla.py
olapy/core/services/xmla.py
+10
-1
No files found.
olapy/core/mdx/tools/config_file_parser.py
View file @
711b677a
...
@@ -15,6 +15,18 @@ class ConfigParser:
...
@@ -15,6 +15,18 @@ class ConfigParser:
def
config_file_exist
(
self
):
def
config_file_exist
(
self
):
return
os
.
path
.
isfile
(
os
.
path
.
join
(
self
.
cube_path
,
self
.
file_name
))
return
os
.
path
.
isfile
(
os
.
path
.
join
(
self
.
cube_path
,
self
.
file_name
))
def
xmla_authentication
(
self
):
with
open
(
os
.
path
.
join
(
self
.
cube_path
,
self
.
file_name
))
as
config_file
:
parser
=
etree
.
XMLParser
()
tree
=
etree
.
parse
(
config_file
,
parser
)
try
:
return
tree
.
xpath
(
'/cubes/xmla_authentication'
)[
0
].
text
==
'True'
except
:
return
False
def
get_cubes_names
(
self
):
def
get_cubes_names
(
self
):
with
open
(
os
.
path
.
join
(
self
.
cube_path
,
self
.
file_name
))
as
config_file
:
with
open
(
os
.
path
.
join
(
self
.
cube_path
,
self
.
file_name
))
as
config_file
:
...
...
olapy/core/services/xmla.py
View file @
711b677a
...
@@ -11,6 +11,7 @@ from spyne import AnyXml, Application, ServiceBase, rpc
...
@@ -11,6 +11,7 @@ from spyne import AnyXml, Application, ServiceBase, rpc
from
spyne.protocol.soap
import
Soap11
from
spyne.protocol.soap
import
Soap11
from
spyne.server.wsgi
import
WsgiApplication
from
spyne.server.wsgi
import
WsgiApplication
from
..mdx.tools.config_file_parser
import
ConfigParser
from
..services.models
import
DiscoverRequest
,
ExecuteRequest
,
Session
from
..services.models
import
DiscoverRequest
,
ExecuteRequest
,
Session
from
.xmla_discover_tools
import
XmlaDiscoverTools
from
.xmla_discover_tools
import
XmlaDiscoverTools
from
.xmla_execute_tools
import
XmlaExecuteTools
from
.xmla_execute_tools
import
XmlaExecuteTools
...
@@ -55,6 +56,13 @@ class XmlaProviderService(ServiceBase):
...
@@ -55,6 +56,13 @@ class XmlaProviderService(ServiceBase):
discover_tools
=
XmlaProviderService
.
discover_tools
discover_tools
=
XmlaProviderService
.
discover_tools
ctx
.
out_header
=
Session
(
SessionId
=
str
(
XmlaProviderService
.
SessionId
))
ctx
.
out_header
=
Session
(
SessionId
=
str
(
XmlaProviderService
.
SessionId
))
config_parser
=
ConfigParser
(
discover_tools
.
executer
.
cube_path
)
if
config_parser
.
xmla_authentication
():
# TODO call labster login or create login with token (according to labster db)
if
ctx
.
transport
.
req_env
[
'QUERY_STRING'
]
!=
'mouadh'
:
return
''
if
request
.
RequestType
==
"DISCOVER_DATASOURCES"
:
if
request
.
RequestType
==
"DISCOVER_DATASOURCES"
:
return
discover_tools
.
discover_datasources_response
()
return
discover_tools
.
discover_datasources_response
()
...
@@ -235,7 +243,8 @@ def start_server(write_on_file=False):
...
@@ -235,7 +243,8 @@ def start_server(write_on_file=False):
logging
.
getLogger
(
'spyne.protocol.xml'
).
setLevel
(
logging
.
DEBUG
)
logging
.
getLogger
(
'spyne.protocol.xml'
).
setLevel
(
logging
.
DEBUG
)
logging
.
info
(
"listening to http://127.0.0.1:8000/xmla"
)
logging
.
info
(
"listening to http://127.0.0.1:8000/xmla"
)
logging
.
info
(
"wsdl is at: http://localhost:8000/xmla?wsdl"
)
logging
.
info
(
"wsdl is at: http://localhost:8000/xmla?wsdl"
)
server
=
make_server
(
'127.0.0.1'
,
8000
,
wsgi_application
)
# server = make_server('127.0.0.1', 8000, wsgi_application)
server
=
make_server
(
'192.168.101.139'
,
8000
,
wsgi_application
)
server
.
serve_forever
()
server
.
serve_forever
()
...
...
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