Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
e1305ae0
Commit
e1305ae0
authored
Jul 21, 2015
by
Olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to enable or disable remote admin
parent
70d3ddf9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
opcua/internal_server.py
opcua/internal_server.py
+2
-1
opcua/server.py
opcua/server.py
+6
-0
No files found.
opcua/internal_server.py
View file @
e1305ae0
...
...
@@ -37,6 +37,7 @@ class InternalServer(object):
self
.
logger
=
logging
.
getLogger
(
__name__
)
self
.
endpoints
=
[]
self
.
_channel_id_counter
=
5
self
.
allow_remote_admin
=
True
self
.
aspace
=
AddressSpace
()
self
.
attribute_service
=
AttributeService
(
self
.
aspace
)
...
...
@@ -168,7 +169,7 @@ class InternalSession(object):
self
.
state
=
SessionState
.
Activated
id_token
=
ua
.
downcast_extobject
(
params
.
UserIdentityToken
)
if
id_token
.
TypeId
==
ua
.
FourByteNodeId
(
ua
.
ObjectIds
.
UserNameIdentityToken_Encoding_DefaultBinary
):
if
id_token
.
UserName
in
(
"admin"
,
"Admin"
):
if
self
.
iserver
.
allow_remote_admin
and
id_token
.
UserName
in
(
"admin"
,
"Admin"
):
self
.
user
=
User
.
Admin
return
result
...
...
opcua/server.py
View file @
e1305ae0
...
...
@@ -59,6 +59,12 @@ class Server(object):
sa_node
=
self
.
get_node
(
ua
.
NodeId
(
ua
.
ObjectIds
.
Server_ServerArray
))
sa_node
.
set_value
([
self
.
server_uri
])
def
allow_remote_admin
(
self
,
allow
):
"""
Enable or disable the builtin Admin user from network clients
"""
self
.
iserver
.
allow_remote_admin
=
allow
def
set_endpoint
(
self
,
url
):
self
.
endpoint
=
urlparse
(
url
)
...
...
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