Skip to content

Deployment to production: patch for 1.008#1545

Closed
gemfarmer wants to merge 67 commits intostages/prodfrom
stages/rc-2017-07-10-patch-3
Closed

Deployment to production: patch for 1.008#1545
gemfarmer wants to merge 67 commits intostages/prodfrom
stages/rc-2017-07-10-patch-3

Conversation

@gemfarmer
Copy link
Copy Markdown
Contributor

Deploy patch to production for 1.008. These changes will also be part 1.009.

Changes include:

zachmargolis and others added 30 commits June 14, 2017 09:11
**Why**: The URL changed
Update link to Help Center question
**Why**: When a user reactivates their account, the personal key
entry and re encryption of pii are being split out into separate steps

Add personal key form partial, new form, alert

**Why**: The personal key input form is separate from the rest
of the presentation. Required for the new personal key entry
form.  Added an excalaimation point in the alert notice to match
designs and other alert messages

Adds verify password class and emphemera

**Why**: We are splitting out the account reactivation flow, which
requires an additional controller, shared views, new tests and routes

Removes old account reactivation files

**Why**: The flow isn't the same and these files are uneeded

Spec updates, manage_reactivate to reactivate

**Why**: The old account reactivation code was removed, so we can safely
move manage_reactivate_account to reactivate_account
Break account reactivation into two-step process
Updated the help copy after user changes their password.
Updated intro for password reset
**Why**: A bug was discovered where an OIDC Service Provider's
configuration included attributes that are only meant for SAML,
namely `assertion_consumer_logout_service_url`. That attribute was
set to an empty string, but the logic in
`SingleLogoutHandler#slo_not_implemented_at_sp?` was checking for
`nil?` only, which caused `SamlIdpController#logout` to proceed all the
way to call `generate_slo_request` with a nil URL (instead of
returning early at `finish_slo_at_idp`), which resulted in an
exception in `SecureHeadersWhitelister.extract_domain` due to the `nil`
URL.

**How**: In addition to the empty SAML attribute, reproducing this bug
also requires that the user have an active identity with the OIDC SP.
In SAML, identities get deactivated during the logout process, but
OIDC identities remain active (which could be another bug).
This is why the spec signs the user in fully to the SP first to create
the identity, then signs out, then signs in again, but cancels the
sign in process on the 2FA screen.

Using `blank?` instead of `nil?` fixes the bug.
Improve defensiveness of logout logic
Updated intro for password reset
**Why**: During UAT testing with Equifax, we came across some ID
verification issues, some of which required changes to the equifax
gem, and some of which required changes to the IdP code.

**How**:
- Remove extra analytics attributes for vendor reasons in the Financials
and Phone steps because Equifax does not return any reasons for those
verifications.
- Update `vendor_params` so that all keys are Strings for consistency
- Update equifax gem to latest commit on master
Update IdV to work with Equifax
**Why**: Saving invalid forms to the database causes errors
**Why**: To avoid validating the request twice.

By validating earlier in the process (with `validate_authorize_form`),
we know that once it reaches the `index` action, it is valid. If it is
not valid, it will never reach the `index` action. This means we don't
need to validate the request both in the form's `check_submit` and
`submit` methods.

We can remove the `check_submit` method and modify the existing
`submit` method to only validate and return the FormResponse, and link
the identity in the `index` action once the user has signed in.

This is consistent with what we do with SAML: First we validate the
SAML request, and if it's valid, then we proceed to the auth action,
and once the user is fully authenticated, we link the identity.

Bonus points: This fixes the ABC complexity offense of the `index`
method.
Handle invalid OIDC requests before persisting
**Why**: Unused code does not belong in the repo, and it's affecting
our test coverage metrics. Code Climate says none of this file is being
hit when running the test suite.
**Why**: The user should know that they must reactivate their account
following a password reset. Using a modal to provide 'heads up'
information matches our current UX. A fallback alert message is also
provided when JS is disabled

Spec changes

**Why**: Satisfy PR feedback

Removes manual otp code entry

**Why**: Only one of the specs in
`password_recovery_via_recovery_code_spec.rb` needs to go through the
otp code entry page

Un-nest personal key verification bail out form

**Why**: Having a form nested in a form is bad.

Add cancel link to no pkey warning modal

**Why**: User should have the option to cancel the modal and verify
their personal key once they are warned that lack of said key will
require identity reverification

Add specs for modal cancel and pkey verify cancel

