Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Tokens #412

Merged
merged 179 commits into from
Jun 12, 2020
Merged

Tokens #412

merged 179 commits into from
Jun 12, 2020

Conversation

gejohnston
Copy link
Member

Add token handling capabilities and prompting for missing connection options.

Each round of changes were previously reviewed as PRs from other feature branches into this tokens branch.

dkelosky and others added 30 commits October 29, 2019 21:39
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
Signed-off-by: Jack (T.) Jia <jack-tiefeng.jia@ibm.com>
Signed-off-by: Jack (T.) Jia <jack-tiefeng.jia@ibm.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
[next] Use new Zowe artifactory and fix yargs vulnerability
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
* adding generic GET and PUT methods returning full response
- response can be tailored
- created needed interfaces

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* - `extractExpectedData` now returns full `client` object as default
- `getFull` and `putFull` now returns only one type, i.e. `IRestClientResponse`

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* adding methods for post and delete

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* - remove unneeded comments
- refactor according to new naming
- changed `performRest` into a wrapper for `performRestCall`
- marked `performRest` as deprecated

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* Get build to pass with latest yargs

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Get help and version commands to work with new yargs

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix undefined value error in plugin (un)install handlers

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix undefined error that was missed in plugin install handler

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Update Yargs on the other package.json files

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

