Skip to content
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

498 http support #909

Merged
merged 15 commits into from Mar 3, 2021
Merged

498 http support #909

merged 15 commits into from Mar 3, 2021

Conversation

AndrewTwydell
Copy link
Contributor

Resolves #498

This PR implements a --protocol or -o flag to specify either http or https as a protocol. The default is still https.

Imperative already supports a session including a protocol option and defaults it to https if not supplied. This PR sets the protocol parameter when the ISession is created.

Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
Signed-off-by: AndrewTwydell <u1858490@unimail.hud.ac.uk>
@AndrewTwydell
Copy link
Contributor Author

AndrewTwydell commented Jan 20, 2021

Do I need to update the Changelog in the Zosmf package for this PR?

I've updated the CLI package Changelog as a new flag has been added, but the unchanged zosmf changelog is preventing the build from being successful.

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I know this probably doesn't concern this PR, but should we try to expose the protocol in the Imperative AbstractRestClient Error messages (now that it's available)?
See zowe/imperative#539 for updates on the AbstractRestClient error details.

…tp-support

Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>

# Conflicts:
#	packages/cli/CHANGELOG.md
Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
zFernand0 and others added 3 commits February 11, 2021 10:49
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@awharn awharn requested a review from t1m0thyj March 2, 2021 13:59
Comment on lines 121 to 127
public static ZOSMF_OPTION_PROTOCOL: ICommandOptionDefinition = {
name: "protocol",
aliases: ["o"],
description: "The protocol used (HTTP or HTTPS)",
type: "string",
group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
};
Copy link
Member

@t1m0thyj t1m0thyj Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should "http" and "https" be defined as the only allowed values for the --protocol command option?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a problem in doing so. 😋

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙂

Forgot when I reviewed earlier that CICS plugin also has defaultValue: "https" defined on the command option definition for protocol 😢

Perhaps we should do the same, but I'm ok with this being merged as is - the defaultValue property doesn't seem important since the behavior behind the scenes is the same (HTTPS is the default for ZosmfSession).

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding defaultValue and good catch on the potential breaking change 😛

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -156,7 +171,8 @@ export class ZosmfSession {
user: profile.user,
password: profile.password,
rejectUnauthorized: profile.rejectUnauthorized,
basePath: profile.basePath
basePath: profile.basePath,
protocol: profile.protocol ? profile.protocol.toLowerCase() : 'https'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for preventing any strange behavior with the old method 😋

Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Mar 3, 2021

@zFernand0 zFernand0 merged commit 3d75547 into master Mar 3, 2021
@zFernand0 zFernand0 deleted the 498-http-support branch March 3, 2021 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The zowe CLI does not honor the environment variables http_proxy nor https:proxy
4 participants