Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b163b33455 | 
							
								
								
									
										40
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								README.md
									
									
									
									
									
								
							| @ -16,9 +16,43 @@ npm install --save-dev le-manage-test@3.x | |||||||
| 
 | 
 | ||||||
| ## Usage | ## Usage | ||||||
| 
 | 
 | ||||||
| ```bash | ```js | ||||||
| var tester = require('le-manage-test'); | var tester = require('le-manage-test'); | ||||||
| 
 | 
 | ||||||
|  | tester.test({ | ||||||
|  |   set: function updateDomains(info) { | ||||||
|  |     // { subject: 'example.com' | ||||||
|  |     // , altnames: ['example.com', '*.example.com', 'foo.bar.example.com' ] } | ||||||
|  |     DB.set(...) | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  | , get: function approveDomains(query) { | ||||||
|  |     // { domain: 'www.example.com' | ||||||
|  |     // , wildname: '*.example.com' // (for convenience, if you need it) | ||||||
|  |     return DB.get(...).then(function () { | ||||||
|  |       // { subject: 'example.com', altnames: [...] } | ||||||
|  |       return info; | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  | }).then(function () { | ||||||
|  |   console.info("PASS"); | ||||||
|  | }); | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | Note: The management plugin and storage plugins must support wildcards, | ||||||
|  | but if the user can't select or implement a dns-01 challenge then that | ||||||
|  | user simply doesn't get to use them. No worries. Nothing breaks. | ||||||
|  | 
 | ||||||
|  | ## Overview | ||||||
|  | 
 | ||||||
|  | Here's a more expanded breakdown of what the implementations might look like | ||||||
|  | (if that was too terse above): | ||||||
|  | 
 | ||||||
|  | ```js | ||||||
|  | var tester = require('le-manage-test'); | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | ```js | ||||||
| // The function that checks the database for the domain (or its wildcard) and returns the results | // The function that checks the database for the domain (or its wildcard) and returns the results | ||||||
| function approveDomains(opts) { | function approveDomains(opts) { | ||||||
|   var domain = opts.domain; |   var domain = opts.domain; | ||||||
| @ -35,12 +69,16 @@ function approveDomains(opts) { | |||||||
|   //return { subject: 'example.com', altnames: [ 'example.com', 'www.example.com' ] }; |   //return { subject: 'example.com', altnames: [ 'example.com', 'www.example.com' ] }; | ||||||
|   return { subject: info.subject, altnames: info.altnames }; |   return { subject: info.subject, altnames: info.altnames }; | ||||||
| } | } | ||||||
|  | ``` | ||||||
| 
 | 
 | ||||||
|  | ```js | ||||||
| function updateDomains(opts) { | function updateDomains(opts) { | ||||||
|   // return null (not undefined) |   // return null (not undefined) | ||||||
|   return DB.associate(opts.subject, opts.altnames); |   return DB.associate(opts.subject, opts.altnames); | ||||||
| } | } | ||||||
|  | ``` | ||||||
| 
 | 
 | ||||||
|  | ```js | ||||||
| tester.test({ | tester.test({ | ||||||
|   set: updateDomains |   set: updateDomains | ||||||
| , get: approveDomains | , get: approveDomains | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user