-
Notifications
You must be signed in to change notification settings - Fork 228
chore(admin-server): remove dead GraphQL decorators, allowlist config #20265
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
Open
vbudhram
wants to merge
1
commit into
main
Choose a base branch
from
remove-gql-bits
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| import { expect, test } from '../../lib/fixtures/standard'; | ||
|
|
||
| const ADMIN_PANEL_URL = process.env.ADMIN_PANEL_URL ?? 'http://localhost:8091'; | ||
| const ADMIN_SERVER_URL = process.env.ADMIN_SERVER_URL ?? 'http://localhost:8095'; | ||
|
|
||
| // Admin panel tests only run locally (stage/prod require SSO) | ||
| test.skip(({ target }) => target.name !== 'local'); | ||
|
|
||
| test.describe('Admin Panel', () => { | ||
| test('admin panel loads and renders navigation', async ({ page }) => { | ||
| await page.goto(ADMIN_PANEL_URL); | ||
| await expect( | ||
| page.getByRole('link', { name: /account search/i }) | ||
| ).toBeVisible(); | ||
| }); | ||
|
|
||
| test('admin panel heartbeat is healthy', async () => { | ||
| const res = await fetch(`${ADMIN_PANEL_URL}/__lbheartbeat__`); | ||
| expect(res.status).toBe(200); | ||
| }); | ||
|
|
||
| test('admin server heartbeat is healthy', async () => { | ||
| const res = await fetch(`${ADMIN_SERVER_URL}/__lbheartbeat__`); | ||
| expect(res.status).toBe(200); | ||
| }); | ||
|
|
||
| test('account search by email returns account data via API', async ({ | ||
| target, | ||
| testAccountTracker, | ||
| }) => { | ||
| const credentials = testAccountTracker.generateAccountDetails(); | ||
| await target.createAccount(credentials.email, credentials.password); | ||
|
|
||
| const res = await fetch( | ||
| `${ADMIN_SERVER_URL}/api/account/by-email?email=${encodeURIComponent(credentials.email)}`, | ||
| { | ||
| headers: { | ||
| 'oidc-claim-id-token-email': 'test-admin@mozilla.com', | ||
| 'remote-groups': 'vpn_fxa_admin_panel_prod', | ||
| }, | ||
| } | ||
| ); | ||
| expect(res.status).toBe(200); | ||
| const data = await res.json(); | ||
| expect(data.email).toBe(credentials.email); | ||
| }); | ||
|
|
||
| test('account search from UI shows results', async ({ | ||
| target, | ||
| page, | ||
| testAccountTracker, | ||
| }) => { | ||
| const credentials = testAccountTracker.generateAccountDetails(); | ||
| await target.createAccount(credentials.email, credentials.password); | ||
|
|
||
| await page.goto(`${ADMIN_PANEL_URL}/account-search`); | ||
|
|
||
| const searchInput = page.getByTestId('email-input'); | ||
| await searchInput.fill(credentials.email); | ||
| await page.getByTestId('search-button').click(); | ||
|
|
||
| await expect(page.getByText(credentials.email)).toBeVisible({ | ||
| timeout: 10000, | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/fxa-admin-server/src/rest/model/account-delete-task.model.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,28 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
| import { Field, ObjectType } from '@nestjs/graphql'; | ||
|
|
||
| export enum AccountDeleteStatus { | ||
| Success = 'Success', | ||
| Failure = 'Failure', | ||
| NoAccount = 'No account found', | ||
| } | ||
|
|
||
| @ObjectType() | ||
| export class AccountDeleteResponse { | ||
| /** Name of task held in the task queue. This can be used to get task's status later. */ | ||
| @Field({ nullable: false }) | ||
| public taskName!: string; | ||
|
|
||
| /** A valid account email or UID */ | ||
| @Field({ nullable: false }) | ||
| public locator!: string; | ||
|
|
||
| /** A short status message. */ | ||
| @Field({ nullable: false }) | ||
| status!: AccountDeleteStatus; | ||
| } | ||
|
|
||
| @ObjectType() | ||
| export class AccountDeleteTaskStatus { | ||
| /** Name of task held in the task queue.. */ | ||
| @Field({ nullable: false }) | ||
| public taskName!: string; | ||
|
|
||
| /** A short status message. */ | ||
| @Field({ nullable: false }) | ||
| status!: string; | ||
| } |
8 changes: 0 additions & 8 deletions
8
packages/fxa-admin-server/src/rest/model/account-events.model.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,19 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
| import { Field, ObjectType } from '@nestjs/graphql'; | ||
|
|
||
| @ObjectType() | ||
| export class AccountEvent { | ||
| @Field({ nullable: true }) | ||
| public name!: string; | ||
|
|
||
| @Field({ nullable: true }) | ||
| public createdAt!: number; | ||
|
|
||
| @Field({ nullable: true }) | ||
| eventType!: string; | ||
|
|
||
| // Email event based properties | ||
| @Field({ nullable: true }) | ||
| template!: string; | ||
|
|
||
| // Metrics properties | ||
| @Field({ nullable: true }) | ||
| flowId!: string; | ||
|
|
||
| @Field({ nullable: true }) | ||
| service!: string; | ||
| } |
4 changes: 0 additions & 4 deletions
4
packages/fxa-admin-server/src/rest/model/account-reset.model.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,15 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
| import { Field, ObjectType } from '@nestjs/graphql'; | ||
|
|
||
| export enum AccountResetStatus { | ||
| Success = 'Success', | ||
| Failure = 'Failure', | ||
| NoAccount = 'No account found', | ||
| } | ||
|
|
||
| @ObjectType() | ||
| export class AccountResetResponse { | ||
| @Field({ nullable: false }) | ||
| locator!: string; | ||
|
|
||
| @Field({ nullable: false }) | ||
| status!: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
gql:allowlistscript is removed here, butpackages/fxa-admin-panel/pm2.config.jsstill runsyarn gql:allowlist(app nameadmin-gql-allowlist). This will breakyarn start/PM2 workflows unless that PM2 entry is removed/updated or an alternative script is kept.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets just remove it