From 9eaf9349c34f736e6ae3b8f2606c789435df42e6 Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 10 Jan 2025 16:16:08 -0500 Subject: [PATCH] chore(nested-clients): mark as internal --- .eslintrc.js | 1 + eslint.config.js | 5 -- packages/nested-clients/README.md | 73 +++------------------- packages/nested-clients/api-extractor.json | 4 -- packages/nested-clients/package.json | 1 - packages/nested-clients/src/index.ts | 16 ++++- 6 files changed, 22 insertions(+), 78 deletions(-) delete mode 100644 eslint.config.js delete mode 100644 packages/nested-clients/api-extractor.json diff --git a/.eslintrc.js b/.eslintrc.js index 91d9874cf3e91..df776ba4fb31f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,4 +29,5 @@ module.exports = { "simple-import-sort/imports": "error", "sort-export-all/sort-export-all": "error", }, + ignorePatterns: ["packages/nested-clients/**/protocols/**.ts"], }; diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 5fbe011838979..0000000000000 --- a/eslint.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = [ - { - ignores: ["./packages/nested-clients/**/protocols/**"], - }, -]; diff --git a/packages/nested-clients/README.md b/packages/nested-clients/README.md index 9aedcd5e021ca..1182bbdc2786f 100644 --- a/packages/nested-clients/README.md +++ b/packages/nested-clients/README.md @@ -1,72 +1,13 @@ -# @aws-sdk/rds-signer - -[![NPM version](https://img.shields.io/npm/v/@aws-sdk/rds-signer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/rds-signer) -[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/rds-signer.svg)](https://www.npmjs.com/package/@aws-sdk/rds-signer) +# @aws-sdk/nested-clients ## Description -This package provides utilities for interacting with RDS. - -## Installation - -```console -npm install @aws-sdk/rds-signer -``` - -## Getting Started - -### Import - -ES6 import - -```js -import { Signer } from "@aws-sdk/rds-signer"; -``` - -Or CommonJS import - -```js -const { Signer } = require("@aws-sdk/rds-signer"); -``` - -### Generate Authentication Token for RDS IAM Authentication - -```js -const signer = new Signer({ - /** - * Required. The hostname of the database to connect to. - */ - hostname: "db.us-east-1.rds.amazonaws.com", - /** - * Required. The port number the database is listening on. - */ - port: 8000, - /** - * Required. The username to login as. - */ - username: "user1", - /** - * Optional. The AWS credentials to sign requests with. Uses the default credential provider chain in not specified. - */ - credentials: fromNodeCredentialProvider(), - /** - * Optional. The region the database is located in. Uses the region inferred from the runtime if omitted. - */ - region: "us-east-1", - /** - * Optional. The SHA256 hasher constructor to sign the request. - */ - sha256: HashCtor, -}); +This is an internal package. Do not install this as a direct dependency. -const token = await signer.getAuthToken(); -// Use this token as the password for connecting to your RDS instance -``` +This package contains separate internal implementations of the STS and SSO-OIDC AWS SDK clients +to be used by the AWS SDK credential providers to break a cyclic dependency. -For more details and examples, refer to the following resources. Usage is similar across DB engines. +### Bundlers -- [Connecting to your DB instance using IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html) -- [IAM database authentication for MySQL and PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) -- [Using IAM authentication to connect with pgAdmin Amazon Aurora PostgreSQL or Amazon RDS for PostgreSQL](https://aws.amazon.com/blogs/database/using-iam-authentication-to-connect-with-pgadmin-amazon-aurora-postgresql-or-amazon-rds-for-postgresql/) -- [Use IAM authentication to connect with SQL Workbench/J to Amazon Aurora MySQL or Amazon RDS for MySQL](https://aws.amazon.com/blogs/database/use-iam-authentication-to-connect-with-sql-workbenchj-to-amazon-aurora-mysql-or-amazon-rds-for-mysql/) -- [AWS CLI v2 rds generate-db-auth-token Documentation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/generate-db-auth-token.html) +This package may be marked as external if you do not use STS nor SSO-OIDC +in your credential resolution process. diff --git a/packages/nested-clients/api-extractor.json b/packages/nested-clients/api-extractor.json deleted file mode 100644 index b03e22a16a06e..0000000000000 --- a/packages/nested-clients/api-extractor.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../api-extractor.packages.json", - "mainEntryPointFilePath": "./dist-types/index.d.ts" -} diff --git a/packages/nested-clients/package.json b/packages/nested-clients/package.json index c048b46a9b8b9..2af152c623db6 100644 --- a/packages/nested-clients/package.json +++ b/packages/nested-clients/package.json @@ -13,7 +13,6 @@ "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", - "extract:docs": "api-extractor run --local", "test": "yarn g:vitest run", "test:watch": "yarn g:vitest watch" }, diff --git a/packages/nested-clients/src/index.ts b/packages/nested-clients/src/index.ts index 319e784f1ebf1..8b34687f01e7b 100644 --- a/packages/nested-clients/src/index.ts +++ b/packages/nested-clients/src/index.ts @@ -1,13 +1,25 @@ +/** + * @internal + */ export { CreateTokenCommand, SSOOIDCClient } from "./nested-sso-oidc/index"; -export type { SSOOIDCClientConfig, CreateTokenCommandInput } from "./nested-sso-oidc"; +/** + * @internal + */ +export type { CreateTokenCommandInput, SSOOIDCClientConfig } from "./nested-sso-oidc"; +/** + * @internal + */ export { AssumeRoleCommand, AssumeRoleWithWebIdentityCommand, - STSClient, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity, + STSClient, } from "./nested-sts/index"; +/** + * @internal + */ export type { AssumeRoleCommandInput, STSClientConfig } from "./nested-sts";