Remove plaintext password support for api#2588
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v7.0.0 #2588 +/- ##
==================================================
- Coverage 79.70% 79.15% -0.55%
==================================================
Files 658 661 +3
Lines 50412 51740 +1328
Branches 736 735 -1
==================================================
+ Hits 40179 40953 +774
- Misses 10153 10707 +554
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jmthomas
left a comment
There was a problem hiding this comment.
Seems like a lot of terminology in the code changing from token to password and vice versa (in some places). Are you good with all the name changes? Where is the actual change to force tokens instead of passwords?
|
Sha2 is insecure and we shouldn't be using it. Change to sha256 |
The main change is moving the block marked with I feel pretty strongly about these renames. Before, |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
83a98cf to
eecd594
Compare
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
but leave it in history for posterity
Nevermind, I have managed to demoralize myself regarding this |
|
Ended up reverting everything and starting over with a much simpler approach. The original PR description still applies as-is wrt how to check this change. |
|
|
||
| def self.hash(token) | ||
| Digest::SHA2.hexdigest token | ||
| Digest::SHA256.hexdigest token |
There was a problem hiding this comment.
SHA-256 is the default algorithm for the SHA2 family in Ruby's Digest module. We decided to use SHA-256, so this code change just makes that explicit. Users won't need to reset their password.
|
back to draft, forgot to check the cli and it's broken ... also now I remember why I did it the first way the first time |
415e032 to
a1e39d6
Compare
|
Only remaining test failure is unrelated and happens on base release/v7.0.0 branch ( |
jmthomas
left a comment
There was a problem hiding this comment.
There's a blurb in the cli.md that says: "Note that you must set the OPENC3_API_PASSWORD in COSMOS Core and both the OPENC3_API_USER and OPENC3_API_PASSWORD in COSMOS Enterprise" That still holds right?
Are there any ENV vars that are now "tokens" and not passwords or are they all still passwords?
There are no no changes to the environment variables. The only time a user should have to think about tokens is if they're hitting the API directly (e.g. with |
closes #2461
Checking with CURL using a token:
and using the password: