@bluemax/vault-multitenant
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -0,11 +1,13 @@ | ||
import { IVaultAuth } from './interfaces'; | ||
export * from './vault'; | ||
export * from './interfaces'; | ||
export * from './vault.service'; | ||
export * from './login.guard'; | ||
export * from './auth-engines'; | ||
export * from './secret-engines'; | ||
declare global { | ||
namespace Express { | ||
interface Request { | ||
vault?: any; | ||
vault?: IVaultAuth; | ||
} | ||
} | ||
} |
@@ -8,2 +8,3 @@ "use strict"; | ||
__export(require("./vault.service")); | ||
__export(require("./login.guard")); | ||
__export(require("./auth-engines")); | ||
__export(require("./secret-engines")); |
@@ -20,1 +20,16 @@ import { Request } from 'express'; | ||
} | ||
export interface IVaultAuth { | ||
client_token: string; | ||
accessor: string; | ||
policies: string[]; | ||
token_policies: string[]; | ||
metadata: { | ||
role: string; | ||
[key: string]: string; | ||
}; | ||
lease_duration: number; | ||
renewable: boolean; | ||
entity_id: string; | ||
token_type: string; | ||
orphan: boolean; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const vault_service_1 = require("./vault.service"); | ||
const secret_engines_1 = require("./secret-engines"); | ||
const database_1 = require("./secret-engines/database"); | ||
class VaultMultitenant { | ||
@@ -10,6 +12,16 @@ constructor(bxApp, options) { | ||
this.getAuthInfo = options.getAuthInfo || this.defaultAuthInfoParser; | ||
this.globalProviders = [{ | ||
this.globalProviders = [ | ||
{ | ||
provider: VaultMultitenant, | ||
use: this | ||
}]; | ||
}, | ||
{ | ||
provider: secret_engines_1.AWSSecretEngine, | ||
use: new secret_engines_1.AWSSecretEngine(this.vaultService) | ||
}, | ||
{ | ||
provider: database_1.DBSecretEngine, | ||
use: new database_1.DBSecretEngine(this.vaultService) | ||
} | ||
]; | ||
} | ||
@@ -16,0 +28,0 @@ defaultErrorHandler(error) { |
import { IVaultOptions } from './interfaces'; | ||
export declare class VaultService { | ||
private options; | ||
private hostname; | ||
hostname: string; | ||
constructor(options?: IVaultOptions); | ||
private formatHost; | ||
login(secretEngineName: string, token: string, role: string): Promise<any>; | ||
} |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const request_promise_native_1 = __importDefault(require("request-promise-native")); | ||
class VaultService { | ||
@@ -21,17 +17,3 @@ constructor(options) { | ||
} | ||
async login(secretEngineName, token, role) { | ||
return request_promise_native_1.default({ | ||
method: 'POST', | ||
uri: `${this.hostname}/v1/auth/${secretEngineName}/login`, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: { | ||
role, | ||
jwt: token | ||
}, | ||
json: true | ||
}); | ||
} | ||
} | ||
exports.VaultService = VaultService; |
{ | ||
"name": "@bluemax/vault-multitenant", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "vault extension for bluemax framework", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23487
22
314
1