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

[MHV-61858] adjust headers to include api key #20381

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[MHV-61858] adjust headers to include api key
  • Loading branch information
vsaleem committed Jan 21, 2025
commit e99ca6e5db9b5ee927c7d2e6888ed6122d8aa973
8 changes: 6 additions & 2 deletions lib/common/client/concerns/mhv_session_based_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@
end

def auth_headers
config.base_request_headers.merge('appToken' => config.app_token, 'mhvCorrelationId' => session.user_id.to_s)
end
config.base_request_headers.merge({
'appToken' => config.app_token,

Check failure on line 70 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.

Check failure on line 70 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/TrailingWhitespace: Trailing whitespace detected.
'mhvCorrelationId' => session.user_id.to_s,
'x-api-key': Settings.mhv.sm.mhv_sm_x_api_key,

Check failure on line 72 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
})

Check failure on line 73 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/FirstHashElementIndentation: Indent the right brace the same as the first position after the preceding left parenthesis.

Check failure on line 73 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/TrailingWhitespace: Trailing whitespace detected.
end

Check failure on line 74 in lib/common/client/concerns/mhv_session_based_client.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/DefEndAlignment: `end` at 74, 6 is not aligned with `def` at 68, 8.
end
end
end
Expand Down
8 changes: 8 additions & 0 deletions lib/sm/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@
Settings.mhv.sm.app_token
end

##
# @return [String] API key for AWS API Gateway
#
def x_api_key
Settings.mhv.sm.mhv_sm_x_api_key
end


Check failure on line 32 in lib/sm/configuration.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/EmptyLines: Extra blank line detected.
##
# @return [String] Base path for dependent URLs
#
def base_path

Check failure on line 36 in lib/sm/configuration.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
"#{Settings.mhv.sm.host}/mhv-sm-api/patient/v1/"
end

Expand Down
1 change: 1 addition & 0 deletions spec/support/vcr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
c.filter_sensitive_data('<MHV_MR_X_AUTH_KEY>') { Settings.mhv.medical_records.x_auth_key }
c.filter_sensitive_data('<MHV_MR_APP_TOKEN>') { Settings.mhv.medical_records.app_token }
c.filter_sensitive_data('<MHV_X_API_KEY>') { Settings.mhv.medical_records.mhv_x_api_key }
c.filter_sensitive_data('<MHV_SM_X_API_KEY>') { Settings.mhv.sm.mhv_sm_x_api_key }
c.filter_sensitive_data('<MHV_SM_APP_TOKEN>') { Settings.mhv.sm.app_token }
c.filter_sensitive_data('<MHV_SM_HOST>') { Settings.mhv.sm.host }
c.filter_sensitive_data('<MPI_URL>') { Settings.mvi.url }
Expand Down
Loading