Skip to content

Commit

Permalink
fix: drop CGRANTS_API_TOKEN in favour SCORER_API_KEY (#3049)
Browse files Browse the repository at this point in the history
  • Loading branch information
nutrina authored Nov 13, 2024
1 parent e856ecf commit 705abfc
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions iam/.env-example.env
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PASSPORT_SCORER_BACKEND=http://localhost:8002/
# Needs to match FE/APP equivalents in app/.env
ALLO_SCORER_ID=3
SCORER_ENDPOINT=http://localhost:8002/
SCORER_API_KEY=abc
SCORER_API_KEY=abc # This is a static authentication secret token
EAS_FEE_USD=2

EAS_GITCOIN_STAMP_SCHEMA=0xd83994d5459162a259c3a18d3db267ca05982f1e1e261d5388a8bfe2a2a2c7f9
Expand All @@ -68,7 +68,6 @@ PASSPORT_STAMP_METADATA_PATH=http://localhost:3000/stampMetadata.json
INCLUDE_TESTNETS=false
ZKSYNC_ERA_MAINNET_ENDPOINT=zksync_mainnet_endpoint

CGRANTS_API_TOKEN=abc
CGRANTS_API_URL=http://localhost:8002/cgrants


Expand Down
2 changes: 1 addition & 1 deletion platforms/src/AllowList/Providers/allowList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AllowListProvider implements Provider {
const { address } = payload;
const { allowList } = payload.proofs;
const response: AllowListResponse = await axios.get(`${allowListEndpoint}/${allowList}/${address}`, {
headers: { Authorization: process.env.CGRANTS_API_TOKEN },
headers: { Authorization: process.env.SCORER_API_KEY },
});
const valid = response.data.is_member;

Expand Down
2 changes: 1 addition & 1 deletion platforms/src/CustomGithub/Providers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getCondition = async (type: string, conditionName: string, conditionHash:
try {
const url = `${githubConditionEndpoint}/${type}%23${conditionName}%23${conditionHash}`;
const response: ConditionResponse = await axios.get(url, {
headers: { Authorization: process.env.CGRANTS_API_TOKEN },
headers: { Authorization: process.env.SCORER_API_KEY },
});
return response.data.ruleset.condition;
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.mock("axios");

const mockedAxios = axios as jest.Mocked<typeof axios>;
const userHandle = "my-login-handle";
const cgrantsApiToken = process.env.CGRANTS_API_TOKEN;
const cgrantsApiToken = process.env.SCORER_API_KEY;

const address = "0x0";

Expand Down
2 changes: 1 addition & 1 deletion platforms/src/Gitcoin/Providers/gitcoinGrantsStatistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const getGitcoinStatistics = async (
if (!context.gitcoinGrantStatistics) context.gitcoinGrantStatistics = {};

const grantStatisticsRequest = await axios.get(`${dataUrl}?address=${address}`, {
headers: { Authorization: process.env.CGRANTS_API_TOKEN },
headers: { Authorization: process.env.SCORER_API_KEY },
});

context.gitcoinGrantStatistics[dataUrl] = { record: grantStatisticsRequest.data } as GitcoinGrantStatistics;
Expand Down
2 changes: 1 addition & 1 deletion platforms/src/GtcStaking/Providers/GtcStaking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class GtcStakingProvider implements Provider {
const communityStakesV2: StakeV2[] = [];

const responseV2: StakeV2Response = await axios.get(`${gtcStakingEndpointV2}/${address}`, {
headers: { Authorization: process.env.CGRANTS_API_TOKEN },
headers: { Authorization: process.env.SCORER_API_KEY },
});
const resultsV2: StakeV2[] = responseV2?.data?.items || [];

Expand Down
2 changes: 1 addition & 1 deletion platforms/src/TrustaLabs/Providers/TrustaLabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface AxiosResponse {
const TRUSTA_LABS_API_ENDPOINT = "https://www.trustalabs.ai/service/openapi/queryRiskSummaryScore";

const createUpdateDBScoreData = async (address: string, scoreData: TrustaLabsData) => {
const accessToken = process.env.CGRANTS_API_TOKEN;
const accessToken = process.env.SCORER_API_KEY;
try {
await axios.post(
`${process.env.PASSPORT_SCORER_BACKEND}trusta_labs/trusta-labs-score`,
Expand Down

0 comments on commit 705abfc

Please sign in to comment.