-
Notifications
You must be signed in to change notification settings - Fork 100
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
Support APIML login with PEM certificates #2802
Conversation
Co-authored-by: Andrew W. Harn <[email protected]> Signed-off-by: Timothy Johnson <[email protected]>
Co-authored-by: Andrew W. Harn <[email protected]> Co-authored-by: Trae Yelovich <[email protected]> Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Andrew Harn <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
- Added "Cancel" button to webview - Pick up existing cert paths from service profile - Perform login on submit and close webview - Error handling for dismissed/cancelled webview Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Andrew Harn <[email protected]> Co-authored-by: Timothy Johnson <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Andrew Harn <[email protected]> Co-authored-by: Timothy Johnson <[email protected]>
packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer/src/webviews/src/certificate-wizard/App.tsx
Dismissed
Show dismissed
Hide dismissed
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2802 +/- ##
=======================================
Coverage 93.46% 93.46%
=======================================
Files 103 104 +1
Lines 10763 10841 +78
Branches 2345 2276 -69
=======================================
+ Hits 10060 10133 +73
- Misses 702 707 +5
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Andrew Harn <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
- awharn wrote this test, but this was done over Live Share :) Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Andrew Harn <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]> Co-authored-by: Timothy Johnson <[email protected]> Co-authored-by: Andrew Harn <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
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.
LGTM! 😋
Not sure if we really need to update the webviews/changelog.md file. 😅
Signed-off-by: Trae Yelovich <[email protected]>
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.
Apologies for the delay.
Functionality works great!
LGTM! 😋
Here is a GIF with the behavior working as expected through a local instance of the APIML
And here are some steps that you can use to try this yourself.
Notes:
- I recommend following the APIML prereqs for running it locally
- Personally I suggest using Node 20 and Java 11
- The Gradle build and APIML startup may take around 10 minutes (or more)😋
-
git clone https://github.com/zFernand0/api-layer -b zfernand0/test/cert-login ze-cert
-
cd ze-cert
-
./gradlew build -x test
(skip running tests to speed up the process) -
npm i -g concurrently@6
-
npm run api-layer
-
Wait for the APIML Gateway to come up (navigate to https://localhost:10010)
-
Modify your config file with the following details
"host": "localhost"
"port": 10010
"basePath": "/mockzosmf/api"
"rejectUnauthorized": false
Full config? Toggle me!
{ "$schema": "./zowe.schema.json", "profiles": { "apiml": { "type": "zosmf", "properties": { "basePath": "/mockzosmf/api" }, "secure": [] }, "base": { "type": "base", "properties": { "host": "localhost", "port": 10010, "rejectUnauthorized": false }, "secure": [] } }, "defaults": { "zosmf": "apiml", "base": "base" }, "autoStore": true }
-
Add the
apiml
profile in Zowe Explorer (if not automatically added) -
Right-click on
apiml
> Manage Profile > Log In to Auth Service > Certificate -
Specify the
<ze-cert>/keystore/client_certs/newfile.crt.pem
as the certificate file -
Specify the
<ze-cert>/keystore/client_certs/newfile.key.pem
as the certificate key file
If you run into any issues, please let me know 😋
|
Proposed changes
Resolves #2621 by adding prompt to choose between "User and Password" or "Certificate" when logging in to authentication service:

When the Certificate option is selected, then a webview is opened to browse for certificate files:

Thanks @awharn and @traeok for co-authoring this 🙂
Release Notes
Milestone: 2.16.0
Changelog: Added PEM certificate support as an authentication method for logging into the API ML
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the revieweryarn workspace vscode-extension-for-zowe vscode:prepublish
has been executedFurther comments