You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@aws-sdk/token-providers

Package Overview
Dependencies
Maintainers
5
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.208.0 to 3.209.0

8

dist-cjs/fromSso.js

@@ -40,3 +40,3 @@ "use strict";

catch (e) {
throw new property_provider_1.TokenProviderError(`The SSO session associated with this profile is invalid. ${constants_1.REFRESH_MESSAGE}`, false);
throw new property_provider_1.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${constants_1.REFRESH_MESSAGE}`, false);
}

@@ -54,5 +54,5 @@ (0, validateTokenKey_1.validateTokenKey)("accessToken", ssoToken.accessToken);

}
(0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId);
(0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret);
(0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken);
(0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId, true);
(0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret, true);
(0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken, true);
try {

@@ -59,0 +59,0 @@ lastRefreshAttemptTime.setTime(Date.now());

@@ -6,7 +6,7 @@ "use strict";

const constants_1 = require("./constants");
const validateTokenKey = (key, value) => {
const validateTokenKey = (key, value, forRefresh = false) => {
if (typeof value === "undefined") {
throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token'. ${constants_1.REFRESH_MESSAGE}`, false);
throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${constants_1.REFRESH_MESSAGE}`, false);
}
};
exports.validateTokenKey = validateTokenKey;

@@ -7,4 +7,4 @@ "use strict";

const { writeFile } = fs_1.promises;
const writeSSOTokenToFile = (ssoStartUrl, ssoToken) => {
const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(ssoStartUrl);
const writeSSOTokenToFile = (id, ssoToken) => {
const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(id);
const tokenString = JSON.stringify(ssoToken, null, 2);

@@ -11,0 +11,0 @@ return writeFile(tokenFilepath, tokenString);

@@ -37,3 +37,3 @@ import { TokenProviderError } from "@aws-sdk/property-provider";

catch (e) {
throw new TokenProviderError(`The SSO session associated with this profile is invalid. ${REFRESH_MESSAGE}`, false);
throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
}

@@ -51,5 +51,5 @@ validateTokenKey("accessToken", ssoToken.accessToken);

}
validateTokenKey("clientId", ssoToken.clientId);
validateTokenKey("clientSecret", ssoToken.clientSecret);
validateTokenKey("refreshToken", ssoToken.refreshToken);
validateTokenKey("clientId", ssoToken.clientId, true);
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
try {

@@ -56,0 +56,0 @@ lastRefreshAttemptTime.setTime(Date.now());

import { TokenProviderError } from "@aws-sdk/property-provider";
import { REFRESH_MESSAGE } from "./constants";
export const validateTokenKey = (key, value) => {
export const validateTokenKey = (key, value, forRefresh = false) => {
if (typeof value === "undefined") {
throw new TokenProviderError(`Value not present for '${key}' in SSO Token'. ${REFRESH_MESSAGE}`, false);
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
}
};
import { getSSOTokenFilepath } from "@aws-sdk/shared-ini-file-loader";
import { promises as fsPromises } from "fs";
const { writeFile } = fsPromises;
export const writeSSOTokenToFile = (ssoStartUrl, ssoToken) => {
const tokenFilepath = getSSOTokenFilepath(ssoStartUrl);
export const writeSSOTokenToFile = (id, ssoToken) => {
const tokenFilepath = getSSOTokenFilepath(id);
const tokenString = JSON.stringify(ssoToken, null, 2);
return writeFile(tokenFilepath, tokenString);
};

@@ -1,1 +0,5 @@

export declare const validateTokenKey: (key: string, value: unknown) => void;
export declare const validateTokenKey: (
key: string,
value: unknown,
forRefresh?: boolean
) => void;
import { SSOToken } from "@aws-sdk/shared-ini-file-loader";
export declare const writeSSOTokenToFile: (
ssoStartUrl: string,
id: string,
ssoToken: SSOToken
) => Promise<void>;
/**
* Throws TokenProviderError if value is undefined for key.
*/
export declare const validateTokenKey: (key: string, value: unknown) => void;
export declare const validateTokenKey: (key: string, value: unknown, forRefresh?: boolean) => void;
import { SSOToken } from "@aws-sdk/shared-ini-file-loader";
/**
* Writes SSO token to file based on filepath computed from ssoStartUrl.
* Writes SSO token to file based on filepath computed from ssoStartUrl or session name.
*/
export declare const writeSSOTokenToFile: (ssoStartUrl: string, ssoToken: SSOToken) => Promise<void>;
export declare const writeSSOTokenToFile: (id: string, ssoToken: SSOToken) => Promise<void>;
{
"name": "@aws-sdk/token-providers",
"version": "3.208.0",
"version": "3.209.0",
"description": "A collection of token providers",

@@ -28,5 +28,5 @@ "main": "./dist-cjs/index.js",

"dependencies": {
"@aws-sdk/client-sso-oidc": "3.208.0",
"@aws-sdk/client-sso-oidc": "3.209.0",
"@aws-sdk/property-provider": "3.208.0",
"@aws-sdk/shared-ini-file-loader": "3.208.0",
"@aws-sdk/shared-ini-file-loader": "3.209.0",
"@aws-sdk/types": "3.208.0",

@@ -33,0 +33,0 @@ "tslib": "^2.3.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc