-
Notifications
You must be signed in to change notification settings - Fork 16
Added support for ltpa token #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e4447ab
Added support for the ltpa token
enamkhan 20764ab
Fixed some lint errors
enamkhan 6ac628f
Removed unused import and variable in test
enamkhan 3d7a9a3
Some cleanup
enamkhan d754ac4
Updated changelogs
enamkhan a0a128f
Update packages/vsce/CHANGELOG.md
enamkhan c24caee
Update packages/sdk/CHANGELOG.md
enamkhan cb24efc
Update packages/sdk/src/constants/CicsCmci.constants.ts
enamkhan 1e6f2f6
Small refactor to resourceUtils
enamkhan 65fc6ae
Renamed some constants
enamkhan 48e9945
Fixes small rename error
enamkhan c33e5bf
Update packages/vsce/src/commands/disableCommands/disableTransactionC…
enamkhan aa9402c
Update packages/vsce/src/commands/openLocalFileCommand.ts
enamkhan 3917785
Some small updates
enamkhan e94059d
set tree to unauthorized on error
AndrewTwydell 2e5d9bd
Call getPlexInfo again when profile has been updated
enamkhan b970eff
Merge branch 'main' into khane-use-ltpa-token
enamkhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
90 changes: 90 additions & 0 deletions
90
packages/vsce/__tests__/__unit__/trees/CICSSessionTreeLtpa.unit.test.ts
This file contains hidden or 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,90 @@ | ||
/** | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
const getIconFilePathFromNameMock = jest.fn(); | ||
|
||
import { imperative } from "@zowe/zowe-explorer-api"; | ||
import { CICSSessionTree } from "../../../src/trees/CICSSessionTree"; | ||
|
||
jest.mock("../../../src/utils/iconUtils", () => { | ||
return { getIconFilePathFromName: getIconFilePathFromNameMock }; | ||
}); | ||
|
||
describe("Test suite for CICSSessionTree", () => { | ||
let sut: CICSSessionTree; | ||
let ses: imperative.Session; | ||
|
||
const cicsProfileMock = { | ||
failNotFound: false, | ||
message: "", | ||
name: "A NAME", | ||
profile: { | ||
host: "a.b.c.d", | ||
port: 12345, | ||
rejectUnauthorized: false, | ||
protocol: "http", | ||
user: "A USER", | ||
password: "A PASSWORD", | ||
}, | ||
type: "cics" | ||
}; | ||
|
||
describe("cookies", () => { | ||
|
||
beforeEach(() => { | ||
sut = new CICSSessionTree(cicsProfileMock); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
it("Should not store invalid cookie", () => { | ||
const cookie = { | ||
Cookie: "blah=hello" | ||
}; | ||
|
||
ses = sut.getSession(); | ||
ses.storeCookie(cookie); | ||
|
||
expect(ses.ISession.tokenType).toEqual("LtpaToken2"); | ||
expect(ses.ISession.tokenValue).toBeUndefined(); | ||
}); | ||
|
||
it("Should store valid cookie", () => { | ||
const cookies = { | ||
Cookie: "LtpaToken2=testValue" | ||
}; | ||
|
||
sut = new CICSSessionTree(cicsProfileMock); | ||
ses = sut.getSession(); | ||
|
||
ses.storeCookie(cookies); | ||
|
||
expect(ses.ISession.tokenType).toEqual("LtpaToken2"); | ||
expect(ses.ISession.tokenValue).toEqual("testValue"); | ||
}); | ||
|
||
it("Should store valid cookie if more the one returned", () => { | ||
const cookies = { | ||
Cookie: "blah=hello;LtpaToken2=testValue" | ||
}; | ||
|
||
sut = new CICSSessionTree(cicsProfileMock); | ||
ses = sut.getSession(); | ||
|
||
ses.storeCookie(cookies); | ||
|
||
expect(ses.ISession.tokenType).toEqual("LtpaToken2"); | ||
expect(ses.ISession.tokenValue).toEqual("testValue"); | ||
}); | ||
}); | ||
}); |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.