mirror of
				https://git.coolaj86.com/coolaj86/greenlock-store-fs.js.git
				synced 2025-11-04 02:52:47 +00:00 
			
		
		
		
	passes basic tests
This commit is contained in:
		
							parent
							
								
									879b278d5f
								
							
						
					
					
						commit
						602a4c012a
					
				
							
								
								
									
										2
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								index.js
									
									
									
									
									
								
							@ -176,7 +176,7 @@ module.exports.create = function (config) {
 | 
			
		||||
  // Return null (not undefined) on success, or throw on error
 | 
			
		||||
  store.accounts.setKeypair = function (opts) {
 | 
			
		||||
    //console.log('accounts.setKeypair for', opts.account, opts.email, opts.keypair);
 | 
			
		||||
    var id = opts.account.id || 'single-user';
 | 
			
		||||
    var id = opts.account.id || opts.email || 'single-user';
 | 
			
		||||
 | 
			
		||||
    // you can just treat the keypair as opaque and save and retrieve it as JSON
 | 
			
		||||
    var keyblob = JSON.stringify({
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										27
									
								
								test.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								test.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
var tester = require('greenlock-store-test');
 | 
			
		||||
 | 
			
		||||
var crypto = require('crypto');
 | 
			
		||||
var os = require('os');
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var basedir = path.join(os.tmpdir(), 'greenlock-store-fs-test-' + crypto.randomBytes(4).toString('hex'));
 | 
			
		||||
var domain = '*.example.com';
 | 
			
		||||
var store = require('./').create({
 | 
			
		||||
  configDir: basedir
 | 
			
		||||
, accountsDir: path.join(basedir, 'accounts')
 | 
			
		||||
, privkeyPath: path.join(basedir, 'live', domain, 'privkey.pem')
 | 
			
		||||
, fullchainPath: path.join(basedir, 'live', domain, 'fullchain.pem')
 | 
			
		||||
, certPath: path.join(basedir, 'live', domain, 'cert.pem')
 | 
			
		||||
, chainPath: path.join(basedir, 'live', domain, 'chain.pem')
 | 
			
		||||
, bundlePath: path.join(basedir, 'live', domain, 'bundle.pem')
 | 
			
		||||
});
 | 
			
		||||
console.info('Test Dir:', basedir);
 | 
			
		||||
 | 
			
		||||
tester.test(store).then(function () {
 | 
			
		||||
  console.info("PASS");
 | 
			
		||||
}).catch(function (err) {
 | 
			
		||||
  console.error("FAIL");
 | 
			
		||||
  console.error(err);
 | 
			
		||||
  process.exit(20);
 | 
			
		||||
});
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user