Skip to content

Commit

Permalink
typing: add loadSsoSessionsFrom and expose private util methods to In…
Browse files Browse the repository at this point in the history
…iLoader (#4456)

* typing: add loadSsoSessionsFrom method to IniLoader

* typing: expose getDefaultFilePath and getHomeDir methods
  • Loading branch information
guiyom-e authored Jun 12, 2024
1 parent 4bcdd9a commit e295aa5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
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

0 comments on commit e295aa5

Please sign in to comment.