Commit 53b5c9b9 authored by Likun Zhang's avatar Likun Zhang
Browse files

1. Rename cmdctl account file name from 'passwd.csv' to 'cmdctl-accounts.csv':

2. Create file for private key and certificate seperately.
3. Add spec file for cmdctl.
4. Update todo list.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1277 e5f2f494-b856-4b98-b285-d166d9295462
parent 6341a708
......@@ -4,7 +4,7 @@ pkglibexec_SCRIPTS = b10-cmdctl
b10_cmdctldir = $(DESTDIR)$(pkgdatadir)
# TODO: this is dangerous -- will overwrite!
b10_cmdctl_DATA = passwd.csv b10-cmdctl.pem
b10_cmdctl_DATA = cmdctl-accounts.csv cmdctl-keyfile.pem cmdctl-certfile.pem cmdctl.spec
CLEANFILES= b10-cmdctl
......@@ -15,5 +15,6 @@ b10-cmdctl: cmdctl.py
chmod a+x $@
install-data-local:
chmod go-rwx $(DESTDIR)$(pkgdatadir)/passwd.csv
chmod go-rwx $(DESTDIR)$(pkgdatadir)/b10-cmdctl.pem
chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-accounts.csv
chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-certfile.pem
chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-keyfile.pem
1. Refine code for b10-cmdctl.
2. Add value type check according module specification.
3. Description/Requirement document for b10-cmdctl.
4. RESTful API document for b10-cmdctl.
5. Unit tests for b10-cmdctl.
6. Man page for b10-cmdctl?
7. Support 'make install', Save user information and ssl certificate file to configmanager.
. Refine code for b10-cmdctl.
. Add value type check according module specification.
. Add return code for RESTful API document of b10-cmdctl.
. Add more unit tests for b10-cmdctl.
. Update man page for b10-cmdctl?
. Add id to each command, so the receiver knows if the response is what it wants.
. Make cmdctl can be configured through bindctl.(after id is added)
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDpICWxJGKMvUhLFPbf5n8ZWogqjYcQqqoHqHVRHYjyiey6FZdt
ZkY2s1gYh0G0NXtimlIgic+vEcFe7vdmyKntW7DYDa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kVqPuD8CZ1Rq4ATyiwIDAQAB
AoGBAOJlOtV+DUq6Y2Ou91VXRiU8GzKgAQP5iWgoe84Ljbxkn4XThBxVD2j94Fbp
u7AjpDCMx6cbzpoo9w6XqaGizAmAehIfTE3eFYs74N/FM09Wg2OSDyxMY0jgyECU
A4ukjlPwcGDbmgbmlY3i+FVHp+zCgtZEsMC1IAosMac1BoX5AkEA/lrXWaVtH8bo
mut3GBaXvubZMdaUr0BUd5a9q+tt4dQcKG1kFqgCNKhNhBIcpiMVcz+jGmOuopNA
8dnUGqv3FQJBAOqiJ54ZvOTWNDpJIe02wIXRxRmc1xhHFCqYP23KxBVrAcTYB19J
lesov/hEbnGLCbKS/naZJ1zrTImUPNRLqx8CQCzDtA7U7GWhTiKluioFH+O7IRKC
X1yQh80cPHlbT9VkzSfYSLssCmdWD35k6aHbntTPqFbmoD+AhveJjKi9BxkCQDwX
1c+/RcrSNcQr0N2hZUOgyztZGRnlsnuKTMyA3yGhK23P6mt0PEpjQG+Ej0jTVGOB
FF0pspQwy4R9C+tPif8CQH36NNlXBfVNmT7kDtyLmaE6pID0vY9duX56BJbU1R0x
SQ8/LcfJagk6gvp08OyYCPA+WZ7u/bas9R/nMTCLivc=
-----END RSA PRIVATE KEY-----
......@@ -60,8 +60,9 @@ else:
DATAROOTDIR = "@datarootdir@"
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
SPECFILE_LOCATION = SPECFILE_PATH + "/cmdctl.spec"
USER_INFO_FILE = SPECFILE_PATH + "/passwd.csv"
CERTIFICATE_FILE = SPECFILE_PATH + "/b10-cmdctl.pem"
USER_INFO_FILE = SPECFILE_PATH + "/cmdctl-accounts.csv"
PRIVATE_KEY_FILE = SPECFILE_PATH + "/cmdctl-keyfile.pem"
CERTIFICATE_FILE = SPECFILE_PATH + "/cmdctl-certfile.pem"
class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
'''https connection request handler.
......@@ -357,7 +358,7 @@ class SecureHTTPServer(http.server.HTTPServer):
connstream = ssl.wrap_socket(newsocket,
server_side = True,
certfile = CERTIFICATE_FILE,
keyfile = CERTIFICATE_FILE,
keyfile = PRIVATE_KEY_FILE,
ssl_version = ssl.PROTOCOL_SSLv23)
return (connstream, fromaddr)
except ssl.SSLError as e :
......
{
"module_spec": {
"module_name": "Cmdctl",
"config_data": [
{
"item_name": "key_file",
"item_type": "string",
"item_optional": False,
"item_default": 'cmdctl-keyfile.pem'
},
{
"item_name": "cert_file",
"item_type": "string",
"item_optional": False,
"item_default": 'cmdctl-certfile.pem'
},
{
"item_name": "accounts_file",
"item_type": "string",
"item_optional": False,
"item_default": 'cmdctl-accounts.csv'
}
],
"commands": [
{
"command_name": "print_message",
"command_description": "Print the given message to stdout",
"command_args": [ {
"item_name": "message",
"item_type": "string",
"item_optional": False,
"item_default": ""
} ]
},
{
"command_name": "print_settings",
"command_description": "Print some_string and some_int to stdout",
"command_args": []
},
{
"command_name": "shutdown",
"command_description": "Shut down cmdctl",
"command_args": []
}
]
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment