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

Allow secure credentials to be enabled in Theia #2218

Merged
merged 10 commits into from
Apr 17, 2023

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Mar 31, 2023

Proposed changes

Fixed secure credential storage not possible to enable in Theia. It remains disabled by default in Theia where support for secure storage is limited.

Also improved error handling for the ProfilesUtils.initializeZoweProfiles method. This is a follow up to #2188 to include some fixes that were missed. Moved some of the ProfilesUtils methods into a static class to make them easier to test.

Release Notes

Milestone: 2.8.0

Changelog: Fixed secure credential storage not possible to enable in Theia.

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

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 reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Patch coverage: 96.21% and project coverage change: -0.01 ⚠️

Comparison is base (5f8def3) 91.53% compared to head (e615b82) 91.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2218      +/-   ##
==========================================
- Coverage   91.53%   91.53%   -0.01%     
==========================================
  Files          89       89              
  Lines        8864     8880      +16     
  Branches     1829     1837       +8     
==========================================
+ Hits         8114     8128      +14     
- Misses        749      751       +2     
  Partials        1        1              
Impacted Files Coverage Δ
packages/zowe-explorer/src/utils/ProfilesUtils.ts 88.10% <95.28%> (+0.37%) ⬆️
packages/zowe-explorer/src/Profiles.ts 82.35% <100.00%> (ø)
packages/zowe-explorer/src/ZoweExplorerExtender.ts 86.36% <100.00%> (-0.45%) ⬇️
packages/zowe-explorer/src/extension.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/globals.ts 96.37% <100.00%> (ø)
packages/zowe-explorer/src/shared/init.ts 99.27% <100.00%> (ø)
packages/zowe-explorer/src/utils/SettingsConfig.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj added this to the v2.8.0 milestone Apr 5, 2023
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj marked this pull request as ready for review April 6, 2023 12:19
@t1m0thyj
Copy link
Member Author

t1m0thyj commented Apr 6, 2023

After further testing, it seems like the "Secure Credentials Enabled" setting is always enforced when v2 config with "secure" arrays is present. This behavior is the same whether in VS Code or in Theia.

I think this PR is still a good change, to avoid forcing the setting to always be false. If we want to disallow loading secure credentials when "Secure Credentials Enabled" is false, that would require code changes in Imperative and I would suggest that it be a separate effort.

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
zFernand0
zFernand0 previously approved these changes Apr 16, 2023
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
JillieBeanSim
JillieBeanSim previously approved these changes Apr 17, 2023
Copy link
Contributor

@JillieBeanSim JillieBeanSim 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 @t1m0thyj for the fix

zFernand0
zFernand0 previously approved these changes Apr 17, 2023
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj dismissed stale reviews from zFernand0 and JillieBeanSim via e615b82 April 17, 2023 18:19
@sonarcloud
Copy link

sonarcloud bot commented Apr 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@JillieBeanSim JillieBeanSim self-requested a review April 17, 2023 18:37
@JillieBeanSim JillieBeanSim merged commit b67117b into main Apr 17, 2023
@JillieBeanSim JillieBeanSim deleted the fix/secure-credentials-theia branch April 17, 2023 18:38
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.

3 participants