@stanterprise/playwright-reporter 1.0.1 → 1.1.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 CHANGED
@@ -65,10 +65,18 @@ You can also configure the reporter using environment variables:
65
65
  - `STANTERPRISE_GRPC_ADDRESS`: gRPC server address (default: `localhost:50051`)
66
66
  - `STANTERPRISE_GRPC_HOST`: gRPC server host
67
67
  - `STANTERPRISE_GRPC_ENABLED`: Enable/disable gRPC reporting (default: `true`)
68
+ - `STANTERPRISE_INGESTION_AUTH_KEY`: Optional shared Observer ingestion key. When set, the reporter sends `authorization: Bearer <key>` as gRPC metadata on every ingestion call. Leave unset for keyless local/AIO Observer.
69
+ - `STANTERPRISE_GRPC_TLS`: Enable TLS for gRPC (default: `true`). Use TLS when sending the key over a network.
68
70
  - `STANTERPRISE_META_*`: Custom metadata fields for test runs (prefix will be stripped)
69
71
  - `STANTERPRISE_DEBUG`: Enable debug mode — captures outgoing gRPC messages to a JSONL file (default: `false`; case-insensitive: `"true"`, `"TRUE"`, `"True"` all work)
70
72
  - `STANTERPRISE_DEBUG_FILE`: File path for debug JSONL output (default: `stanterprise-debug.jsonl`)
71
73
 
74
+ Keep the ingestion key in CI's secret store, not in reporter configuration,
75
+ test metadata, or source control. The key is sent only in gRPC metadata and is
76
+ not written to debug payloads. A missing or incorrect key causes Observer to
77
+ reject ingestion; authentication failures are not retried and are reported
78
+ without printing the key. Local/AIO deployments do not use this variable.
79
+
72
80
  #### Custom Metadata
73
81
 
74
82
  Any environment variable with the `STANTERPRISE_META_` prefix will be automatically included in the test run metadata. The prefix is stripped from the key name.
@@ -526,4 +534,4 @@ ISC - See [LICENSE](LICENSE) file for details
526
534
 
527
535
  ## Support
528
536
 
529
- For issues and questions, please visit the [GitHub repository](https://github.com/stanterprise/stanterprise-playwright-reporter).
537
+ For issues and questions, please visit the [GitHub repository](https://github.com/stanterprise/playwright-reporter).
@@ -86,6 +86,10 @@ function executeSingleAttempt(grpcClient, path, message, deadlineMs) {
86
86
  };
87
87
  const resDeserialize = (bytes) => bytes;
88
88
  const metadata = new grpc.Metadata();
89
+ const ingestionAuthKey = process.env.STANTERPRISE_INGESTION_AUTH_KEY;
90
+ if (ingestionAuthKey) {
91
+ metadata.set("authorization", `Bearer ${ingestionAuthKey}`);
92
+ }
89
93
  const callOptions = {
90
94
  deadline: new Date(Date.now() + deadlineMs),
91
95
  };
@@ -131,6 +135,10 @@ async function attemptWithRetries(options, grpcClient, path, message, deadlineMs
131
135
  const isRetryable = shouldAttemptRetryForCode(statusCode);
132
136
  const hasRetriesLeft = retriesRemaining > 0;
133
137
  if (!isRetryable || !hasRetriesLeft) {
138
+ if (statusCode === grpc.status.UNAUTHENTICATED) {
139
+ throw new Error("Observer rejected ingestion authentication (UNAUTHENTICATED); " +
140
+ "verify STANTERPRISE_INGESTION_AUTH_KEY");
141
+ }
134
142
  throw err;
135
143
  }
136
144
  // Log retry attempt if verbose
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@stanterprise/playwright-reporter",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Custom Playwright test reporter that sends test results to Stanterprise via gRPC",
5
- "homepage": "https://github.com/stanterprise/stanterprise-playwright-reporter#readme",
5
+ "homepage": "https://github.com/stanterprise/playwright-reporter#readme",
6
6
  "bugs": {
7
- "url": "https://github.com/stanterprise/stanterprise-playwright-reporter/issues"
7
+ "url": "https://github.com/stanterprise/playwright-reporter/issues"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/stanterprise/stanterprise-playwright-reporter.git"
11
+ "url": "git+https://github.com/stanterprise/playwright-reporter.git"
12
12
  },
13
13
  "license": "ISC",
14
14
  "author": "Stanterprise Team",