Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"packages/generator-common",
"packages/temporal-de-serializers",
"packages/resilience",
"test-resources/test/test-util",
"test-packages/integration-tests",
"test-packages/e2e-tests",
"test-packages/test-services-odata-common",
Expand Down
1 change: 1 addition & 0 deletions packages/connectivity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"jsonwebtoken": "^9.0.3"
},
"devDependencies": {
"@sap-cloud-sdk/test-util-shared": "*",
"mock-fs": "^5.5.0",
"nock": "^14.0.11",
"typescript": "~5.9.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/src/http-agent/http-agent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jest.mock('jks-js', () => ({
toPem: jest.fn()
}));
import * as jks from 'jks-js';
import { certAsString } from '@sap-cloud-sdk/test-util-shared/test-certificate';
import { registerDestinationCache } from '../scp-cf/destination/register-destination-cache';
import { certAsString } from '../../../../test-resources/test/test-util/test-certificate';
import { getAgentConfig } from './http-agent';
import type { HttpDestination } from '../scp-cf/destination';
import type { DestinationCertificate } from '../scp-cf';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createLogger } from '@sap-cloud-sdk/util';
import {
defaultBasicCredentials,
defaultDestination
} from '../../../../test-resources/test/test-util/request-mocker';
} from '@sap-cloud-sdk/test-util-shared/request-mocker';
import { buildAuthorizationHeaders } from './authorization-header';
import * as destinationImport from './destination/destination';
import type { Destination } from './destination';
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity/src/scp-cf/circuit-breaker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
destinationServiceUri,
providerXsuaaUrl,
xsuaaBindingMock
} from '../../../../test-resources/test/test-util/environment-mocks';
import { privateKey } from '../../../../test-resources/test/test-util/keys';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import { privateKey } from '@sap-cloud-sdk/test-util-shared/keys';
import { getClientCredentialsToken } from './xsuaa-service';
import { fetchDestinationWithTokenRetrieval } from './destination';

