Skip to content

Commit 97b5472

Browse files
authored
fix(ci-token): use gateway graphql host for ci token provisioning (#485)
1 parent 0aaf1ce commit 97b5472

4 files changed

Lines changed: 3 additions & 11 deletions

File tree

.envrc.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ export OAUTH_CLIENT_ID='';
1212
# export OAUTH_CALLBACK_PORT='4000';
1313
# export OAUTH_CALLBACK_REDIRECT='http://localhost:4000/oauth2/callback';
1414

15-
# IAM (for CI token provisioning via hd auth provision-ci-token)
16-
# export IAM_HOST='https://apps.herodevs.io/api/iam';
17-
# export IAM_PATH='/graphql';
18-
1915
# CI credential (for headless flows):
2016
# export HD_CI_CREDENTIAL='<long-lived-refresh-token>';
2117

src/api/ci-token.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ApiError, type ApiErrorCode, isApiErrorCode } from './errors.ts';
77
import { getOrgAccessTokensMutation } from './gql-operations.ts';
88
import { getGraphQLErrors } from './graphql-errors.ts';
99

10-
const graphqlUrl = `${config.iamHost}${config.iamPath}`;
10+
const graphqlUrl = `${config.graphqlHost}${config.graphqlPath}`;
1111

1212
const noAuthTokenProvider = async (): Promise<string> => '';
1313

src/config/constants.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
export const EOL_REPORT_URL = 'https://apps.herodevs.com/eol/reports';
22
export const GRAPHQL_HOST = 'https://gateway.prod.apps.herodevs.io';
33
export const GRAPHQL_PATH = '/graphql';
4-
export const IAM_HOST = 'http://iam-dev:5845';
5-
export const IAM_PATH = '/graphql';
64
export const ANALYTICS_URL = 'https://apps.herodevs.com/api/eol/track';
75
export const CONCURRENT_PAGE_REQUESTS = 3;
86
export const PAGE_SIZE = 500;
@@ -39,8 +37,6 @@ export const config = {
3937
eolReportUrl: process.env.EOL_REPORT_URL || EOL_REPORT_URL,
4038
graphqlHost: process.env.GRAPHQL_HOST || GRAPHQL_HOST,
4139
graphqlPath: process.env.GRAPHQL_PATH || GRAPHQL_PATH,
42-
iamHost: process.env.IAM_HOST || IAM_HOST,
43-
iamPath: process.env.IAM_PATH || IAM_PATH,
4440
analyticsUrl: process.env.ANALYTICS_URL || ANALYTICS_URL,
4541
concurrentPageRequests,
4642
pageSize,

test/api/ci-token.client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ vi.mock('../../src/config/constants.ts', async (importOriginal) => {
1010
...actual,
1111
config: {
1212
...actual.config,
13-
iamHost: 'https://iam.test',
14-
iamPath: '/graphql',
13+
graphqlHost: 'https://gateway.test',
14+
graphqlPath: '/graphql',
1515
},
1616
};
1717
});

0 commit comments

Comments
 (0)