[Backend] API for Step 2 of Trial
What does this MR do?
It completes some missing things from Step 1:
- Adds a custom redirect URL to be used after a successful sign in on sign up.
- Marks the new account to be created as confirmed.
And support for Step 2:
- Adds a new endpoint to be used by the new view with the trial details:
GET /-/trials/new
(new_trial_path
) - Adds a new endpoint to process the form with trial details:
POST /-/trials/create_lead
(create_lead_trials_path
) - Redirects user to Step 1 in case they are unauthenticated and try to go to step 2.
- Adds a template service (
GitlabSubscriptions::CreateLeadService
) that will consume the Subscriptions Portal API to be implemented in a different MR.
REF: #13233 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
API contract:
GET /-/trials/apply
Request:
{
namespace_id: <namespace_id>
}
Response:
On success: Redirects to group show page
On failure:
Redirects back to select namespace page for trials /-/trials/select_namespace
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Aishwarya Subramanian