@localstack/appinspector-ui 1.0.210 → 1.0.212
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/dist/index.cjs +393 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +381 -89
- package/dist/index.js.map +1 -1
- package/dist/spans-worker.js +13 -6
- package/package.json +1 -1
package/dist/spans-worker.js
CHANGED
|
@@ -194,20 +194,27 @@
|
|
|
194
194
|
// src/utils/span-issues.ts
|
|
195
195
|
var firstText = (...values) => values.find((value) => !!value) ?? void 0;
|
|
196
196
|
var OTEL_STATUS_ERROR = 2;
|
|
197
|
-
var
|
|
198
|
-
const status = span.operation_status;
|
|
197
|
+
var getIamOutcome = (span) => {
|
|
199
198
|
const iamEvents = getIamEvents(span);
|
|
200
199
|
const enforcement = getIamEnforcement(span, iamEvents);
|
|
201
200
|
const iamDenied = enforcement === "deny";
|
|
202
|
-
const iamWarned = enforcement === "allow_with_warning";
|
|
203
|
-
const errorMessages = (span.errors ?? []).filter((item) => item.level === "error");
|
|
204
|
-
const warningMessages = (span.errors ?? []).filter((item) => item.level === "warning");
|
|
205
201
|
const denials = iamEvents.flatMap((event) => {
|
|
206
202
|
if (event.permission === "explicitly_denied") return ["explicit"];
|
|
207
203
|
if (event.permission === "implicitly_denied") return ["implicit"];
|
|
208
204
|
return [];
|
|
209
205
|
});
|
|
210
|
-
|
|
206
|
+
return {
|
|
207
|
+
denials,
|
|
208
|
+
iamDenied,
|
|
209
|
+
iamWarned: enforcement === "allow_with_warning",
|
|
210
|
+
unenforcedDenial: !iamDenied && (denials.length > 0 || span.attributes?.["localstack.has_iam_deny_event"] === true)
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
var getSpanIssues = (span) => {
|
|
214
|
+
const status = span.operation_status;
|
|
215
|
+
const { denials, iamDenied, iamWarned, unenforcedDenial } = getIamOutcome(span);
|
|
216
|
+
const errorMessages = (span.errors ?? []).filter((item) => item.level === "error");
|
|
217
|
+
const warningMessages = (span.errors ?? []).filter((item) => item.level === "warning");
|
|
211
218
|
const error = status === "error" || iamDenied || span.status_code === OTEL_STATUS_ERROR || errorMessages.length > 0;
|
|
212
219
|
const warning = iamWarned || warningMessages.length > 0 || unenforcedDenial;
|
|
213
220
|
const denialCount = unenforcedDenial ? Math.max(1, denials.length) : 0;
|