Skip to content

Add a route for continuing user authorization confirmation#5735

Merged
jmhooper merged 3 commits intomainfrom
jmhooper-add-user-authorization-destroy-action
Dec 21, 2021
Merged

Add a route for continuing user authorization confirmation#5735
jmhooper merged 3 commits intomainfrom
jmhooper-add-user-authorization-destroy-action

Conversation

@jmhooper
Copy link
Contributor

Why: Previously this action was handled by the completions controller. This added some not-obvious coupling between the two. As a result, changes to the completions controller update action can have unintended consequences. This commit separates them out to hopefull simplify things.

There is some logic in the completions controller to support both actions that we can also remove, but we will need to wait until this code is fully deployed before we pull that out.

**Why**: Previously this action was handled by the completions controller. This added some not-obvious coupling between the two. As a result, changes to the completions controller update action can have unintended consequences. This commit separates them out to hopefull simplify things.

There is some logic in the completions controller to support both actions that we can also remove, but we will need to wait until this code is fully deployed before we pull that out.
@jmhooper
Copy link
Contributor Author

The AuthorizationConfirmationController does not have any specs. It is a pretty simple controller and I'm going to add some as part of this change. Tagged "WIP" while I do that.

@jmhooper
Copy link
Contributor Author

As an added bonus, we now get analytics events for these actions that are confusingly associated with the completions controller

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Maybe a silly question, but: How does one test this flow?

Comment on lines +132 to +133
AUTHENTICATION_CONFIRMATION_CONTINUE = 'Authentication Confirmation: Continue selected'.freeze
AUTHENTICATION_CONFIRMATION_RESET = 'Authentication Confirmation: Reset selected'.freeze
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we check that these events are logged somewhere in specs (e.g. feature specs for this flow)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, I wrote a controller spec with the idea to test these and never actually tested that they were logged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just pushed some checks for these events

Copy link
Contributor

Choose a reason for hiding this comment

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

The other thing I was curious about is if we were logging anything previously that we care to be continuing to log in this new redirect flow.

@jmhooper
Copy link
Contributor Author

How does one test this flow?

Go to one sample SP, and sign in to your login.gov account. Visit a different sample SP, and sign in. You should be confronted with this screen:

image

Both actions on this screen are now backed by the Users::AuthorizationConfirmationController.

@jmhooper
Copy link
Contributor Author

jmhooper commented Dec 21, 2021

Also, for reference, the feature tests for this flow are here for oidc and here for saml. This change does not impact how the feature works so it did not necessitate and changes to these tests.

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

Comment on lines +132 to +133
AUTHENTICATION_CONFIRMATION_CONTINUE = 'Authentication Confirmation: Continue selected'.freeze
AUTHENTICATION_CONFIRMATION_RESET = 'Authentication Confirmation: Reset selected'.freeze
Copy link
Contributor

Choose a reason for hiding this comment

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

The other thing I was curious about is if we were logging anything previously that we care to be continuing to log in this new redirect flow.

@jmhooper
Copy link
Contributor Author

The other thing I was curious about is if we were logging anything previously that we care to be continuing to log in this new redirect flow.

One of the things that inspired this change was looking at the completions controller and realizing that there was not logging on these events. The completions controller actually had a condition to not log in the case addressed here.

@jmhooper jmhooper merged commit cadcdb0 into main Dec 21, 2021
@jmhooper jmhooper deleted the jmhooper-add-user-authorization-destroy-action branch December 21, 2021 14:52
jmhooper added a commit that referenced this pull request Dec 22, 2021
This commit removes some unnecessary logic:

- Removes ialmax method which was unused
- Removes logic around whether the completions screen is required since now it is required in all contexts (ref: #5735)
jmhooper added a commit that referenced this pull request Dec 28, 2021
* Add a route for continuing user authorization confirmation

**Why**: Previously this action was handled by the completions controller. This added some not-obvious coupling between the two. As a result, changes to the completions controller update action can have unintended consequences. This commit separates them out to hopefully simplify things.

There is some logic in the completions controller to support both actions that we can also remove, but we will need to wait until this code is fully deployed before we pull that out.
jmhooper added a commit that referenced this pull request Dec 29, 2021
This commit removes some unnecessary logic:

- Removes ialmax method which was unused
- Removes logic around whether the completions screen is required since now it is required in all contexts (ref: #5735)
jmhooper added a commit that referenced this pull request Dec 29, 2021
This commit removes some unnecessary logic:

- Removes ialmax method which was unused
- Removes logic around whether the completions screen is required since now it is required in all contexts (ref: #5735)
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.

2 participants