remove namespace API endpoints (these should only be accessed through the CLI)

This commit is contained in:
Jude Nelson
2017-04-12 17:15:08 -04:00
parent c2509b9568
commit cd110dd59c

View File

@@ -1749,15 +1749,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
return
def POST_namespaces( self, ses, path_info ):
"""
Preorder and reveal a namespace
Currently unimpleemnted
"""
self._reply_json({'error': 'Unimplemented'}, status_code=405)
return
def GET_namespace_info( self, ses, path_info, namespace_id ):
"""
Look up a namespace's info
@@ -1782,14 +1773,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
return
def PUT_namespace_ready( self, ses, path_info, namespace_id ):
"""
Launch a namespace; mark it as ready.
Not implemented
"""
return self._reply_json({'error': 'Not implemented'}, status_code=501)
def GET_namespace_names( self, ses, path_info, namespace_id ):
"""
Get the list of names in a namespace
@@ -1818,22 +1801,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
return
def POST_namespace_name_import( self, ses, path_info, namespace_id ):
"""
Import a name.
Not implemented
"""
return self._reply_json({'error': 'Not implemented'}, status_code=501)
def PUT_namespace_name_import( self, ses, path_info, namespace_id ):
"""
Re-import a name
Not implemented
"""
return self._reply_json({'error': 'Not implemented'}, status_code=501)
def GET_wallet_payment_address( self, ses, path_info ):
"""
Get the wallet payment address
@@ -2676,7 +2643,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
r'^/v1/namespaces$': {
'routes': {
'GET': self.GET_namespaces,
'POST': self.POST_namespaces, # accepts: namespace-reveal info. Returns: HTTP 202 with txid (NAMESPACE_PREORDER)
},
'whitelist': {
'GET': {
@@ -2686,19 +2652,11 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
'auth_pass': False,
'need_data_key': False
},
'POST': {
'name': 'namespace_registration',
'desc': 'create new namespaces',
'auth_session': True,
'auth_pass': True,
'need_data_key': False
},
},
},
r'^/v1/namespaces/({})$'.format(NAMESPACE_CLASS): {
'routes': {
'GET': self.GET_namespace_info,
'PUT': self.PUT_namespace_ready, # accepts: {'launched': True}, Returns: HTTP 202 with txid (NAMESPACE_READY)
},
'whitelist': {
'GET': {
@@ -2708,19 +2666,11 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
'auth_pass': False,
'need_data_key': False
},
'PUT': {
'name': 'namespace_registration',
'desc': 'launch namespaces',
'auth_session': True,
'auth_pass': True,
'need_data_key': False
},
},
},
r'^/v1/namespaces/({})/names$'.format(NAMESPACE_CLASS): {
'routes': {
'GET': self.GET_namespace_names,
'POST': self.POST_namespace_name_import, # accepts name, owner, zonefile; returns HTTP 202 with txid (NAME_IMPORT)
},
'whitelist': {
'GET': {
@@ -2730,27 +2680,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
'auth_pass': False,
'need_data_key': False
},
'POST': {
'name': 'namespace_registration',
'desc': 'import names into new namespaces',
'auth_session': True,
'auth_pass': True,
'need_data_key': False
},
},
},
r'^/v1/namespaces/({})/names/({})$'.format(NAMESPACE_CLASS, NAME_CLASS): {
'routes': {
'PUT': self.PUT_namespace_name_import, # re-imports a name
},
'whitelist': {
'PUT': {
'name': 'namespace_registration',
'desc': 're-import names into a new namespace',
'auth_session': True,
'auth_pass': True,
'need_data_key': False
},
},
},
r'^/v1/wallet/payment_address$': {