Skip to content

Commit

Permalink
chore(deps-dev): bump madge from 6.1.0 to 8.0.0 (#4891)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump madge from 6.1.0 to 8.0.0

Bumps [madge](https://github.com/pahen/madge) from 6.1.0 to 8.0.0.
- [Changelog](https://github.com/pahen/madge/blob/master/CHANGELOG.md)
- [Commits](pahen/madge@v6.1.0...v8.0.0)

---
updated-dependencies:
- dependency-name: madge
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* transpile

* fix circular deps

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marika Marszalkowski <[email protected]>
  • Loading branch information
dependabot[bot] and marikaner authored Sep 24, 2024
1 parent 18a47ef commit 42bdc72
Show file tree
Hide file tree
Showing 14 changed files with 717 additions and 797 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"license-checker": "^25.0.1",
"madge": "^6.1.0",
"madge": "^8.0.0",
"prettier": "^3.3.3",
"puppeteer": "^23.4.0",
"semver": "^7.6.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/connectivity/src/http-agent/http-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { createLogger, last } from '@sap-cloud-sdk/util';
import type {
BasicProxyConfiguration,
Destination,
DestinationCertificate
DestinationCertificate,
HttpDestination
} from '../scp-cf';
import { getProtocolOrDefault } from '../scp-cf';
/* Careful the proxy imports cause circular dependencies if imported from scp directly */
import type { HttpDestination } from '../scp-cf/destination';
import { getProtocolOrDefault } from '../scp-cf/get-protocol';
import {
addProxyConfigurationInternet,
getProxyConfig,
proxyStrategy
} from '../scp-cf/destination';
} from '../scp-cf/destination/http-proxy-util';
import { registerDestinationCache } from '../scp-cf/destination/register-destination-cache';
import type { HttpAgentConfig, HttpsAgentConfig } from './agent-config';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createLogger } from '@sap-cloud-sdk/util';
import type { JwtPayload } from '../jsonwebtoken-type';
import { audiences, decodeJwt } from '../jwt';
import { audiences, decodeJwt } from '../jwt/jwt';
import type { ServiceCredentials } from './environment-accessor-types';
import { getServiceBindings } from './service-bindings';

Expand Down
314 changes: 0 additions & 314 deletions packages/connectivity/src/scp-cf/jwt.spec.ts

This file was deleted.

45 changes: 45 additions & 0 deletions packages/connectivity/src/scp-cf/jwt/binding.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
destinationBindingClientSecretMock,
mockServiceBindings,
signedJwt,
xsuaaBindingMock
} from '../../../../../test-resources/test/test-util';
import { decodeOrMakeJwt } from './binding';

describe('decodeOrMakeJwt', () => {
afterEach(() => {
delete process.env.VCAP_SERVICES;
});

it('returns decoded JWT, if JWT has `zid` (XSUAA)', () => {
const payload = { zid: 'test', iat: 123 };
expect(decodeOrMakeJwt(signedJwt(payload))).toEqual(payload);
});

it('returns decoded JWT, if JWT has `app_tid` (IAS)', () => {
const payload = { app_tid: 'test', iat: 123 };
expect(decodeOrMakeJwt(signedJwt(payload))).toEqual(payload);
});

it('returns undefined, if JWT has no `zid` nor `app_tid`', () => {
expect(decodeOrMakeJwt(signedJwt({ user_id: 'test' }))).toBeUndefined();
});

it('does not throw, if there is no XSUAA binding present', () => {
expect(() => decodeOrMakeJwt(undefined)).not.toThrow();
});

it("returns the XSUAA service binding's tenant ID as `zid`, if JWT is not present and binding is present", () => {
mockServiceBindings({ xsuaaBinding: true });
expect(decodeOrMakeJwt(undefined)).toEqual({
zid: xsuaaBindingMock.credentials.tenantid
});
});

it("returns the destination service binding's tenant ID, if JWT, XSUAA and identity service bindings are missing", () => {
mockServiceBindings({ xsuaaBinding: false });
expect(decodeOrMakeJwt(undefined)).toEqual({
zid: destinationBindingClientSecretMock.credentials.tenantid
});
});
});
Loading

0 comments on commit 42bdc72

Please sign in to comment.