**Why**: We should have confidence that a user attempting to close the
reverify warning modal or electing to reverify their info once on the
personal key verification page can do so
**Why**:
Use crockford encoding to make them case-insensitive and
normalize confusable letters and numbers.
zachmargolis and others added 19 commits June 23, 2017 10:52
…-mail

Make verify-by-mail codes less error-prone
**Why**:
TTP requested a new logo be added
Added new logo for cbp trusted traveler program
Revert "Added new logo for cbp trusted traveler program"
**Why**:
Use the database rather than rack-attack
**Why**:
- Since we don't enforce uniqueness of phone number, a malicious
user could create multiple accounts with the same number and request
OTPs from each account. We want to keep track of the request count
based on the phone number used and then lock out all users who have
that phone number.
- To keep things simple, we use the same lockout period for both
max OTP attempts and max OTP requests
Lock users out temporarily after too many OTPs
**Why**:
We don't need it, and having a custom setter for it
was duplicating code in the User model
Remove OtpRequestsTracker#encrypted_phone
**Why**: To avoid hardcoding keys in the user session across multiple
controllers, and to present an interface for managing account
reactivation session data

Spec to test confirm_personal_key before_action

**Why**: CC reported that branch of logic as untested
Use AccountReactivationSession object
**Why**: Instead of having to rely on devops to deploy Figaro config
changes before we can deploy code to our lower envs, we can make the
`lockout_period_in_minutes` optional, and set a default value for it.
Set a default value for lockout period
**Why**: For consistency with the behavior during account creation
cancellation.

**How**:
- Add a new controller and route for signing the user out without having
to go through `SamlIdpController#logout` since there is no single logout
to be performed in this scenario
- Replace the URL of the Cancel link to point to this new route

(cherry picked from commit ae68355 #1526)
**Why**: We noticed some users were running into an exception
while trying to set their password. It turned out they were
signing up for multiple accounts in the same session, but
using different browsers, which is a common use case for users
starting the process in a mobile app, and then confirming their
email in a separate app or mobile browser.

The bug was that we were only storing the request in the DB if the
session didn't already contain the `request_id`, and we also deleted
the request after a successful redirect back to the SP. Here's a
concrete example, which I wrote a test for:

- User starts by entering their email in browser 1, request 1 is stored
in the DB and in the session
- User confirms their email in browser 2, which looks up request 1 in
the DB, and stores it in the session
- User continues the account creation process successfully and continues
on to the SP. At this point, request 1 is deleted from the DB
- User goes back to browser 1 and makes a new request while the original
session is still alive. Since the session is still alive and still
contains request 1, the app doesn't store this new request, but the same
`request_id` is passed on to the email confirmation
- User confirms their email in browser 2, which passes because we don't
validate the request_id at this point.
- User tries to create their password, but when they submit the form,
they get an exception because the app is trying to look up the request
in the DB that matches the orginal `request_id`, but it was deleted
earlier.

**How**: Always store a request in the DB every time a new request is
made by the SP. Don't reuse requests. The reason we reused requests
before was to make it easier to delete requests in the DB that were no
longer needed, but I obviously didn't think it through. We'll need to
come up with a rake task or some other way to prevent the
`ServiceProviderRequests` table from growing too large.

(cherry picked from commit e38a3df #1542)
**Why**: Before, we were only responding with a 404 to requests for
the HTML format, and we noticed 500 errors when browsers requested
nonexistent PNG and CSS files.

(cherry picked from commit 778ac7a #1543)
@zachmargolis
Copy link
Copy Markdown
Contributor

We're going to do the same thing to staging first right?

@gemfarmer
Copy link
Copy Markdown
Contributor Author

gemfarmer commented Jul 13, 2017

@zachmargolis I thought you had said we would go directly to prod. Or maybe you meant master➡️qa or int➡️staging➡️production?

@gemfarmer
Copy link
Copy Markdown
Contributor Author

Should I make a different one to stages/staging?

@gemfarmer gemfarmer changed the title Patch for 1.008 Deployment to production: patch for 1.008 Jul 13, 2017
@gemfarmer
Copy link
Copy Markdown
Contributor Author

gemfarmer commented Jul 13, 2017

Did that in #1546. Closing this and reopening from stages/staging --> stages/production

@gemfarmer
Copy link
Copy Markdown
Contributor Author

Closing in favor of #1547

@gemfarmer gemfarmer closed this Jul 13, 2017
@zachmargolis
Copy link
Copy Markdown
Contributor

Sorry I meant the latter, something more like int ➡️ staging ➡️ production

@mitchellhenke mitchellhenke deleted the stages/rc-2017-07-10-patch-3 branch December 28, 2021 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants