Skip to content

Commit

Permalink
move cert files outside src
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed May 1, 2024
1 parent ef46d0c commit 7b9cdc3
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
6 changes: 6 additions & 0 deletions packages/amplify-graphql-schema-generator/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ export const getParentNode: (ancestors: any[]) => ObjectTypeDefinitionNode | und
// @public (undocumented)
export const getRefersToDirective: (name: string) => DirectiveNode;

// @public (undocumented)
export const getSSLConfig: (host: string) => {
rejectUnauthorized: boolean;
ca?: string;
};

// @public (undocumented)
export const graphqlSchemaFromSQLSchema: (sqlSchema: string, engineType: ImportedRDSType) => string;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { knex } from 'knex';
import { invokeSchemaInspectorLambda } from '../utils/vpc-helper';
import ora from 'ora';
import { invokeSchemaInspectorLambda } from '../utils/vpc-helper';
import { Field, Index } from '../schema-representation';
import { getSSLConfig } from '../utils';
import { DataSourceAdapter } from './datasource-adapter';
import { MySQLStringDataSourceAdapter } from './mysql-string-datasource-adapter';
import { getSSLConfig } from '../certs';

const spinner = ora();
export interface MySQLDataSourceConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { knex } from 'knex';
import { invokeSchemaInspectorLambda } from '../utils/vpc-helper';
import ora from 'ora';
import { invokeSchemaInspectorLambda } from '../utils/vpc-helper';
import { Field, Index } from '../schema-representation';
import { getSSLConfig } from '../utils';
import { DataSourceAdapter } from './datasource-adapter';
import { PostgresStringDataSourceAdapter, expectedColumns } from './pg-string-datasource-adapter';
import { getSSLConfig } from '../certs';

const spinner = ora();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ const getRDSCertificate = (): string => {
// The certificate is publicly available and downloaded from https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem
// Proxies require
const RDS_CERT_FILE_NAME = 'aws-rds-global-bundle.pem';
const RDS_CERT_FILE_PATH = path.join(__dirname, RDS_CERT_FILE_NAME);
const RDS_CERT_FILE_PATH = path.join(__dirname, '..', '..', 'certs', RDS_CERT_FILE_NAME);
return fs.readFileSync(RDS_CERT_FILE_PATH, 'utf-8');
};
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './vpc-helper';
export { getSSLConfig } from './cert';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as path from 'path';
import * as fs from 'fs';
import knex, { Knex } from 'knex';

Expand Down Expand Up @@ -36,8 +35,7 @@ export const establishDBConnection = (config: any): any => {
};

const getRDSCertificate = (): string => {
// This certificate file is copied from the parent folder `amplify-graphql-schema-generator/src/certs/aws-rds-global-bundle.pem`.
// This certificate file is copied from the parent folder `amplify-graphql-schema-generator/certs/aws-rds-global-bundle.pem`.
const RDS_CERT_FILE_NAME = 'aws-rds-global-bundle.pem';
const RDS_CERT_FILE_PATH = path.join(__dirname, RDS_CERT_FILE_NAME);
return fs.readFileSync(RDS_CERT_FILE_PATH, 'utf-8');
return fs.readFileSync(RDS_CERT_FILE_NAME, 'utf-8');
};

0 comments on commit 7b9cdc3

Please sign in to comment.