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

[#IOPID-1604] redirect to confirm page #72

Merged
merged 10 commits into from
Feb 29, 2024

Conversation

arcogabbo
Copy link
Contributor

@arcogabbo arcogabbo commented Feb 22, 2024

⚠️ This PR depends on pagopa/io-infra#894

List of Changes

Motivation and Context

new optional query parameter for redirecting the user on a new confirm page

How Has This Been Tested?

unit tests, integration tests via io-mock

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPID-1604

Copy link

github-actions bot commented Feb 22, 2024

Terraform Plan 📖

Terraform Plan
�[0m�[1mInitializing the backend...�[0m
�[0m�[32m
Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.�[0m

�[0m�[1mInitializing provider plugins...�[0m
- Finding hashicorp/azurerm versions matching ">= 3.30.0, <= 3.40.0"...
- Installing hashicorp/azurerm v3.40.0...
- Installed hashicorp/azurerm v3.40.0 (signed by HashiCorp)

Terraform has created a lock file �[1m.terraform.lock.hcl�[0m to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.�[0m

�[0m�[1m�[32mTerraform has been successfully initialized!�[0m�[32m�[0m
�[0m�[32m
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.�[0m
Acquiring state lock. This may take a few moments...
data.azurerm_resource_group.this: Reading...
data.azurerm_resource_group.this: Read complete after 0s [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/dashboards]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
Releasing state lock. This may take a few moments...

@arcogabbo arcogabbo marked this pull request as ready for review February 28, 2024 09:28
@arcogabbo arcogabbo requested a review from a team as a code owner February 28, 2024 09:28
@arcogabbo arcogabbo requested review from pagopa-github-bot and silvicir and removed request for a team February 28, 2024 09:28
Copy link
Contributor

@BurnedMarshal BurnedMarshal left a comment

Choose a reason for hiding this comment

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

Only some minor consideration

ValidateProfileEmail/handler.ts Outdated Show resolved Hide resolved
utils/middleware.ts Outdated Show resolved Hide resolved
utils/middleware.ts Outdated Show resolved Hide resolved
utils/redirect_url.ts Outdated Show resolved Hide resolved
utils/redirect_url.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@gquadrati gquadrati left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 10 to 30
export const TokenQueryParam = PatternString(
"^[A-Za-z0-9]{26}:[A-Fa-f0-9]{24}$"
);
export type TokenQueryParam = t.TypeOf<typeof TokenQueryParam>;

export const TokenQueryParamMiddleware = RequiredQueryParamMiddleware(
"token",
TokenQueryParam
);

// CONFIRM -> verify token and on success redirect to confirm page
// VALIDATE -> verify token and on success redirect to result page
export enum FlowChoiceEnum {
"CONFIRM" = "CONFIRM",
"VALIDATE" = "VALIDATE"
}
export const FlowChoice = enumType<FlowChoiceEnum>(
FlowChoiceEnum,
"FlowChoice"
);
export type FlowChoice = t.TypeOf<typeof FlowChoice>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible for us to generate them from the OpenAPI specification?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what I thought at first. sadly, the OpenAPI spec in the project is only used for opex dashboards(introduced on latest versions) and the codebase is not based on the types generated from it. so I continued with the pattern already used.

utils/config.ts Show resolved Hide resolved
ValidateProfileEmail/__tests__/handler.test.ts Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

dpulls bot commented Feb 29, 2024

🎉 All dependencies have been resolved !

@arcogabbo arcogabbo merged commit e0d61c8 into master Feb 29, 2024
7 checks passed
@arcogabbo arcogabbo deleted the IOPID-1604--redirect-to-confirm-page branch February 29, 2024 10:28
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.

3 participants