US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Update Login Bypass Functionality for Dev Testing #6207

Open yonatan-dp opened 5 months ago

yonatan-dp commented 5 months ago

The login bypass functionality needs to be updated for new ICAM auth flow. The new ECMPS login flow for ICAM does not have a password field whereas the current login-bypass implementation requires both a user ID and a password. Need to update the bypass functionality so that it works using the new user ID only parameters.

Need to ensure that all "required" information is mocked (or uses a substitute value)

maxdiebold-erg commented 3 months ago

I have been using the bypass successfully in local development, and today I was able to process an evaluation and receive an email when setting the EASEY_CDX_BYPASS_USER_EMAIL variable.

ibarra-michelle commented 2 months ago

@yonatan-dp see my UAT comments below. FYA @esaber76 and @mark-hayward-erg

I could not verify one item in the bypass ticket, but could verify other items in this ticket.

Successful verification:

  1. Set the env var EASEY_CDX_BYPASS_ENABLED to true
  2. Set the env var EASEY_CDX_BYPASS_USERS to ["tstmibarra","thuyn-test"]
  3. When using an undefined userid, I received error message, "Unable to sign in user: Incorrect Bypass userid" image

Unsuccessful verification:

  1. I could not verify is the role assignments with the base64 encoded / decoded. I modified the mockPermissions file so I can see the assigned facilities I need for testing. However, when I am logged in, navigate to Monitoring Plan, Open & Checkout ORIS 470, Location 1, and view the configuration, I do not see the following.
  2. Checkback-in Button
  3. Revert to Official Record button
  4. Import Data button

@ntknguyen also experienced the same issue. There are two screenshots below reflecting the missing buttons:

@ibarra-michelle screenshot image

@ntknguyen screenshot image

  1. The users (tstmibarra and thuyn-test) who were whitelisted when EASEY_CDX_BYPASS_ENABLED set to true now receive an error message when EASEY_CDX_BYPASS_ENABLED set to false: image
ibarra-michelle commented 2 months ago

@yonatan-dp FYA @esaber76 @mark-hayward-erg

I tried logging into the test env with my tstmibarra userid and received error message 1. Then, I tried logging in again with the same userid and received error message 2:

Error Message 1 Image

Error Message 2 Image

yonatan-dp commented 2 months ago

@ibarra-michelle, on the missing buttons, I have identified the issue. It is caused by a user ID case mismatch (we modified ICAM related code to always use upper case per ICAM team requirements). Will make the change and try to include the update with Sprint 6 UAT deployment.

You encountered the "claims mismatch issue" in the development environment about a month ago and should have been fixed by now. This was originally caused by signing in to ECMPS dev and CDX at the same time in two different tabs. Is this the scenario that caused this? I would recommend retesting after we push all Sprint 6 ICAM changes to UAT.

I need to investigate further the error "Unable to validate access token". Was this caused during repeated logins while setting EASEY_CDX_BYPASS_ENABLED to true and/or false. If so, did you logout and login between each test?

ibarra-michelle commented 2 months ago

@ibarra-michelle, on the missing buttons, I have identified the issue. It is caused by a user ID case mismatch (we modified ICAM related code to always use upper case per ICAM team requirements). Will make the change and try to include the update with Sprint 6 UAT deployment.

- Sounds good. Is this ticket getting moved from Sprint 5 into Sprint 6 @yonatan-dp ?

You encountered the "claims mismatch issue" in the development environment about a month ago and should have been fixed by now. This was originally caused by signing in to ECMPS dev and CDX at the same time in two different tabs. Is this the scenario that caused this? I would recommend retesting after we push all Sprint 6 ICAM changes to UAT.

- I do not recall that I was logged into ECMPS and CDX at the same time yesterday and I definitely did not log into both ECMPS and CDX this morning.

I need to investigate further the error "Unable to validate access token". Was this caused during repeated logins while setting EASEY_CDX_BYPASS_ENABLED to true and/or false. If so, did you logout and login between each test?

_- While testing this ticket #6207 yesterday, I set EASEY_CDX_BYPASS_ENABLED to true once, performed UAT, then set the EASEY_CDX_BYPASS_ENABLED to false once. While performing UAT, I did log in and out out the test environment multiple times to observe the workflow and see if the buttons would appear._

ibarra-michelle commented 2 months ago

Verified in the test env:

Successful verification:

  1. Set the env var EASEY_CDX_BYPASS_ENABLED to true
  2. Set the env var EASEY_CDX_BYPASS_USERS to ["tstmibarra","thuyn-test"]
  3. When using an undefined userid, I received error message, "Unable to sign in user: Incorrect Bypass userid"
  4. Verified the the mockPermissions file and can see the assigned facilities I needed for testing.
  5. With the bypass enabled, I can navigate to Monitoring Plan, Open & Checkout ORIS 298, Location LIM1, and view the configuration, I do not see:
    • Checkback-in Button
    • Revert to Official Record button
    • Import Data button
  6. When the EASEY_CDX_BYPASS_ENABLED env variable is set back to false, users can view the configurations assigned in CBSI.