feat(secret-sync): minor fix on heroku docs

This commit is contained in:
carlosmonastyrski
2025-06-19 15:17:36 -03:00
parent 7581300a67
commit c52180c890
2 changed files with 2 additions and 27 deletions
@@ -4,9 +4,9 @@ import { getConfig } from "@app/lib/config/env";
import { request } from "@app/lib/config/request";
import { BadRequestError, InternalServerError } from "@app/lib/errors";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { encryptAppConnectionCredentials } from "@app/services/app-connection/app-connection-fns";
import { IntegrationUrls } from "@app/services/integration-auth/integration-list";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
import { KmsDataKey } from "@app/services/kms/kms-types";
import { TAppConnectionDALFactory } from "../app-connection-dal";
import { HerokuConnectionMethod } from "./heroku-connection-enums";
@@ -21,31 +21,6 @@ interface HerokuOAuthTokenResponse {
session_nonce: string;
}
const encryptAppConnectionCredentials = async ({
orgId,
credentials,
kmsService
}: {
orgId: string;
credentials: {
refreshToken: string;
authToken: string;
expiresAt: Date;
};
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
}) => {
const { encryptor } = await kmsService.createCipherPairWithDataKey({
type: KmsDataKey.Organization,
orgId
});
const { cipherTextBlob: encryptedCredentialsBlob } = encryptor({
plainText: Buffer.from(JSON.stringify(credentials))
});
return encryptedCredentialsBlob;
};
export const getHerokuConnectionListItem = () => {
const { CLIENT_ID_HEROKU } = getConfig();