Expand Down
8 changes: 4 additions & 4 deletions packages/connectivity/src/scp-cf/connectivity-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import {
connectivityProxyConfigMock,
connectivitySocksProxyConfigMock,
mockServiceBindings
} from '../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
providerServiceToken,
providerUserToken,
subscriberServiceToken,
subscriberUserToken
} from '../../../../test-resources/test/test-util/mocked-access-tokens';
import { mockServiceToken } from '../../../../test-resources/test/test-util/token-accessor-mocks';
import { mockClientCredentialsGrantCall } from '../../../../test-resources/test/test-util/xsuaa-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import { mockServiceToken } from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import { mockClientCredentialsGrantCall } from '@sap-cloud-sdk/test-util-shared/xsuaa-service-mocks';
import {
addProxyConfigurationOnPrem,
httpProxyHostAndPort
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { decodeJwt } from '../jwt';
import {
mockServiceBindings,
onlyIssuerXsuaaUrl,
testTenants
} from '../../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
expectAllMocksUsed,
mockJwtBearerToken,
mockServiceToken
} from '../../../../../test-resources/test/test-util/token-accessor-mocks';
} from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import {
mockFetchDestinationCalls,
mockFetchDestinationCallsNotFound
} from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import {
onlyIssuerServiceToken,
providerUserToken,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import {
basicMultipleResponse,
certificateSingleResponse,
Expand All @@ -34,7 +33,8 @@ import {
onPremiseBasicSingleResponse,
onPremisePrincipalPropagationMultipleResponse,
samlAssertionSingleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import { decodeJwt } from '../jwt';
import { clientCredentialsTokenCache } from '../client-credentials-token-cache';
import { parseDestination } from './destination';
import { getDestination } from './destination-accessor';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import {
mockServiceBindings,
xsuaaBindingMock
} from '../../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import {
mockJwtBearerToken,
mockServiceToken
} from '../../../../../test-resources/test/test-util/token-accessor-mocks';
} from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import {
mockFetchDestinationCalls,
mockFetchDestinationCallsNotFound,
mockInstanceDestinationsCall,
mockSubaccountDestinationsCall
} from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import {
basicMultipleResponse,
destinationName,
oauthMultipleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import {
getAllDestinationsFromDestinationService,
getDestination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
mockServiceToken,
oauthMultipleResponse,
providerServiceToken
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import { alwaysProvider } from './destination-selection-strategies';
import { getDestination } from './destination-accessor';
import type { DestinationFetchOptions } from './destination-accessor-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { mockServiceBindings } from '../../../../../test-resources/test/test-util';
import { mockServiceBindings } from '@sap-cloud-sdk/test-util-shared';
import { getDestination, useOrFetchDestination } from './destination-accessor';
import { registerDestination } from './destination-from-registration';
import { registerDestinationCache } from './register-destination-cache';
import type { DestinationWithName } from './destination-from-registration';
import type { MockServiceBindings } from '../../../../../test-resources/test/test-util';
import type { MockServiceBindings } from '@sap-cloud-sdk/test-util-shared';

function mockEnvDestinations() {
process.env['destinations'] = JSON.stringify([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import {
mockFetchDestinationCallsNotFound,
mockInstanceDestinationsCall,
mockSubaccountDestinationsCall
} from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import {
destinationServiceUri,
onlyIssuerXsuaaUrl,
mockServiceBindings
} from '../../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
basicMultipleResponse,
certificateSingleResponse,
destinationName,
samlAssertionMultipleResponse,
samlAssertionSingleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import {
onlyIssuerServiceToken,
providerServiceToken,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
import { mockServiceToken } from '../../../../../test-resources/test/test-util/token-accessor-mocks';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import { mockServiceToken } from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import * as tokenAccessor from '../token-accessor';
import { decodeJwt } from '../jwt';
import { identityServicesCache } from '../environment-accessor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ import axios from 'axios';
import {
connectivityProxyConfigMock,
mockServiceBindings
} from '../../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
mockJwtBearerToken,
mockServiceToken
} from '../../../../../test-resources/test/test-util/token-accessor-mocks';
} from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import {
mockCertificateCall,
mockFetchDestinationCalls
} from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import {
providerServiceToken,
providerUserToken,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import {
basicMultipleResponse,
onPremisePrincipalPropagationMultipleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import { getDestination } from './destination-accessor';
import * as ProxyUtil from './http-proxy-util';
import { alwaysProvider } from './destination-selection-strategies';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { createLogger } from '@sap-cloud-sdk/util';
import nock from 'nock';
import { decodeJwt } from '../jwt';
import {
mockFetchDestinationCalls,
mockFetchDestinationCallsNotFound
} from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import {
connectivityProxyConfigMock,
mockServiceBindings,
onlyIssuerXsuaaUrl,
testTenants,
uaaDomain
} from '../../../../../test-resources/test/test-util/environment-mocks';
} from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import {
certificateSingleResponse,
destinationName,
oauthSingleResponse,
onPremisePrincipalPropagationMultipleResponse,
samlAssertionSingleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import {
providerServiceToken,
providerUserToken,
providerUserPayload,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
import { TestCache } from '../../../../../test-resources/test/test-util/test-cache';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import { TestCache } from '@sap-cloud-sdk/test-util-shared/test-cache';
import {
mockJwtBearerToken,
mockServiceToken
} from '../../../../../test-resources/test/test-util/token-accessor-mocks';
} from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import { decodeJwt } from '../jwt';
import { destinationServiceCache } from './destination-service-cache';
import {
alwaysProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { createLogger } from '@sap-cloud-sdk/util';
import {
mockDestinationsEnv,
unmockDestinationsEnv
} from '../../../../../test-resources/test/test-util/request-mocker';
import { signedJwt } from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared/request-mocker';
import { signedJwt } from '@sap-cloud-sdk/test-util-shared';
import {
getDestinationFromEnvByName,
getDestinationsFromEnv,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
subscriberUserToken,
unmockDestinationsEnv,
xsuaaBindingMock
} from '../../../../../test-resources/test/test-util';
import { certAsString } from '../../../../../test-resources/test/test-util/test-certificate';
} from '@sap-cloud-sdk/test-util-shared';
import { certAsString } from '@sap-cloud-sdk/test-util-shared/test-certificate';
import {
registerDestination,
searchRegisteredDestination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
mockServiceToken,
mockFetchDestinationCalls,
providerServiceToken
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import { getDestinationFromDestinationService } from './destination-from-service';

describe('getDestinationFromDestinationService', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
mockServiceToken,
providerUserToken,
signedJwt
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import * as xsuaaService from '../xsuaa-service';
import * as identityService from '../identity-service';
import { clientCredentialsTokenCache } from '../client-credentials-token-cache';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import nock from 'nock';
import { mockServiceBindings } from '../../../../../test-resources/test/test-util/environment-mocks';
import { mockServiceToken } from '../../../../../test-resources/test/test-util/token-accessor-mocks';
import { mockServiceBindings } from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import { mockServiceToken } from '@sap-cloud-sdk/test-util-shared/token-accessor-mocks';
import {
providerServiceToken,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util/mocked-access-tokens';
import { mockSubaccountDestinationsCall } from '../../../../../test-resources/test/test-util/destination-service-mocks';
} from '@sap-cloud-sdk/test-util-shared/mocked-access-tokens';
import { mockSubaccountDestinationsCall } from '@sap-cloud-sdk/test-util-shared/destination-service-mocks';
import { decodeJwt } from '../jwt';
import { destinationServiceCache } from './destination-service-cache';
import { fetchDestinations } from './destination-service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import nock from 'nock';
import * as resilienceMethods from '@sap-cloud-sdk/resilience/internal';
import { circuitBreakers } from '@sap-cloud-sdk/resilience/internal';
import axios from 'axios';
import { mockCertificateCall } from '../../../../../test-resources/test/test-util';
import { destinationServiceUri } from '../../../../../test-resources/test/test-util/environment-mocks';
import { privateKey } from '../../../../../test-resources/test/test-util/keys';
import { mockCertificateCall } from '@sap-cloud-sdk/test-util-shared';
import { destinationServiceUri } from '@sap-cloud-sdk/test-util-shared/environment-mocks';
import { privateKey } from '@sap-cloud-sdk/test-util-shared/keys';
import { parseDestination } from './destination';
import {
fetchCertificate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
basicMultipleResponse,
certificateMultipleResponse,
certificateSingleResponse
} from '../../../../../test-resources/test/test-util/example-destination-service-responses';
} from '@sap-cloud-sdk/test-util-shared/example-destination-service-responses';
import {
noDestinationErrorMessage,
parseDestination,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createLogger } from '@sap-cloud-sdk/util';
import { signedJwt } from '../../../../../test-resources/test/test-util';
import { signedJwt } from '@sap-cloud-sdk/test-util-shared';
import { setForwardedAuthTokenIfNeeded } from './forward-auth-token';

describe('forward auth token', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
onlyIssuerXsuaaUrl,
subscriberServiceToken,
subscriberUserToken
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import * as tokenAccessor from '../token-accessor';
import { getJwtPair } from '../jwt';
import { getSubscriberToken } from './get-subscriber-token';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { X509Certificate } from 'node:crypto';
import mock from 'mock-fs';
import { createLogger } from '@sap-cloud-sdk/util';
import { certAsString } from '../../../../../test-resources/test/test-util/test-certificate';
import { certAsString } from '@sap-cloud-sdk/test-util-shared/test-certificate';
import { registerDestinationCache } from './register-destination-cache';

const { mtls, destination } = registerDestinationCache;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { signedJwt } from '../../../../../test-resources/test/test-util';
import { signedJwt } from '@sap-cloud-sdk/test-util-shared';
import {
identityServicesCache,
getIdentityServiceInstanceFromCredentials
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/src/scp-cf/identity-service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { signedJwt } from '../../../../test-resources/test/test-util';
import { signedJwt } from '@sap-cloud-sdk/test-util-shared';
import {
getIasToken,
shouldExchangeToken,
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/src/scp-cf/jwt/binding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
mockServiceBindings,
signedJwt,
xsuaaBindingMock
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import { decodeOrMakeJwt } from './binding';

describe('decodeOrMakeJwt', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/src/scp-cf/jwt/jwt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Socket } from 'net';
import {
mockServiceBindings,
signedJwtForVerification
} from '../../../../../test-resources/test/test-util';
} from '@sap-cloud-sdk/test-util-shared';
import { audiences, decodeJwt, isXsuaaToken, retrieveJwt, userId } from './jwt';

describe('jwt', () => {
Expand Down
Loading
Loading