Skip to content

Commit

Permalink
chore(nested-clients): mark as internal
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Jan 13, 2025
1 parent 33e3afd commit 9eaf934
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 78 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ module.exports = {
"simple-import-sort/imports": "error",
"sort-export-all/sort-export-all": "error",
},
ignorePatterns: ["packages/nested-clients/**/protocols/**.ts"],
};
5 changes: 0 additions & 5 deletions eslint.config.js

This file was deleted.

73 changes: 7 additions & 66 deletions packages/nested-clients/README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 0 additions & 4 deletions packages/nested-clients/api-extractor.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/nested-clients/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
16 changes: 14 additions & 2 deletions packages/nested-clients/src/index.ts
Original file line number Diff line number Diff line change
@@ -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";

0 comments on commit 9eaf934

Please sign in to comment.