* Hopefully fix cmd cli integration tests

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Make linter happy and update Keytar in test CLIs

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Simplify code to obtain command line text

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix missing keytar dep in imperative-test-cli

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Bump version to 4.4.5 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Fix unit tests for Node 12

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix integration tests for Node 12

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Update yargs to 15.1.0

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* adding few unit tests

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* add specific version regarding depreciation of
AbstractRestClient method

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* fix lint issue regarding shadowed variable

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* update unit test
switch from snapshot verification to checking if values are defined or not

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* linting again :P

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* Fix several formatting issues in web help HTML

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix script errors in Edge and print button alignment

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Remove unnecessary snapshots from tests

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix line breaks getting lost during Markdown to HTML conversion

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Bump version to 4.4.6 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Bump version to 4.4.7 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* addressing comments on PR #348
- change name from `performRestCall` to `request`
- remove useless interface `IFullResponseOptions`
- rename interface from `IOptionsFullRequest` to `IOptionsFullResponse` since it defines input options related to fullResponse expects
- added missing tydoc information
-

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* fix linting

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* update unit test following Interface name change

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* - added more unit tests
- moved deprecation message to the top
- updated all restClient methods to call .request() instead of .performRest()

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* remove unnecessary comments

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* skipped a few comments :(
hopefully this time all are gone

Signed-off-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>

* Update Jenkinsfile

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

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Add missing colon.

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

* Bump version to 4.5.0 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Mirror master branch to zowe-v1-lts

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Exported IRestOptions in packages/rest/index.ts

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Made the new changes

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Changed the type of symlink from dir to junction

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Resolved the error

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Revert "Resolved the error"

This reverts commit ae326ef.

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Resolved the type of symlink

Signed-off-by: Megha Kumari <meghajais.mj@hotmail.com>

* Don't load secure profile fields when deleting profile

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Allow specifying secure values as optional to ignore when they are missing

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Add unit tests around loading optional secure fields

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Bump version to 4.5.1 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Bump version to 4.5.2 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Update changelog for zowe-v1-lts

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Update contribution guidelines

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Fix breaking change listed in changelog for v4

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* fixed alignment

Signed-off-by: mheuzey <michael.heuzey@gmail.com>

* Add changelog automation

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

* Updating dependencies [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Bump version to 4.5.3 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Fix vulnerabilities and remove unnecessary mkdirp dependency

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Update package-lock and remove for test CLIs

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Update changelog

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Remove lines parameter for changelog stages in pipeline

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Remove lines parameter for changelog stages in pipeline

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>

* Bump version to 4.5.4 [ci skip]

Signed-off-by: zowe-robot <zowe.robot@gmail.com>

* Update Changelog [ci skip]

Co-authored-by: Alexandru-Paul Dumitru <alexandru.dumitru@broadcom.com>
Co-authored-by: Andrew W. Harn <andrew.harn@broadcom.com>
Co-authored-by: zowe-robot <zowe.robot@gmail.com>
Co-authored-by: Fernando Rijo Cedeno <fernando.rijocedeno@broadcom.com>
Co-authored-by: Megha Kumari <meghajais.mj@hotmail.com>
Co-authored-by: mheuzey <michael.heuzey@gmail.com>

Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
Signed-off-by: zowe-robot <zowe.robot@gmail.com>
t1m0thyj and others added 13 commits June 10, 2020 13:00
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: BrandonJenkins14 <36675406+BrandonJenkins14@users.noreply.github.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
Implement UX changes for tokens
that were used to enable zowe-cli to build with an unpublished imperative..

Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
@gejohnston gejohnston requested review from awharn, dkelosky, a user and zFernand0 June 11, 2020 20:02
@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #412 into master will increase coverage by 0.58%.
The diff coverage is 90.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     zowe/imperative#412      +/-   ##
==========================================
+ Coverage   81.02%   81.61%   +0.58%     
==========================================
  Files         150      157       +7     
  Lines        7241     7635     +394     
  Branches     1286     1378      +92     
==========================================
+ Hits         5867     6231     +364     
- Misses       1370     1400      +30     
  Partials        4        4              
Impacted Files Coverage Δ
...imperative/src/plugins/PluginManagementFacility.ts 92.77% <ø> (ø)
...e/src/plugins/utilities/npm-interface/uninstall.ts 93.10% <ø> (ø)
...ive/src/profiles/handlers/CreateProfilesHandler.ts 5.26% <ø> (ø)
...es/imperative/src/auth/handlers/BaseAuthHandler.ts 67.10% <67.10%> (ø)
packages/rest/src/client/AbstractRestClient.ts 79.74% <81.81%> (+0.08%) ⬆️
packages/utilities/src/CliUtils.ts 84.37% <82.05%> (-0.89%) ⬇️
packages/cmd/src/profiles/CliProfileManager.ts 96.05% <83.33%> (+0.03%) ⬆️
packages/imperative/src/DefinitionTreeResolver.ts 95.34% <90.90%> (-1.80%) ⬇️
packages/cmd/src/profiles/CommandProfileLoader.ts 97.93% <92.30%> (-0.89%) ⬇️
packages/cmd/src/CommandPreparer.ts 96.82% <93.75%> (-0.35%) ⬇️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12fe1c4...23ed18f. Read the comment docs.

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.

Overall looks great!
Left a few comments but nothing that needs addressed here.

CHANGELOG.md Show resolved Hide resolved
package.json Show resolved Hide resolved
packages/cmd/src/CommandProcessor.ts Show resolved Hide resolved
packages/rest/src/session/AbstractSession.ts Show resolved Hide resolved
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Looks good overall! Left a few comments, nothing that necessarily needs to be changed.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
} else {
throw new ImperativeError({
msg: "Must have user & password OR base64 encoded credentials",
additionalDetails: "For CLI usage, see '<your-cli> auth login <service> --help'"
Copy link

Choose a reason for hiding this comment

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

This message makes sense below where the session type is SessConstants.AUTH_TYPE_TOKEN. In this case when session type is SessConstants.AUTH_TYPE_BASIC, should the message be changed to the following?
For CLI usage, see '<your-cli> profiles create <service> --help'

Copy link
Member

Choose a reason for hiding this comment

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

I agree that the message should be changed to something that deals with basic auth. That looks good to me, but we may want to quickly see what doc or UX think.

t1m0thyj and others added 4 commits June 12, 2020 10:11
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 12, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 2 Security Hotspots to review)
Code Smell A 0 Code Smells

84.9% 84.9% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_212) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

Copy link
Member

@awharn awharn left a comment

Choose a reason for hiding this comment

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

Looks good to me, once the comments above are resolved.

@gejohnston gejohnston merged commit be08769 into master Jun 12, 2020
@gejohnston gejohnston deleted the tokens branch June 12, 2020 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants