-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps-dev): bump madge from 6.1.0 to 8.0.0 (#4891)
* 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
1 parent
18a47ef
commit 42bdc72
Showing
14 changed files
with
717 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/connectivity/src/scp-cf/environment-accessor/service-credentials.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.