From e728ecba693fb7830fcdf35d071258881d155269 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 1 Dec 2022 13:12:54 +0100 Subject: [PATCH] Remove signup conditional flag (#2581) Remove signup flag --- src/lib/routes/admin-api/index.ts | 6 +- .../__snapshots__/openapi.e2e.test.ts.snap | 132 ++++++++++++++++++ 2 files changed, 133 insertions(+), 5 deletions(-) diff --git a/src/lib/routes/admin-api/index.ts b/src/lib/routes/admin-api/index.ts index ba67e3c45f..811dde570e 100644 --- a/src/lib/routes/admin-api/index.ts +++ b/src/lib/routes/admin-api/index.ts @@ -25,7 +25,6 @@ import { EnvironmentsController } from './environments'; import ConstraintsController from './constraints'; import PatController from './user/pat'; import { PublicSignupController } from './public-signup'; -import { conditionalMiddleware } from '../../middleware/conditional-middleware'; import InstanceAdminController from './instance-admin'; import FavoritesController from './favorites'; @@ -111,10 +110,7 @@ class AdminApi extends Controller { ); this.app.use( '/invite-link', - conditionalMiddleware( - () => config.flagResolver.isEnabled('publicSignup'), - new PublicSignupController(config, services).router, - ), + new PublicSignupController(config, services).router, ); this.app.use( '/instance-admin', diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index 0325d71276..17a592675c 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -4780,6 +4780,138 @@ If the provided project does not exist, the list of events will be empty.", ], }, }, + "/api/admin/invite-link/tokens": { + "get": { + "operationId": "getAllPublicSignupTokens", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokensSchema", + }, + }, + }, + "description": "publicSignupTokensSchema", + }, + }, + "summary": "Retrieve all existing public signup tokens", + "tags": [ + "Public signup tokens", + ], + }, + "post": { + "operationId": "createPublicSignupToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokenCreateSchema", + }, + }, + }, + "description": "publicSignupTokenCreateSchema", + "required": true, + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokenSchema", + }, + }, + }, + "description": "The resource was successfully created.", + "headers": { + "location": { + "description": "The location of the newly created resource.", + "schema": { + "format": "uri", + "type": "string", + }, + }, + }, + }, + }, + "summary": "Create a public signup token", + "tags": [ + "Public signup tokens", + ], + }, + }, + "/api/admin/invite-link/tokens/{token}": { + "get": { + "description": "Get information about a specific token. The \`:token\` part of the URL should be the token's secret.", + "operationId": "getPublicSignupToken", + "parameters": [ + { + "in": "path", + "name": "token", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokenSchema", + }, + }, + }, + "description": "publicSignupTokenSchema", + }, + }, + "summary": "Retrieve a token", + "tags": [ + "Public signup tokens", + ], + }, + "put": { + "operationId": "updatePublicSignupToken", + "parameters": [ + { + "in": "path", + "name": "token", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokenUpdateSchema", + }, + }, + }, + "description": "publicSignupTokenUpdateSchema", + "required": true, + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicSignupTokenSchema", + }, + }, + }, + "description": "publicSignupTokenSchema", + }, + }, + "summary": "Update a public signup token", + "tags": [ + "Public signup tokens", + ], + }, + }, "/api/admin/metrics/applications": { "get": { "operationId": "getApplications",