mirror of
				https://github.com/laurivosandi/certidude
				synced 2025-10-31 01:19:11 +00:00 
			
		
		
		
	Add preliminary bootstrap API call
This commit is contained in:
		| @@ -190,6 +190,7 @@ def certidude_app(): | ||||
|     from .cfg import ConfigResource, ScriptResource | ||||
|     from .tag import TagResource, TagDetailResource | ||||
|     from .attrib import AttributeResource | ||||
|     from .bootstrap import BootstrapResource | ||||
|  | ||||
|     app = falcon.API(middleware=NormalizeMiddleware()) | ||||
|     app.req_options.auto_parse_form_urlencoded = True | ||||
| @@ -202,6 +203,7 @@ def certidude_app(): | ||||
|     app.add_route("/api/request/{cn}/", RequestDetailResource()) | ||||
|     app.add_route("/api/request/", RequestListResource()) | ||||
|     app.add_route("/api/", SessionResource()) | ||||
|     app.add_route("/api/bootstrap/", BootstrapResource()) | ||||
|  | ||||
|     # Extended attributes for scripting etc. | ||||
|     app.add_route("/api/signed/{cn}/attr/", AttributeResource()) | ||||
|   | ||||
							
								
								
									
										14
									
								
								certidude/api/bootstrap.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								certidude/api/bootstrap.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| import logging | ||||
| from certidude.decorators import serialize | ||||
| from certidude.config import cp | ||||
| from certidude import authority, config, const | ||||
| from jinja2 import Template | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| class BootstrapResource(object): | ||||
|     def on_get(self, req, resp): | ||||
|         resp.body = Template(open(config.BOOTSTRAP_TEMPLATE).read()).render( | ||||
|             authority = const.FQDN, | ||||
|             servers = [cn for cn, path, buf, cert, server in authority.list_signed() if server]) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user