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

Tokens #399

Closed
wants to merge 103 commits into from
Closed

Tokens #399

wants to merge 103 commits into from

Conversation

gejohnston
Copy link
Member

Implemented the infrastructure to enable CLI commands to process tokens.

  • Modified AbstractSession.buildSession() to use a token for authentication if a token is present in the underlying REST session configuration object.
  • Added a new CredsForSessCfg.addCredsOrPrompt function that places credentials (including a possible token) into a session configuration object.
    • Credentials are obtained from the command line, environment variables, or a profile.
    • If no credentials are available, it will prompt for a user name and password.
    • Any prompt will timeout after 30 seconds so that it will not hang an automated script.
  • All commands will automatically benefit from token handling.
  • Only commands that convert to CredsForSessCfg.addCredsOrPrompt() will benefit from prompting for user name and password.

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>
Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
@@ -10,6 +10,7 @@
"coverageReporters": [
"json",
"lcov",
"html",
Copy link
Contributor

Choose a reason for hiding this comment

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

@zFernand0

This proposed change gives this on npm run test:unit --coverage:

image

Copy link
Contributor

Choose a reason for hiding this comment

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

ok im crazy - ill revert this

Signed-off-by: Dan Kelosky <dkelosky@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented May 18, 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.5% 84.5% Coverage
0.0% 0.0% Duplication

gejohnston and others added 25 commits May 18, 2020 19:19
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
It impacts tests.

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>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@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: 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: 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: 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: Andrew W. Harn <andrew.harn@broadcom.com>
@gejohnston gejohnston closed this May 20, 2020
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.

7 participants