-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added support for ltpa token #219
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,6 +18,11 @@ export const CicsCmciConstants = { | |||||
*/ | ||||||
CICS_SYSTEM_MANAGEMENT: "CICSSystemManagement", | ||||||
|
||||||
/** | ||||||
* Specifies the required part of the REST interface URI to access initialization parameter | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
*/ | ||||||
CICS_SYSTEM_PARAMETER: "CICSSystemParameter", | ||||||
|
||||||
/** | ||||||
* Specifies the required part of the REST interface URI to access program definitions | ||||||
*/ | ||||||
|
@@ -38,6 +43,11 @@ export const CicsCmciConstants = { | |||||
*/ | ||||||
CICS_PROGRAM_RESOURCE: "CICSProgram", | ||||||
|
||||||
/** | ||||||
* Specifies the required part of the REST interface URI to access library resources | ||||||
*/ | ||||||
CICS_LIBRARY_RESOURCE: "CICSLibrary", | ||||||
|
||||||
/** | ||||||
* Specifies the required part of the REST interface URI to access URIMap definitions | ||||||
*/ | ||||||
|
@@ -48,6 +58,11 @@ export const CicsCmciConstants = { | |||||
*/ | ||||||
CICS_DEFINITION_WEBSERVICE: "CICSDefinitionWebService", | ||||||
|
||||||
/** | ||||||
* Specifies the required part of the REST interface URI to access tcp/ip service definitions | ||||||
*/ | ||||||
CICS_DEFINITION_TCPIPSERVICE: "CICSTCPIPService", | ||||||
|
||||||
Comment on lines
+62
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not accurate. The comment and constant name suggests definitions, but the actual resource name suggests the installed resource. Which do you need here? |
||||||
/* | ||||||
* Specifies the required part of the REST interface URI to access URIMaps | ||||||
*/ | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,9 +4,11 @@ All notable changes to the "cics-extension-for-zowe" extension will be documente | |||||
|
||||||
## Recent Changes | ||||||
|
||||||
- Enhancement:Use LTPA tokens to allow CMCI "sessions" [#217](https://github.com/zowe/cics-for-zowe-client/issues/217) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- Enhancement: Create icons for library and Web resources. [#229](https://github.com/zowe/cics-for-zowe-client/issues/229) | ||||||
|
||||||
## `3.3.3` | ||||||
|
||||||
- BugFix: Duplicate CICSplex exist when connecting to a multi-CMAS system. [#227](https://github.com/zowe/cics-for-zowe-client/issues/227) | ||||||
- Enhancement: Show CMCI error response codes when failing to make requests. [#220](https://github.com/zowe/cics-for-zowe-client/issues/220) | ||||||
|
||||||
|
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"); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure adding some constants to the package warrants a changelog entry talking about LTPA tokens. I think we should change this to be something along the lines of...