mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[@types/vault-auth-aws] Add types for vault-auth-aws NPM packa… (#40509)
* add vault-auth-aws * fix interface
This commit is contained in:
parent
f7da07be7b
commit
3ceab7a9a2
41
types/vault-auth-aws/index.d.ts
vendored
Normal file
41
types/vault-auth-aws/index.d.ts
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// Type definitions for vault-auth-aws 0.1
|
||||
// Project: https://github.com/abdullahshahin/vault-auth-aws
|
||||
// Definitions by: Nathan McGinn <https://github.com/nmcginn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.7
|
||||
/// <reference types="node" />
|
||||
|
||||
declare class vaultAuthAws {
|
||||
constructor(config?: vaultAuthAws.Config);
|
||||
authenticate(): Promise<any>;
|
||||
getOptions(creds: vaultAuthAws.Creds): vaultAuthAws.Options;
|
||||
}
|
||||
|
||||
declare namespace vaultAuthAws {
|
||||
interface Config {
|
||||
ssl?: boolean;
|
||||
host?: string;
|
||||
port?: number;
|
||||
apiVersion?: string;
|
||||
vaultLoginUrl?: string;
|
||||
vaultAppName?: string;
|
||||
followAllRedirects?: boolean;
|
||||
certFilePath?: string;
|
||||
sslRejectUnAuthorized?: boolean;
|
||||
}
|
||||
|
||||
interface Creds {
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
sessionToken?: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
url: string;
|
||||
followAllRedirects: boolean;
|
||||
body: string;
|
||||
cert?: Buffer;
|
||||
}
|
||||
}
|
||||
|
||||
export = vaultAuthAws;
|
||||
23
types/vault-auth-aws/tsconfig.json
Normal file
23
types/vault-auth-aws/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"vault-auth-aws-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/vault-auth-aws/tslint.json
Normal file
1
types/vault-auth-aws/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{"extends":"dtslint/dt.json"}
|
||||
24
types/vault-auth-aws/vault-auth-aws-tests.ts
Normal file
24
types/vault-auth-aws/vault-auth-aws-tests.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import vaultAuthAws = require('vault-auth-aws');
|
||||
|
||||
const config: vaultAuthAws.Config = {
|
||||
ssl: false,
|
||||
host: 'localhost',
|
||||
port: 3000,
|
||||
apiVersion: 'v1',
|
||||
vaultLoginUrl: 'auth/aws/login',
|
||||
vaultAppName: '',
|
||||
followAllRedirects: true,
|
||||
certFilePath: undefined,
|
||||
sslRejectUnAuthorized: true
|
||||
};
|
||||
|
||||
const creds: vaultAuthAws.Creds = {
|
||||
accessKeyId: '',
|
||||
secretAccessKey: '',
|
||||
sessionToken: ''
|
||||
};
|
||||
|
||||
const vault = new vaultAuthAws(config);
|
||||
|
||||
vault.getOptions(creds);
|
||||
Promise.resolve(vault.authenticate());
|
||||
Loading…
Reference in New Issue
Block a user