Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typing: add loadSsoSessionsFrom and expose private util methods to IniLoader #4456

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 24 additions & 1 deletion lib/shared-ini/ini-loader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,30 @@ export class IniLoader{
* Load configurations from config/credentials files and cache them
* for later use. If no file is specified it will try to load default
* files.
* @returns {object} object of all profile information in the file
* @returns {Record<string, string>} object of all profile information in the file
*/
loadFrom(options: LoadFileOptions): IniFileContent;

/**
* Load sso sessions from config/credentials files and cache them
* for later use. If no file is specified it will try to load default
* files.
* @returns {Record<string, string>} object of all sso sessions information in the file
*/
loadSsoSessionsFrom(options: LoadFileOptions): IniFileContent;

/**
* Get default file path for config/credentials files.
*
* @param isConfig whether the file is a config file or a credentials file
* @returns {string} default file path
*/
getDefaultFilePath(isConfig: boolean): string;

/**
* Get Home directory of the current user.
*
* @returns {string} home directory path
* */
getHomeDir(): string;
}
6 changes: 0 additions & 6 deletions lib/shared-ini/ini-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ AWS.IniLoader = AWS.util.inherit({
return this.resolvedSsoSessions[filename];
},

/**
* @api private
*/
getDefaultFilePath: function getDefaultFilePath(isConfig) {
return path.join(
this.getHomeDir(),
Expand All @@ -114,9 +111,6 @@ AWS.IniLoader = AWS.util.inherit({
);
},

/**
* @api private
*/
getHomeDir: function getHomeDir() {
var env = process.env;
var home = env.HOME ||
Expand Down