Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap/xssec

Package Overview
Dependencies
Maintainers
0
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/xssec - npm Package Compare versions

Comparing version 4.2.4 to 4.2.5

src/error/network/TimeoutError.js

3

CHANGELOG.md
# Change Log
All notable changes to this project will be documented in this file.
## 4.2.5 - 2024-10-16
- add TimeoutError Exception to provide a way to identify a timeout error
## 4.2.4 - 2024-09-05

@@ -5,0 +8,0 @@ - fix missing x-zid header in XSUAA token fetches via v3 compatibility requests with zoneId parameter

2

package.json
{
"name": "@sap/xssec",
"version": "4.2.4",
"version": "4.2.5",
"description": "XS Advanced Container Security API for node.js",

@@ -5,0 +5,0 @@ "main": "./src",

@@ -284,3 +284,3 @@ @sap/xssec: SAP BTP Security Services Node.js Integration Library

try {
xsuaaService.fetchClientCredentialsToken()
await xsuaaService.fetchClientCredentialsToken()
} catch(e) {

@@ -287,0 +287,0 @@ if(e instanceof XssecError) {

@@ -17,2 +17,3 @@ const ConfigurationError = require('./configuration/ConfigurationError');

const ResponseError = require('./network/ResponseError');
const TimeoutError = require('./network/TimeoutError');
const TokenValidationError = require('./validation/TokenValidationError');

@@ -43,2 +44,3 @@ const UnsupportedAlgorithmError = require('./validation/UnsupportedAlgorithmError');

ResponseError,
TimeoutError,
TokenValidationError,

@@ -45,0 +47,0 @@ UnsupportedAlgorithmError,

@@ -7,3 +7,3 @@ const NetworkError = require("./NetworkError");

class RequestError extends NetworkError {
/** @type {import("node-fetch").RequestInit} */
/** @type {import("https").RequestOptions & {name: string}} */
request;

@@ -10,0 +10,0 @@ /** @type {Error} the original error of the HTTP client for debugging. Do not code against this property as the internal HTTP client implementation may change anytime. */

@@ -122,3 +122,3 @@ const https = require('https');

req.destroy();
reject(new FetchError(`request to ${url} timed out.`));
reject(new FetchError(`request to ${url} timed out.`, { code: 'ETIMEDOUT' }));
});

@@ -125,0 +125,0 @@

@@ -6,2 +6,4 @@ const fetch = require("./fetch");

const ResponseError = require("../error/network/ResponseError");
const TimeoutError = require("../error/network/TimeoutError");
const {CORRELATIONID_HEADER_VCAP, DEFAULT_TIMEOUT, MAX_TIMEOUT, USER_AGENT } = require('../util/constants');

@@ -33,4 +35,4 @@ const { shrinkRequestOptionsForLog } = require("./util");

response = await fetch(url, request);
} catch(e) {
const error = new RequestError(url, {...request, name: requestName}, e);
} catch(e) {
const error = e.code === 'ETIMEDOUT' ? new TimeoutError(url, {...request, name: requestName}, e) : new RequestError(url, {...request, name: requestName}, e);
LOG.error(error.message, { correlationId });

@@ -37,0 +39,0 @@ throw error;

@@ -17,2 +17,3 @@ import ConfigurationError = require("./configuration/ConfigurationError");

import ResponseError = require("./network/ResponseError");
import TimeoutError = require("./network/TimeoutError");
import TokenValidationError = require("./validation/TokenValidationError");

@@ -25,3 +26,3 @@ import UnsupportedAlgorithmError = require("./validation/UnsupportedAlgorithmError");

import XssecError = require("./XssecError");
export { ConfigurationError, ExpiredTokenError, InvalidClientCertificateError, InvalidCredentialsError, InvalidIssuerError, InvalidJwtError, InvalidTokenSignatureError, MissingClientCertificateError, MissingIssuerError, MissingJwtError, MissingKidError, MissingVerificationKeyError, NetworkError, NotYetValidTokenError, RequestError, ResponseError, TokenValidationError, UnsupportedAlgorithmError, UntrustedIssuerError, ValidationError, WrongAudienceError, X5tError, XssecError };
export { ConfigurationError, ExpiredTokenError, InvalidClientCertificateError, InvalidCredentialsError, InvalidIssuerError, InvalidJwtError, InvalidTokenSignatureError, MissingClientCertificateError, MissingIssuerError, MissingJwtError, MissingKidError, MissingVerificationKeyError, NetworkError, NotYetValidTokenError, RequestError, ResponseError, TimeoutError, TokenValidationError, UnsupportedAlgorithmError, UntrustedIssuerError, ValidationError, WrongAudienceError, X5tError, XssecError };
//# sourceMappingURL=index.d.ts.map

@@ -7,4 +7,6 @@ export = RequestError;

constructor(url: any, request: any, originalError: any, message?: string);
/** @type {import("node-fetch").RequestInit} */
request: any;
/** @type {import("https").RequestOptions & {name: string}} */
request: import("https").RequestOptions & {
name: string;
};
/** @type {Error} the original error of the HTTP client for debugging. Do not code against this property as the internal HTTP client implementation may change anytime. */

@@ -11,0 +13,0 @@ orignalError: Error;

@@ -59,8 +59,4 @@ export = Service;

validateTokenSignature(token: Token, contextConfig: Types.SecurityContextConfig): Promise<void>;
getOpenIDConfiguration({ correlationId }?: {
correlationId: any;
}): Promise<any>;
fetchOpenIDConfiguration({ correlationId }?: {
correlationId: any;
}): Promise<any>;
getOpenIDConfiguration({ correlationId }?: {}): Promise<any>;
fetchOpenIDConfiguration({ correlationId }?: {}): Promise<any>;
/**

@@ -67,0 +63,0 @@ * Fetches a token from this service with this service's client credentials.

export = Token;
declare class Token {
constructor(jwt: any, { header, payload }?: {
header: any;
payload: any;
});
constructor(jwt: any, { header, payload }?: {});
get audiences(): string[];

@@ -8,0 +5,0 @@ get azp(): any;

@@ -1,6 +0,2 @@

export function jsonRequest(url: any, request: any, { requestName, correlationId, extractHeaders }?: {
requestName: any;
correlationId: any;
extractHeaders: any;
}): Promise<any>;
export function jsonRequest(url: any, request: any, { requestName, correlationId, extractHeaders }?: {}): Promise<any>;
//# sourceMappingURL=request.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc