@aligent/aws-wrappers 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cjs/index.cjs +83 -56
- package/cjs/package.json +1 -1
- package/cjs/src/dynamodb/dynamodb.d.ts +4 -0
- package/cjs/src/s3/s3.d.ts +4 -0
- package/cjs/src/scheduler/scheduler.d.ts +6 -4
- package/cjs/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/cjs/src/sfn/sfn.d.ts +4 -0
- package/cjs/src/sns/sns.d.ts +5 -2
- package/cjs/src/sqs/sqs.d.ts +5 -2
- package/cjs/src/ssm/ssm.d.ts +4 -0
- package/cjs/src/util/redact.d.ts +14 -4
- package/docs/classes/DynamoDBService.md +16 -12
- package/docs/classes/S3Service.md +19 -15
- package/docs/classes/SNSService.md +9 -6
- package/docs/classes/SQSService.md +12 -9
- package/docs/classes/SSMService.md +11 -7
- package/docs/classes/SchedulerService.md +17 -15
- package/docs/classes/SecretsManagerService.md +15 -14
- package/docs/classes/StepFunctionsService.md +10 -6
- package/esm/index.mjs +84 -57
- package/esm/package.json +1 -1
- package/esm/src/dynamodb/dynamodb.d.ts +4 -0
- package/esm/src/s3/s3.d.ts +4 -0
- package/esm/src/scheduler/scheduler.d.ts +6 -4
- package/esm/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/esm/src/sfn/sfn.d.ts +4 -0
- package/esm/src/sns/sns.d.ts +5 -2
- package/esm/src/sqs/sqs.d.ts +5 -2
- package/esm/src/ssm/ssm.d.ts +4 -0
- package/esm/src/util/redact.d.ts +14 -4
- package/package.json +1 -1
|
@@ -4,6 +4,10 @@ import { CreateSecretCommandInput, CreateSecretCommandOutput, DeleteSecretComman
|
|
|
4
4
|
* Wrapper around the AWS Secrets Manager client providing structured
|
|
5
5
|
* Powertools logging and X-Ray tracing by default.
|
|
6
6
|
*
|
|
7
|
+
* Where a method's input carries payloads, secret material or PII, the INFO
|
|
8
|
+
* log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
9
|
+
* `TRACE`) log full SDK inputs.
|
|
10
|
+
*
|
|
7
11
|
* Write operations (`createSecret`, `updateSecret`, `putSecretValue`,
|
|
8
12
|
* `deleteSecret`) are exposed for convenience but should be used with care:
|
|
9
13
|
* secret lifecycle is usually managed by IaC (CDK / Terraform). Prefer IaC
|
|
@@ -43,8 +47,7 @@ export declare class SecretsManagerService {
|
|
|
43
47
|
getJsonSecret<T>(secretId: string): Promise<T>;
|
|
44
48
|
/**
|
|
45
49
|
* Create a new secret. At INFO level the log line includes only identity
|
|
46
|
-
* and non-secret metadata
|
|
47
|
-
* input (including `SecretString` / `SecretBinary`).
|
|
50
|
+
* and non-secret metadata.
|
|
48
51
|
*
|
|
49
52
|
* Prefer IaC (CDK / Terraform) for secret lifecycle — use this for
|
|
50
53
|
* dynamically-issued credentials only.
|
|
@@ -52,8 +55,7 @@ export declare class SecretsManagerService {
|
|
|
52
55
|
createSecret(input: CreateSecretCommandInput): Promise<CreateSecretCommandOutput>;
|
|
53
56
|
/**
|
|
54
57
|
* Update an existing secret's metadata or value. At INFO level the log
|
|
55
|
-
* line omits `SecretString` / `SecretBinary
|
|
56
|
-
* unlocks the full input.
|
|
58
|
+
* line omits `SecretString` / `SecretBinary`.
|
|
57
59
|
*
|
|
58
60
|
* Prefer IaC (CDK / Terraform) for secret lifecycle — use this for
|
|
59
61
|
* runtime metadata updates only.
|
|
@@ -61,8 +63,7 @@ export declare class SecretsManagerService {
|
|
|
61
63
|
updateSecret(input: UpdateSecretCommandInput): Promise<UpdateSecretCommandOutput>;
|
|
62
64
|
/**
|
|
63
65
|
* Store a new version of a secret's value. At INFO level the log line
|
|
64
|
-
* omits `SecretString` / `SecretBinary
|
|
65
|
-
* unlocks the full input.
|
|
66
|
+
* omits `SecretString` / `SecretBinary`.
|
|
66
67
|
*
|
|
67
68
|
* Typically used by rotation flows.
|
|
68
69
|
*/
|
package/esm/src/sfn/sfn.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { DescribeExecutionCommandInput, DescribeExecutionCommandOutput, Executio
|
|
|
3
3
|
/**
|
|
4
4
|
* Wrapper around the AWS Step Functions client providing structured
|
|
5
5
|
* Powertools logging and X-Ray tracing by default.
|
|
6
|
+
*
|
|
7
|
+
* Where a method's input carries payloads, secret material or PII, the INFO
|
|
8
|
+
* log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
9
|
+
* `TRACE`) log full SDK inputs.
|
|
6
10
|
*/
|
|
7
11
|
export declare class StepFunctionsService {
|
|
8
12
|
private readonly client;
|
package/esm/src/sns/sns.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { PublishBatchCommandInput, PublishBatchCommandOutput, PublishCommandInpu
|
|
|
3
3
|
/**
|
|
4
4
|
* Wrapper around the AWS SNS client providing structured Powertools logging
|
|
5
5
|
* and X-Ray tracing by default.
|
|
6
|
+
*
|
|
7
|
+
* Where a method's input carries payloads, secret material or PII, the INFO
|
|
8
|
+
* log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
9
|
+
* `TRACE`) log full SDK inputs.
|
|
6
10
|
*/
|
|
7
11
|
export declare class SNSService {
|
|
8
12
|
private readonly client;
|
|
@@ -28,8 +32,7 @@ export declare class SNSService {
|
|
|
28
32
|
* Publish a single message to an SNS topic.
|
|
29
33
|
*
|
|
30
34
|
* At INFO level the log line includes only routing / dedup metadata; see
|
|
31
|
-
* `PUBLISH_SAFE_FIELDS` for the list.
|
|
32
|
-
* unlocks the full input.
|
|
35
|
+
* `PUBLISH_SAFE_FIELDS` for the list.
|
|
33
36
|
*
|
|
34
37
|
* @param input - PublishCommandInput including TopicArn and Message.
|
|
35
38
|
*/
|
package/esm/src/sqs/sqs.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { DeleteMessageBatchCommandInput, DeleteMessageBatchCommandOutput, Delete
|
|
|
3
3
|
/**
|
|
4
4
|
* Wrapper around the AWS SQS client providing structured Powertools logging
|
|
5
5
|
* and X-Ray tracing by default.
|
|
6
|
+
*
|
|
7
|
+
* Where a method's input carries payloads, secret material or PII, the INFO
|
|
8
|
+
* log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
9
|
+
* `TRACE`) log full SDK inputs.
|
|
6
10
|
*/
|
|
7
11
|
export declare class SQSService {
|
|
8
12
|
private readonly client;
|
|
@@ -27,8 +31,7 @@ export declare class SQSService {
|
|
|
27
31
|
* Send a single message to an SQS queue.
|
|
28
32
|
*
|
|
29
33
|
* At INFO level the log line includes only queue routing / FIFO metadata;
|
|
30
|
-
* see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
31
|
-
* full input.
|
|
34
|
+
* see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
32
35
|
*/
|
|
33
36
|
sendMessage(input: SendMessageCommandInput, opts?: {
|
|
34
37
|
truncate?: boolean;
|
package/esm/src/ssm/ssm.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { Parameter, PutParameterCommandInput, PutParameterCommandOutput, SSMClie
|
|
|
6
6
|
* `WithDecryption` — callers needing plaintext should use `SSMClient`
|
|
7
7
|
* directly.
|
|
8
8
|
*
|
|
9
|
+
* Where a method's input carries payloads, secret material or PII, the INFO
|
|
10
|
+
* log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
11
|
+
* `TRACE`) log full SDK inputs.
|
|
12
|
+
*
|
|
9
13
|
* Write operations (`putParameter`, `deleteParameter`) are exposed for
|
|
10
14
|
* convenience but should be used with care: parameter lifecycle is usually
|
|
11
15
|
* managed by IaC (CDK / Terraform). Prefer IaC for anything that exists at
|
package/esm/src/util/redact.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the logger is verbose enough that full SDK inputs — payloads, secret
|
|
4
|
+
* material and PII — may be written to the log.
|
|
5
|
+
*
|
|
6
|
+
* **This is the only place in the package that reads the log level.** Never
|
|
7
|
+
* compare `logger.getLevelName()` yourself: Powertools orders `TRACE` as *more*
|
|
8
|
+
* verbose than `DEBUG` (thresholds 6 and 8), so the obvious
|
|
9
|
+
* `getLevelName() === 'DEBUG'` check silently redacts at the most verbose level
|
|
10
|
+
* available. Route every disclosure decision through this predicate instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare function shouldLogFullInput(logger: LoggerInterface): boolean;
|
|
2
13
|
/**
|
|
3
14
|
* Return a log-safe projection of `input` based on the logger's configured level.
|
|
4
15
|
*
|
|
5
|
-
* At
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* and PII.
|
|
16
|
+
* At the verbose levels — see {@link shouldLogFullInput} — the full input is
|
|
17
|
+
* returned unchanged: operators who asked for that verbosity have explicitly
|
|
18
|
+
* opted into seeing everything, including payloads, secret material and PII.
|
|
9
19
|
*
|
|
10
20
|
* At any other level, only the fields listed in `safeFields` are included.
|
|
11
21
|
* Missing fields are silently skipped — the result type narrows to
|