Skip to content

Commit

Permalink
chore(app, platforms): remove facebook stamp (passportxyz#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz authored Dec 26, 2023
1 parent b7bb11f commit a30fe1e
Show file tree
Hide file tree
Showing 21 changed files with 9 additions and 1,082 deletions.
1 change: 0 additions & 1 deletion app/.env-example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ NEXT_PUBLIC_PASSPORT_GOOGLE_CLIENT_ID=MY-APP-ID.apps.googleusercontent.com
NEXT_PUBLIC_PASSPORT_GOOGLE_CALLBACK=http://localhost:3000/

NEXT_PUBLIC_PASSPORT_TWITTER_CLIENT_ID=ABC123456789
NEXT_PUBLIC_PASSPORT_FACEBOOK_APP_ID=123456789
NEXT_PUBLIC_PASSPORT_GITHUB_CLIENT_ID=12345678
NEXT_PUBLIC_PASSPORT_GITHUB_CALLBACK=http://localhost:3000/
NEXT_PUBLIC_PASSPORT_LINKEDIN_CLIENT_ID=12345678
Expand Down
8 changes: 0 additions & 8 deletions app/__test-fixtures__/contextTestHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ export const makeTestCeramicContext = (initialState?: Partial<CeramicContextStat
providerSpec: getProviderSpec("POAP", "POAP"),
stamp: undefined,
},
Facebook: {
providerSpec: getProviderSpec("Facebook", "Facebook"),
stamp: undefined,
},
FacebookProfilePicture: {
providerSpec: getProviderSpec("Facebook", "FacebookProfilePicture"),
stamp: undefined,
},
Brightid: {
providerSpec: getProviderSpec("Brightid", "Brightid"),
stamp: undefined,
Expand Down
5 changes: 0 additions & 5 deletions app/__test-fixtures__/databaseStorageFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ export const twitterStampFixture: Stamp = {
credential,
};

export const facebookStampFixture: Stamp = {
provider: "Facebook",
credential,
};

export const brightidStampFixture: Stamp = {
provider: "Brightid",
credential,
Expand Down
88 changes: 0 additions & 88 deletions app/__tests__/components/ProviderCards/FacebookCard.test.tsx

This file was deleted.

17 changes: 8 additions & 9 deletions app/__tests__/context/ceramicContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
googleStampFixture,
discordStampFixture,
brightidStampFixture,
facebookStampFixture,
} from "../../__test-fixtures__/databaseStorageFixtures";
import { Passport } from "@gitcoin/passport-types";
import {
Expand Down Expand Up @@ -59,7 +58,7 @@ export const dbDeleteStampMock = jest.fn();
export const dbDeleteStampsMock = jest.fn();
export const dbCreatePassportMock = jest.fn();

const stamps = [googleStampFixture, discordStampFixture, brightidStampFixture, facebookStampFixture].map((stamp) => {
const stamps = [googleStampFixture, discordStampFixture, brightidStampFixture].map((stamp) => {
stamp.credential.expirationDate = "2099-05-15T21:04:01.708Z";
stamp.credential.credentialSubject.id = "test-user-did";
stamp.credential.issuer = process.env.NEXT_PUBLIC_PASSPORT_IAM_ISSUER_DID || "";
Expand Down Expand Up @@ -145,12 +144,12 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => {
});
render(mockComponent());

await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1));
await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1));
});
it("should clean a dirty passport after successful fetch", async () => {
const expiredStamp = {
...facebookStampFixture,
credential: { ...facebookStampFixture.credential, expirationDate: "2021-05-15T21:04:01.708Z" },
...googleStampFixture,
credential: { ...googleStampFixture.credential, expirationDate: "2021-05-15T21:04:01.708Z" },
};
(PassportDatabase as jest.Mock).mockImplementation(() => {
return {
Expand All @@ -168,7 +167,7 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => {
});
render(mockComponent());

await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1));
await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1));
});
it("should set passport to undefined if an exception is raised while fetching", async () => {
(PassportDatabase as jest.Mock).mockImplementationOnce(() => {
Expand Down Expand Up @@ -227,7 +226,7 @@ describe("CeramicContextProvider syncs stamp state with ceramic", () => {
});
render(mockComponent());

await waitFor(() => expect(screen.getAllByText("# Stamps = 4")).toHaveLength(1));
await waitFor(() => expect(screen.getAllByText("# Stamps = 3")).toHaveLength(1));
});

it("should attempt to add stamps to database and ceramic", async () => {
Expand Down Expand Up @@ -454,7 +453,7 @@ const mockDatabase = {
} as PassportDatabase;
const mockProvidersState = {
google: true,
facebook: true,
ens: true,
} as AllProvidersState;

describe("cleanPassport function", () => {
Expand All @@ -477,7 +476,7 @@ describe("cleanPassport function", () => {
const validStamp = {
credential: {
expirationDate: "2099-05-15T21:04:01.708Z",
credentialSubject: { provider: "facebook", id: "test-user-did" },
credentialSubject: { provider: "google", id: "test-user-did" },
issuer: process.env.NEXT_PUBLIC_PASSPORT_IAM_ISSUER_DID || "",
},
};
Expand Down
1 change: 0 additions & 1 deletion app/config/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const STAMP_FILTERS: {
Ens: ["Account Name"],
Poh: ["Account Name"],
Twitter: ["Account Name"],
Facebook: ["Account Name"],
Brightid: ["Account Name"],
Linkedin: ["Account Name"],
Discord: ["Account Name"],
Expand Down
6 changes: 0 additions & 6 deletions app/context/ceramicContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const {
Lens,
Github,
Gitcoin,
Facebook,
Poh,
PHI,
NFT,
Expand Down Expand Up @@ -89,11 +88,6 @@ platforms.set("NFT", {
platFormGroupSpec: NFT.ProviderConfig,
});

platforms.set("Facebook", {
platform: new Facebook.FacebookPlatform(),
platFormGroupSpec: Facebook.ProviderConfig,
});

platforms.set("Github", {
platform: new Github.GithubPlatform({
clientId: process.env.NEXT_PUBLIC_PASSPORT_GITHUB_CLIENT_ID,
Expand Down
29 changes: 0 additions & 29 deletions app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import TagManager from "react-gtm-module";
import { themes, ThemeWrapper } from "../utils/theme";
import { StampClaimingContextProvider } from "../context/stampClaimingContext";

const FacebookAppId = process.env.NEXT_PUBLIC_PASSPORT_FACEBOOK_APP_ID || "";
const GTM_ID = process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID || "";
const INTERCOM_APP_ID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID || "";

Expand Down Expand Up @@ -137,39 +136,11 @@ function App({ Component, pageProps }: AppProps) {
}
}

const facebookSdkScript = (
<script
id="facebook-app-script"
dangerouslySetInnerHTML={{
__html: `
window.fbAsyncInit = function() {
FB.init({
appId : '${FacebookAppId}',
cookie : true,
xfbml : true,
version : 'v13.0'
});
FB.AppEvents.logPageView();
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
`,
}}
/>
);

return (
<>
<Head>
<link rel="shortcut icon" href="/favicon.ico" />
<title>Gitcoin Passport</title>
{facebookSdkScript}
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
</Head>
<SelfIdProvider
Expand Down
2 changes: 0 additions & 2 deletions iam/.env-example.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ GOOGLE_CALLBACK=http://localhost:3000/
TWITTER_CLIENT_ID=MY-APP-ID-TWITTER
TWITTER_CLIENT_SECRET=MY_APP_SECRET
TWITTER_CALLBACK=http://127.0.0.1:3000/
FACEBOOK_APP_ID=MY_APP_ID
FACEBOOK_APP_SECRET=MY_APP_SECRET
BRIGHTID_PRIVATE_KEY=BRIGHTID_PRIVATE_KEY
GITHUB_CLIENT_ID=MY_GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET=MY_GITHUB_CLIENT_SECRET
Expand Down
12 changes: 1 addition & 11 deletions infra/aws/iam_secrets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


export const getIamSecrets = (PASSPORT_VC_SECRETS_ARN:string, IAM_SERVER_SSM_ARN:string) => [
export const getIamSecrets = (PASSPORT_VC_SECRETS_ARN: string, IAM_SERVER_SSM_ARN: string) => [
{
name: "IAM_JWK",
valueFrom: `${PASSPORT_VC_SECRETS_ARN}:IAM_JWK::`,
Expand Down Expand Up @@ -37,14 +35,6 @@ export const getIamSecrets = (PASSPORT_VC_SECRETS_ARN:string, IAM_SERVER_SSM_ARN
name: "TWITTER_CLIENT_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:TWITTER_CLIENT_SECRET::`,
},
{
name: "FACEBOOK_APP_ID",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_ID::`,
},
{
name: "FACEBOOK_APP_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_SECRET::`,
},
{
name: "BRIGHTID_PRIVATE_KEY",
valueFrom: `${IAM_SERVER_SSM_ARN}:BRIGHTID_PRIVATE_KEY::`,
Expand Down
8 changes: 0 additions & 8 deletions infra/production/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ const service = new awsx.ecs.FargateService("dpopp-iam", {
name: "TWITTER_CLIENT_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:TWITTER_CLIENT_SECRET::`,
},
{
name: "FACEBOOK_APP_ID",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_ID::`,
},
{
name: "FACEBOOK_APP_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_SECRET::`,
},
{
name: "BRIGHTID_PRIVATE_KEY",
valueFrom: `${IAM_SERVER_SSM_ARN}:BRIGHTID_PRIVATE_KEY::`,
Expand Down
8 changes: 0 additions & 8 deletions infra/review/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,6 @@ const service = new awsx.ecs.FargateService("dpopp-iam", {
name: "TWITTER_CLIENT_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:TWITTER_CLIENT_SECRET::`,
},
{
name: "FACEBOOK_APP_ID",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_ID::`,
},
{
name: "FACEBOOK_APP_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_SECRET::`,
},
{
name: "BRIGHTID_PRIVATE_KEY",
valueFrom: `${IAM_SERVER_SSM_ARN}:BRIGHTID_PRIVATE_KEY::`,
Expand Down
8 changes: 0 additions & 8 deletions infra/staging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ const service = new awsx.ecs.FargateService("dpopp-iam", {
name: "TWITTER_CLIENT_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:TWITTER_CLIENT_SECRET::`,
},
{
name: "FACEBOOK_APP_ID",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_ID::`,
},
{
name: "FACEBOOK_APP_SECRET",
valueFrom: `${IAM_SERVER_SSM_ARN}:FACEBOOK_APP_SECRET::`,
},
{
name: "BRIGHTID_PRIVATE_KEY",
valueFrom: `${IAM_SERVER_SSM_ARN}:BRIGHTID_PRIVATE_KEY::`,
Expand Down
29 changes: 0 additions & 29 deletions platforms/src/Facebook/App-Bindings.ts

This file was deleted.

Loading

0 comments on commit a30fe1e

Please sign in to comment.