mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 19:44:57 +02:00
Fix admin integrations (#10076)
* Get your own integrations for admin Signed-off-by: Artem Savchenko <armisav@gmail.com> * Remove admin check Signed-off-by: Artem Savchenko <armisav@gmail.com> * Clean up Signed-off-by: Artem Savchenko <armisav@gmail.com> * Allow to add social id by admin Signed-off-by: Artem Savchenko <armisav@gmail.com> * Use service token for integrations test Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update version Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix tokens Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update allowed services Signed-off-by: Artem Savchenko <armisav@gmail.com> * Use workspace service Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix service client Signed-off-by: Artem Savchenko <armisav@gmail.com> * Get rid of admin service name Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -54,7 +54,7 @@ export async function performGithubAccountMigrations (
|
||||
txes: Tx[],
|
||||
region: string | null
|
||||
): Promise<void> {
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'admin', admin: 'true' })
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'tool', admin: 'true' })
|
||||
const githubToken = generateToken(systemAccountUuid, undefined, { service: 'github' })
|
||||
const accountClient = getAccountClient(token)
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export async function performGmailAccountMigrations (
|
||||
txes: Tx[]
|
||||
): Promise<void> {
|
||||
console.log('Start Gmail migrations')
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'admin', admin: 'true' })
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'tool', admin: 'true' })
|
||||
const accountClient = getAccountClient(token)
|
||||
|
||||
const allWorkpaces = await accountClient.listWorkspaces(region)
|
||||
|
||||
@@ -378,7 +378,7 @@ export async function restoreMarkupRefs (
|
||||
storageAdapter: StorageAdapter,
|
||||
region: string | null
|
||||
): Promise<void> {
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'admin', admin: 'true' })
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'tool', admin: 'true' })
|
||||
const ctx = new MeasureMetricsContext('restore-markup-ref', {})
|
||||
|
||||
const accountClient = getAccountClient(token)
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function restoreGithubIntegrations (dbUrl: string, dryrun: boolean)
|
||||
try {
|
||||
const pg = getDBClient(dbUrl)
|
||||
const pgClient = await pg.getClient()
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'admin', admin: 'true' })
|
||||
const token = generateToken(systemAccountUuid, undefined, { service: 'tool', admin: 'true' })
|
||||
const accountClient = getAccountClient(token)
|
||||
|
||||
const integrationSettings = await pgClient<
|
||||
|
||||
Reference in New Issue
Block a user