zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
173 stars 92 forks source link

ZoweExplorerZosmfApi.getSession returning undefined in cases #3337

Open JillieBeanSim opened 4 days ago

JillieBeanSim commented 4 days ago

Describe the bug

referenced in PR where sometimes getSession is returning undefined or passed undefined to new VSC Proxy method ProfilesCache.getProfileSessionWithVscProxy. This needs to be investigated and fixed as getSession should always return a zosmf session.

github-actions[bot] commented 4 days ago

Thank you for creating a bug report. We will investigate the bug and evaluate its impact on the product. If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

zFernand0 commented 9 hours ago

You might be able to use a profile like the one below to replicate the problem. If you don't have a token stored on that profile, we don't add the tokenType to the session

https://github.com/zowe/zowe-explorer-vscode/blob/main/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts#L73

Thus, we treat it as if it was using basic auth 😋

        "apiml": {
            "type": "zosmf",
            "properties": {
                "host": "lpar.dev",
                "port": 7554,
                "basePath": "/ibmzosmf/api/v1",
                "tokenType": "apimlAuthenticationToken"
            },
            "secure": [
                "tokenValue"
            ]
        },