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

[VI-468] Add mhv_user_account to User #18552

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[VI-468] Add mhv_user_account to User #18552

wants to merge 1 commit into from

Conversation

rileyanderson
Copy link
Contributor

Summary

  • add mhv_user_account to User. Calls MHV::UserAccount::Creator
  • This will on populate a user has:
    • va_treatment_facility_ids
    • icn
    • credential_email
    • accepted current terms_of_use_agreement

Related issue(s)

Testing

  • add conn.request :curl to the mhv account_creation service connection

    def connection
       Faraday.new(base_path, headers: base_request_headers, request: request_options) do |conn|
         conn.use :breakers
         conn.use Faraday::Response::RaiseError
         conn.adapter Faraday.default_adapter
         conn.request :curl
         conn.response :json
         conn.response :betamocks if Settings.mhv.account_creation.mock
       end
     end
  • Start vets-api and vets-website

  • Login with a user that is a va_patient. - vets.gov.user+1 works

  • Accept terms if you haven't already

  • Find the lgoingov_uuid or idme_uuid of the user you logged in with - http://localhost:3000/v0/user

  • in the rails console, find the User and call mhv_user_account

    user = User.find({logingov_uuid of idme_uuid}}
    user.mhv_user_account

    This wont work since this is only reachable on staging.
    You should see the curl request logged and some other logs about the attempted request

    Rails -- [MHV][AccountCreation][Service] sts token request success -- { :user_identifier => "1008596379V859838" }
    WARN -- : curl -v -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'User-Agent: Vets.gov Agent' -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3...' -H 'x-api-key: some-access-key' -d '{"icn":"1008596379V859838","email":"vets.gov.user+1@gmail.com","vaTermsOfUseDateTime":"2024-05-14T15:29:19Z","vaTermsOfUseStatus":"accepted","vaTermsOfUseRevision":"3","vaTermsOfUseLegalVersion":"1.0","vaTermsOfUseDocTitle":"VA Enterprise Terms of Use"}' "https://apigw-intb.aws.myhealth.va.gov/v1/usermgmt/account-service/account"
    Rails -- [MHV][AccountCreation][Service] create_account client_error -- { :error_message => "Failed to open TCP connection to apigw-intb.aws.myhealth.va.gov:443 (getaddrinfo: nodename nor servname provided, or not known)", :body => nil, :icn => "1008596379V859838" }
    Rails -- [MHV][UserAccount][Creator] client error -- { :error_message => "Failed to open TCP connection to apigw-intb.aws.myhealth.va.gov:443 (getaddrinfo: nodename nor servname provided, or not known)", :icn => "1008596379V859838" }
    Rails -- [User] mhv_user_account error -- { :error_message => "Failed to open TCP connection to apigw-intb.aws.myhealth.va.gov:443 (getaddrinfo: nodename nor servname provided, or not known)", :icn => "1008596379V859838" }

Screenshots

Note: Optional

What areas of the site does it impact?

User, MHVUserAccount

Copy link
Contributor

@emilykim13 emilykim13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed your testing steps, lgtm!

Copy link

Backend-review-group approval confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants