-
Notifications
You must be signed in to change notification settings - Fork 51
cleanup credentials #846
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
cleanup credentials #846
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
==========================================
+ Coverage 72.25% 72.27% +0.01%
==========================================
Files 471 471
Lines 31074 31069 -5
Branches 877 877
==========================================
+ Hits 22452 22454 +2
+ Misses 8528 8522 -6
+ Partials 94 93 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
SonarCloud Quality Gate failed.
|
OPENC3_REDIS_PASSWORD: "${OPENC3_REDIS_PASSWORD}" | ||
OPENC3_BUCKET_USERNAME: "${OPENC3_BUCKET_USERNAME}" | ||
OPENC3_BUCKET_PASSWORD: "${OPENC3_BUCKET_PASSWORD}" | ||
OPENC3_SERVICE_PASSWORD: "${OPENC3_SERVICE_PASSWORD}" | ||
env_file: | ||
- ".env" |
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.
Who wins: environment
or env_file
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.
@@ -53,7 +53,7 @@ def _generate_url(microservice_name:, prefix:, schema: 'http', hostname: nil, po | |||
# generate the auth object | |||
def _generate_auth | |||
if ENV['OPENC3_API_TOKEN'].nil? and ENV['OPENC3_API_USER'].nil? | |||
if ENV['OPENC3_API_PASSWORD'] || ENV['OPENC3_SERVICE_PASSWORD'] | |||
if ENV['OPENC3_API_PASSWORD'] |
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.
ENV['OPENC3_SERVICE_PASSWORD']
was never used right?
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.
Not really... at least it shouldn't have been.
return true if @@service_token_cache == token_hash and permission != 'admin' | ||
# Handle a service password - Generally only used by ScriptRunner | ||
service_password = ENV['OPENC3_SERVICE_PASSWORD'] | ||
return true if service_password and service_password == token and permission != 'admin' |
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.
What was the point of the previous cache and how it is now removed?
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.
This previous code was dumb. It should have just been comparing cleartext versions and not bothering with a hash.
No description provided.