@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.
@@ -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; `POWERTOOLS_LOG_LEVEL=DEBUG` unlocks the full
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`; `POWERTOOLS_LOG_LEVEL=DEBUG`
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`; `POWERTOOLS_LOG_LEVEL=DEBUG`
65
- * unlocks the full input.
66
+ * omits `SecretString` / `SecretBinary`.
66
67
  *
67
68
  * Typically used by rotation flows.
68
69
  */
@@ -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;
@@ -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. Setting `POWERTOOLS_LOG_LEVEL=DEBUG`
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
  */
@@ -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`. `POWERTOOLS_LOG_LEVEL=DEBUG` unlocks the
31
- * full input.
34
+ * see `SEND_MESSAGE_SAFE_FIELDS`.
32
35
  */
33
36
  sendMessage(input: SendMessageCommandInput, opts?: {
34
37
  truncate?: boolean;
@@ -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
@@ -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 `DEBUG`, the full input is returned unchanged — operators who set
6
- * `POWERTOOLS_LOG_LEVEL=DEBUG` (or call `logger.setLogLevel('DEBUG')`) have
7
- * explicitly opted into seeing everything, including payloads, secret material
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligent/aws-wrappers",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
5
  "main": "./cjs/index.cjs",
6
6
  "module": "./esm/index.mjs",